Index: /mpich2/branches/dev/kumudb/test/mpi/spawn/taskmaster.c
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/spawn/taskmaster.c (revision 3304)
+++ /mpich2/branches/dev/kumudb/test/mpi/spawn/taskmaster.c (revision 4870)
@@ -64,4 +64,5 @@
 #endif /* USE_THREADS */
 
+#ifdef USE_THREADS
     CHECK_SUCCESS(MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &provided));
     if (provided != MPI_THREAD_MULTIPLE) {
@@ -69,4 +70,7 @@
 	MPI_Abort(MPI_COMM_WORLD, -1);
     }
+#else
+    MPI_Init(&argc, &argv);
+#endif
 
     CHECK_SUCCESS(MPI_Comm_get_parent(&parent));
Index: /mpich2/branches/dev/kumudb/test/mpi/coll/allred.c
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/coll/allred.c (revision 3899)
+++ /mpich2/branches/dev/kumudb/test/mpi/coll/allred.c (revision 4870)
@@ -9,7 +9,8 @@
 #include <string.h>
 #include "mpi.h"
+#include "mpitest.h"
 
 int count, size, rank;
-int cerrcnt, gerrcnt;
+int cerrcnt;
 
 struct int_test { int a; int b; };
@@ -281,5 +282,5 @@
 int main( int argc, char **argv )
 {
-    MPI_Init(&argc, &argv);
+    MTest_Init( &argc, &argv );
 
     MPI_Comm_size(MPI_COMM_WORLD, &size);
@@ -330,13 +331,5 @@
     minloc_test(struct double_test, MPI_DOUBLE_INT);
 
-    MPI_Allreduce(&cerrcnt, &gerrcnt, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD);
-    if (rank == 0) {
-        if (gerrcnt)
-            printf(" Found %d errors\n", gerrcnt);
-        else
-            printf(" No Errors\n");
-        fflush(stdout);
-    }
-
+    MTest_Finalize( cerrcnt );
     MPI_Finalize();
     return 0;
Index: /mpich2/branches/dev/kumudb/test/mpi/coll/bcasttest.c
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/coll/bcasttest.c (revision 100)
+++ /mpich2/branches/dev/kumudb/test/mpi/coll/bcasttest.c (revision 4870)
@@ -8,4 +8,5 @@
 #include <stdio.h>
 #include <string.h>
+#include "mpitest.h"
 
 #define ROOT      0
@@ -21,5 +22,5 @@
     int num_errors=0, tot_errors;
     
-    MPI_Init(&argc, &argv);
+    MTest_Init( &argc, &argv );
     MPI_Comm_rank(MPI_COMM_WORLD, &rank);
 
@@ -95,14 +96,7 @@
     }
     
-    /* printf("Node %d done\n", rank); */
-    MPI_Reduce( &num_errors, &tot_errors, 1, MPI_INT, MPI_SUM, 0, 
-		MPI_COMM_WORLD );
-    if (rank == 0 && tot_errors == 0) 
-	printf(" No Errors\n");
-
-    fflush(stdout);
-
     free(buf);
 
+    MTest_Finalize( num_errors );
     MPI_Finalize();
     return 0;
Index: /mpich2/branches/dev/kumudb/test/mpi/coll/redscat2.c
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/coll/redscat2.c (revision 3871)
+++ /mpich2/branches/dev/kumudb/test/mpi/coll/redscat2.c (revision 4870)
@@ -16,4 +16,5 @@
 #include <stdio.h>
 #include <stdlib.h>
+#include "mpitest.h"
 
 int err = 0;
@@ -67,5 +68,4 @@
 int main( int argc, char **argv )
 {
-    int      toterr;
     int      *sendbuf, *recvcounts;
     int      block_size;
@@ -75,5 +75,5 @@
     MPI_Op left_op, right_op, nc_sum_op;
 
-    MPI_Init( &argc, &argv );
+    MTest_Init( &argc, &argv );
     comm = MPI_COMM_WORLD;
 
@@ -115,19 +115,11 @@
     }
 
-    MPI_Allreduce( &err, &toterr, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-    if (rank == 0) {
-        if (toterr == 0) {
-            printf( " No Errors\n" );
-        }
-        else {
-            printf( "found %d errors\n", toterr );
-        }
-    }
-
     MPI_Op_free(&left_op);
     MPI_Op_free(&right_op);
     MPI_Op_free(&nc_sum_op);
+
+    MTest_Finalize( err );
     MPI_Finalize( );
 
-    return toterr;
+    return err;
 }
Index: /mpich2/branches/dev/kumudb/test/mpi/coll/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/coll/Makefile.sm (revision 3957)
+++ /mpich2/branches/dev/kumudb/test/mpi/coll/Makefile.sm (revision 4870)
@@ -6,4 +6,5 @@
 #
 bcasttest_SOURCES = bcasttest.c
+bcasttest_LDADD = ../util/mtest.o
 bcast2_SOURCES = bcast2.c
 bcast2_LDADD = ../util/mtest.o
@@ -11,5 +12,5 @@
 bcast3_LDADD = ../util/mtest.o
 allred_SOURCES = allred.c
-allred_LDADD = -lm
+allred_LDADD = -lm ../util/mtest.o
 allred2_SOURCES = allred2.c
 allred2_LDADD = ../util/mtest.o
@@ -37,4 +38,5 @@
 redscat_SOURCES = redscat.c
 redscat2_SOURCES = redscat2.c
+redscat2_LDADD = ../util/mtest.o
 coll9_SOURCES = coll9.c
 coll7_SOURCES = coll7.c
@@ -42,4 +44,5 @@
 coll5_SOURCES = coll5.c
 coll4_SOURCES = coll4.c
+coll4_LDADD = ../util/mtest.o
 coll3_SOURCES = coll3.c
 coll2_SOURCES = coll2.c
Index: /mpich2/branches/dev/kumudb/test/mpi/coll/coll4.c
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/coll/coll4.c (revision 3136)
+++ /mpich2/branches/dev/kumudb/test/mpi/coll/coll4.c (revision 4870)
@@ -6,4 +6,5 @@
 #include "mpi.h"
 #include <stdio.h>
+#include "mpitest.h"
 
 #define MAX_PROCESSES 10
@@ -14,9 +15,9 @@
     int              table[MAX_PROCESSES][MAX_PROCESSES];
     int              row[MAX_PROCESSES];
-    int              errors=0, toterrs = 0;
+    int              errors=0;
     int              participants;
     MPI_Comm         comm;
 
-    MPI_Init( &argc, &argv );
+    MTest_Init( &argc, &argv );
     MPI_Comm_rank( MPI_COMM_WORLD, &rank );
     MPI_Comm_size( MPI_COMM_WORLD, &size );
@@ -50,17 +51,10 @@
 	for (i=0; i<MAX_PROCESSES; i++) 
 	    if ( row[i] != i+rank ) errors++;
-
-	MPI_Allreduce( &errors, &toterrs, 1, MPI_INT, MPI_SUM, comm );
     } 
     
     MPI_Comm_free( &comm );
 
+    MTest_Finalize( errors );
     MPI_Finalize();
-    if (errors)
-      printf( "[%d] done with ERRORS(%d)!\n", rank, errors );
-    else {
-	if (rank == 0 && toterrs == 0) 
-	    printf( " No Errors\n");
-    }
     return errors;
 }
Index: /mpich2/branches/dev/kumudb/test/mpi/info/infomany.c
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/info/infomany.c (revision 3472)
+++ /mpich2/branches/dev/kumudb/test/mpi/info/infomany.c (revision 4870)
@@ -8,4 +8,5 @@
 #include <stdio.h>
 #include <stdlib.h>
+#include "mpitest.h"
 #include "mpitestconf.h"
 #ifdef HAVE_STRING_H
@@ -20,5 +21,5 @@
 /* #define DBG  */
 
-int main( int arg, char *argv[] )
+int main( int argc, char *argv[] )
 {
     MPI_Info infos[MAX_INFOS];
@@ -27,5 +28,5 @@
     int  i, j;
 
-    MPI_Init( 0, 0 );
+    MTest_Init( &argc, &argv );
     
     for (i=0; i<MAX_INFOS; i++) {
@@ -98,11 +99,6 @@
 	MPI_Info_free( &infos[i] );
     }
-    if (errs) {
-	printf( " Found %d errors\n", errs );
-    }
-    else {
-	printf( " No Errors\n" );
-    }
     
+    MTest_Finalize( errs );
     MPI_Finalize( );
     return 0;
Index: /mpich2/branches/dev/kumudb/test/mpi/info/infomany2.c
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/info/infomany2.c (revision 3472)
+++ /mpich2/branches/dev/kumudb/test/mpi/info/infomany2.c (revision 4870)
@@ -9,4 +9,5 @@
 #include <stdio.h>
 #include <stdlib.h>
+#include "mpitest.h"
 #include "mpitestconf.h"
 #ifdef HAVE_STRING_H
@@ -27,5 +28,5 @@
 #endif
 
-int main( int arg, char *argv[] )
+int main( int argc, char *argv[] )
 {
     MPI_Info infos[MAX_INFOS];
@@ -34,5 +35,5 @@
     int  i, j;
 
-    MPI_Init( 0, 0 );
+    MTest_Init( &argc, &argv );
 
     /* We create max_info items, then delete the middle third of them,
@@ -126,11 +127,6 @@
 	MPI_Info_free( &infos[i] );
     }
-    if (errs) {
-	printf( " Found %d errors\n", errs );
-    }
-    else {
-	printf( " No Errors\n" );
-    }
     
+    MTest_Finalize( errs );
     MPI_Finalize( );
     return 0;
Index: /mpich2/branches/dev/kumudb/test/mpi/attr/keyval_double_free.c
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/attr/keyval_double_free.c (revision 4081)
+++ /mpich2/branches/dev/kumudb/test/mpi/attr/keyval_double_free.c (revision 4870)
@@ -8,4 +8,5 @@
 #include <stdlib.h>
 #include <stdio.h>
+#include "mpitest.h"
 
 /* tests multiple invocations of Keyval_free on the same keyval */
@@ -21,5 +22,7 @@
     int keyval = MPI_KEYVAL_INVALID;
     int keyval_copy = MPI_KEYVAL_INVALID;
-    MPI_Init(&argc, &argv);
+    int errs=0;
+
+    MTest_Init( &argc, &argv );
     MPI_Comm_dup(MPI_COMM_SELF, &duped);
 
@@ -33,5 +36,5 @@
     MPI_Keyval_free(&keyval);      /* second MPI_Keyval_free */
     MPI_Keyval_free(&keyval_copy); /* third MPI_Keyval_free */
-    printf(" No Errors\n");
+    MTest_Finalize( errs );
     MPI_Finalize();                /* fourth MPI_Keyval_free */
     return 0;
Index: /mpich2/branches/dev/kumudb/test/mpi/datatype/darray-pack.c
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/datatype/darray-pack.c (revision 3613)
+++ /mpich2/branches/dev/kumudb/test/mpi/datatype/darray-pack.c (revision 4870)
@@ -8,4 +8,5 @@
 #include <stdlib.h>
 #include <string.h>
+#include "mpitest.h"
 
 /* 
@@ -31,7 +32,6 @@
 {
     int err, errs = 0;
-    int toterrs, rank;
-
-    MPI_Init(&argc, &argv); /* MPI-1.2 doesn't allow for MPI_Init(0,0) */
+
+    MTest_Init( &argc, &argv );
     parse_args(argc, argv);
 
@@ -55,14 +55,6 @@
        (including IBM's) check that the number of processes given to 
        Type_create_darray is no larger than MPI_COMM_WORLD */
-    MPI_Reduce( &errs, &toterrs, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD );
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-    if (rank == 0) {
-	if (toterrs) {
-	    fprintf(stderr, "Found %d errors\n", toterrs);
-	}
-	else {
-	    printf(" No Errors\n");
-	}
-    }
+
+    MTest_Finalize( errs );
     MPI_Finalize();
     return 0;
Index: /mpich2/branches/dev/kumudb/test/mpi/datatype/struct-derived-zeros.c
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/datatype/struct-derived-zeros.c (revision 3942)
+++ /mpich2/branches/dev/kumudb/test/mpi/datatype/struct-derived-zeros.c (revision 4870)
@@ -9,4 +9,5 @@
 
 #include <mpi.h>
+#include "mpitest.h"
 
 int main(int argc, char *argv[])
@@ -15,6 +16,7 @@
     MPI_Aint stride = 5, displs[3];
     int i=0, blockcount[3];
+    int errs=0;
 
-    MPI_Init(&argc, &argv);
+    MTest_Init( &argc, &argv );
 
     for(i = 0; i < 3; i++)
@@ -52,9 +54,8 @@
         MPI_Type_free(&vecs[i]);
     }
-    printf(" No Errors\n");
 
+    MTest_Finalize( errs );
     MPI_Finalize();
 
     return 0;
 }
-
Index: /mpich2/branches/dev/kumudb/test/mpi/datatype/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/datatype/Makefile.sm (revision 4345)
+++ /mpich2/branches/dev/kumudb/test/mpi/datatype/Makefile.sm (revision 4870)
@@ -3,4 +3,5 @@
 smvar_do_sharedlibs = 0
 
+typecommit_SOURCES = typecommit.c
 typename_SOURCES = typename.c
 typefree_SOURCES = typefree.c
@@ -29,4 +30,5 @@
 
 struct-no-real-types_SOURCES = struct-no-real-types.c
+struct-no-real-types_LDADD = ../util/mtest.o
 
 slice-pack-external_SOURCES = slice-pack-external.c
@@ -42,4 +44,5 @@
 
 darray-pack_SOURCES = darray-pack.c
+darray-pack_LDADD = ../util/mtest.o
 
 subarray-pack_SOURCES = subarray-pack.c
@@ -66,8 +69,10 @@
 
 struct-derived-zeros_SOURCES = struct-derived-zeros.c
+struct-derived-zeros_LDADD = ../util/mtest.o
 
 localpack_SOURCES = localpack.c
 
 lbub_SOURCES = lbub.c
+lbub_LDADD = ../util/mtest.o
 
 unpack_SOURCES = unpack.c
Index: /mpich2/branches/dev/kumudb/test/mpi/datatype/lbub.c
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/datatype/lbub.c (revision 3503)
+++ /mpich2/branches/dev/kumudb/test/mpi/datatype/lbub.c (revision 4870)
@@ -40,5 +40,5 @@
     int err, errs = 0;
 
-    MPI_Init(&argc, &argv); /* MPI-1.2 doesn't allow for MPI_Init(0,0) */
+    MTest_Init( &argc, &argv );
     parse_args(argc, argv);
 
@@ -88,11 +88,5 @@
     errs += err;
 
-    /* print message and exit */
-    if (errs) {
-	fprintf(stderr, "Found %d errors\n", errs);
-    }
-    else {
-	printf(" No Errors\n");
-    }
+    MTest_Finalize( errs );
     MPI_Finalize();
     return 0;
@@ -1311,4 +1305,5 @@
 }
 
+#if 0
 /* Use this unless mtest is included. */
 void MTestPrintError( int errcode )
@@ -1322,2 +1317,3 @@
     fflush( stdout );
 }
+#endif
Index: /mpich2/branches/dev/kumudb/test/mpi/datatype/simple-pack-external.c
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/datatype/simple-pack-external.c (revision 3934)
+++ /mpich2/branches/dev/kumudb/test/mpi/datatype/simple-pack-external.c (revision 4870)
@@ -9,4 +9,5 @@
 #include <stdlib.h>
 #include <string.h>
+#include "mpitest.h"
 
 static int verbose = 0;
@@ -25,5 +26,5 @@
     int err, errs = 0;
 
-    MPI_Init(&argc, &argv); /* MPI-1.2 doesn't allow for MPI_Init(0,0) */
+    MTest_Init(&argc, &argv);
     parse_args(argc, argv);
 
@@ -53,11 +54,5 @@
     errs += err;
 
-    /* print message and exit */
-    if (errs) {
-	fprintf(stderr, "Found %d errors\n", errs);
-    }
-    else {
-	printf(" No Errors\n");
-    }
+    MTest_Finalize( errs );
     MPI_Finalize();
     return 0;
Index: /mpich2/branches/dev/kumudb/test/mpi/datatype/struct-no-real-types.c
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/datatype/struct-no-real-types.c (revision 3503)
+++ /mpich2/branches/dev/kumudb/test/mpi/datatype/struct-no-real-types.c (revision 4870)
@@ -7,4 +7,5 @@
 #include <stdio.h>
 #include <stdlib.h>
+#include "mpitest.h"
 #include "mpitestconf.h"
 #ifdef HAVE_STRING_H
@@ -30,5 +31,5 @@
     int err, errs = 0;
 
-    MPI_Init(&argc, &argv); /* MPI-1.2 doesn't allow for MPI_Init(0,0) */
+    MTest_Init(&argc, &argv);
     parse_args(argc, argv);
 
@@ -43,11 +44,5 @@
     errs += err;
 
-    /* print message and exit */
-    if (errs) {
-	fprintf(stderr, "Found %d errors\n", errs);
-    }
-    else {
-	printf(" No Errors\n");
-    }
+    MTest_Finalize( errs );
     MPI_Finalize();
     return 0;
Index: /mpich2/branches/dev/kumudb/test/mpi/datatype/triangular-pack.c
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/datatype/triangular-pack.c (revision 3393)
+++ /mpich2/branches/dev/kumudb/test/mpi/datatype/triangular-pack.c (revision 4870)
@@ -8,4 +8,5 @@
 #include <stdio.h>
 #include "mpi.h"
+#include "mpitest.h"
 
 int main(int argc, char *argv[]);
@@ -37,5 +38,5 @@
 	
     /* Initialize MPI */
-    MPI_Init(&argc, &argv);
+    MTest_Init( &argc, &argv );
   
     parse_args(argc, argv);
@@ -80,11 +81,5 @@
     }
 
-    /* print message and exit */
-    if (errs) {
-	printf( "Found %d errors\n", errs);
-    }
-    else {
-	printf(" No Errors\n");
-    }
+    MTest_Finalize( errs );
     MPI_Finalize();
     return 0;
Index: /mpich2/branches/dev/kumudb/test/mpi/datatype/testlist
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/datatype/testlist (revision 4345)
+++ /mpich2/branches/dev/kumudb/test/mpi/datatype/testlist (revision 4870)
@@ -7,4 +7,5 @@
 slice-pack 1
 struct-pack 1
+typecommit 1
 typename 1
 typefree 1
Index: /mpich2/branches/dev/kumudb/test/mpi/datatype/typecommit.c
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/datatype/typecommit.c (revision 4870)
+++ /mpich2/branches/dev/kumudb/test/mpi/datatype/typecommit.c (revision 4870)
@@ -0,0 +1,40 @@
+#include <stdio.h>
+#include <mpi.h>
+#include "mpitest.h"
+
+void foo(void *sendbuf, MPI_Datatype sendtype, void *recvbuf, MPI_Datatype recvtype)
+{
+    int blocks[2];
+    MPI_Aint struct_displs[2];
+    MPI_Datatype types[2], tmp_type;
+
+    blocks[0] = 256;
+    struct_displs[0] = (MPI_Aint) sendbuf;
+    types[0] = sendtype;
+    blocks[1] = 256;
+    struct_displs[1] = (MPI_Aint) recvbuf;
+    types[1] = MPI_BYTE;
+
+    MPI_Type_create_struct(2, blocks, struct_displs, types, &tmp_type);
+    MPI_Type_commit(&tmp_type);
+    MPI_Type_free(&tmp_type);
+}
+
+int main(int argc, char **argv)
+{
+    int errs = 0;
+
+    MTest_Init(&argc, &argv);
+
+    foo((void*) 0x1, MPI_FLOAT_INT, (void*) 0x2, MPI_BYTE);
+    foo((void*) 0x1, MPI_DOUBLE_INT, (void*) 0x2, MPI_BYTE);
+    foo((void*) 0x1, MPI_LONG_INT, (void*) 0x2, MPI_BYTE);
+    foo((void*) 0x1, MPI_SHORT_INT, (void*) 0x2, MPI_BYTE);
+    foo((void*) 0x1, MPI_2INT, (void*) 0x2, MPI_BYTE);
+    foo((void*) 0x1, MPI_LONG_DOUBLE_INT, (void*) 0x2, MPI_BYTE);
+
+    MTest_Finalize(errs);
+    MPI_Finalize();
+
+    return 0;
+}
Index: /mpich2/branches/dev/kumudb/test/mpi/configure.in
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/configure.in (revision 4584)
+++ /mpich2/branches/dev/kumudb/test/mpi/configure.in (revision 4870)
@@ -49,4 +49,9 @@
 fi
 AC_SUBST(mpich2_top_srcdir)
+
+# these (in particular master_top_srcdir) are needed to regenerate
+# Makefile.in files after Makfile.sm files change
+AC_SUBST(master_top_builddir)
+AC_SUBST(master_top_srcdir)
 
 AC_ARG_ENABLE(echo, 
Index: /mpich2/branches/dev/kumudb/test/mpi/comm/ic1.c
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/comm/ic1.c (revision 3456)
+++ /mpich2/branches/dev/kumudb/test/mpi/comm/ic1.c (revision 4870)
@@ -10,12 +10,13 @@
 #include "mpi.h"
 #include <stdio.h>
+#include "mpitest.h"
 
 int main( int argc, char *argv[] )
 {
     MPI_Comm intercomm;
-    int      remote_rank, rank, size, errs = 0, toterr;
+    int      remote_rank, rank, size, errs = 0;
     volatile int trigger;
 
-    MPI_Init( &argc, &argv );
+    MTest_Init( &argc, &argv );
 
     trigger = 1;
@@ -56,14 +57,5 @@
        sizes FIXME */
 
-    MPI_Allreduce( &errs, &toterr, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-    if (rank == 0) {
-	if (toterr == 0) {
-	    printf( " No Errors\n" );
-	}
-	else {
-	    printf (" Found %d errors\n", toterr );
-	}
-    }
-    
+    MTest_Finalize( errs );
     MPI_Finalize();
     
Index: /mpich2/branches/dev/kumudb/test/mpi/perf/testlist
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/perf/testlist (revision 4521)
+++ /mpich2/branches/dev/kumudb/test/mpi/perf/testlist (revision 4870)
@@ -1,5 +1,5 @@
 transp-datatype 2
 sendrecvl 2
-twovec 1
+# twovec 1
 dtpack 1
 non_zero_root 4
Index: /mpich2/branches/dev/kumudb/test/mpi/f90/f90types/createf90types.c
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/f90/f90types/createf90types.c (revision 3578)
+++ /mpich2/branches/dev/kumudb/test/mpi/f90/f90types/createf90types.c (revision 4870)
@@ -8,4 +8,5 @@
 #include <stdio.h>
 #include <stdlib.h>
+#include "mpitest.h"
 
 static char MTEST_Descrip[] = "Test the routines to access the Fortran 90 datatypes from C";
@@ -91,5 +92,5 @@
     MPI_Datatype newtype;
 
-    MPI_Init(0,0);
+    MTest_Init(0,0);
 
     if (argc > 1) {
@@ -143,11 +144,5 @@
     }
 
-    if (errs == 0) {
-	printf( " No Errors\n" );
-    }
-    else {
-	printf( " Found %d errors\n", errs );
-    }
-
+    MTest_Finalize( errs );
     MPI_Finalize();
     return 0;
Index: /mpich2/branches/dev/kumudb/test/mpi/f90/f90types/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/f90/f90types/Makefile.sm (revision 3714)
+++ /mpich2/branches/dev/kumudb/test/mpi/f90/f90types/Makefile.sm (revision 4870)
@@ -1,2 +1,4 @@
+INCLUDES = -I../../include -I${srcdir}/../../include
+
 createf90types_SOURCES   = createf90types.c
 createf90types_LDADD     = ../../util/mtest.o
Index: /mpich2/branches/dev/kumudb/test/mpi/f90/datatype/createf90.f90
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/f90/datatype/createf90.f90 (revision 3347)
+++ /mpich2/branches/dev/kumudb/test/mpi/f90/datatype/createf90.f90 (revision 4870)
@@ -8,5 +8,4 @@
         integer errs
         integer nints, nadds, ndtypes, combiner
-        integer rank
         integer nparms(2), dummy(1)
         integer (kind=MPI_ADDRESS_KIND) adummy(1)
@@ -16,5 +15,5 @@
 !
         errs = 0
-        call mpi_init( ierr )
+        call mtest_init( ierr )
 
 ! integers with upto 9 are 4 bytes integers; r of 4 are 2 byte,
@@ -64,13 +63,5 @@
         enddo
 
-        call mpi_comm_rank( MPI_COMM_WORLD, rank, ierr )
-        if (rank .eq. 0) then
-           if (errs .eq. 0) then
-              print *, " No Errors"
-           else
-              print *, " Found ", errs, " Errors"
-           endif
-        endif
-
+        call mtest_finalize( errs )
         call mpi_finalize( ierr )
         
Index: /mpich2/branches/dev/kumudb/test/mpi/f90/datatype/indtype.f90
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/f90/datatype/indtype.f90 (revision 100)
+++ /mpich2/branches/dev/kumudb/test/mpi/f90/datatype/indtype.f90 (revision 4870)
@@ -18,7 +18,11 @@
 
       verbose = .false. 
-      call mpi_init ( ierr )
+      call mtest_init ( ierr )
       call mpi_comm_size( MPI_COMM_WORLD, size, ierr )
       call mpi_comm_rank( MPI_COMM_WORLD, rank, ierr )
+      if (size .lt. 2) then
+         print *, "Must have at least 2 processes"
+         call MPI_Abort( 1, MPI_COMM_WORLD, ierr )
+      endif
 
       errs = 0
@@ -104,14 +108,8 @@
            enddo
         enddo
-
+      endif
 !
-         if (errs .eq. 0) then
-            print*,' No Errors'
-         else
-            print*,'**',errs,' errors found.'
-         endif
-      endif
-
       call mpi_type_free( type, ierr )
+      call mtest_finalize( errs )
       call mpi_finalize( ierr )
 
Index: /mpich2/branches/dev/kumudb/test/mpi/f90/datatype/sizeof.f90
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/f90/datatype/sizeof.f90 (revision 100)
+++ /mpich2/branches/dev/kumudb/test/mpi/f90/datatype/sizeof.f90 (revision 4870)
@@ -22,5 +22,5 @@
       verbose = .false.
       errs = 0
-      call mpi_init ( ierr )
+      call mtest_init ( ierr )
       call mpi_comm_rank( MPI_COMM_WORLD, rank, ierr )
 
@@ -74,14 +74,6 @@
       endif
 
-      if (rank .eq. 0) then
-         if (errs == 0) then
-            print*,' No Errors'
-         else
-            print*,'**',errs,' errors found.'
-         endif
-      endif
-
+      call mtest_finalize( errs )
       call mpi_finalize( ierr )
 
       end
-      
Index: /mpich2/branches/dev/kumudb/test/mpi/f77/ext/ctypesinf.f
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/f77/ext/ctypesinf.f (revision 3396)
+++ /mpich2/branches/dev/kumudb/test/mpi/f77/ext/ctypesinf.f (revision 4870)
@@ -2,8 +2,8 @@
       include 'mpif.h'
       integer ierr
-      integer errs, toterrs, wrank
+      integer errs, wrank
       integer f2ctype
 C
-      call mpi_init( ierr )
+      call mtest_init( ierr )
       call mpi_comm_rank( MPI_COMM_WORLD, wrank, ierr )
 C
@@ -39,14 +39,5 @@
 C Summarize the errors
 C
-      call mpi_allreduce( errs, toterrs, 1, MPI_INTEGER, MPI_SUM,
-     $     MPI_COMM_WORLD, ierr )
-      if (wrank .eq. 0) then
-         if (toterrs .eq. 0) then
-            print *, ' No Errors'
-         else
-            print *, ' Found ', toterrs, ' errors'
-         endif
-      endif
-
+      call mtest_finalize( errs )
       call mpi_finalize( ierr )
 
Index: /mpich2/branches/dev/kumudb/test/mpi/f77/ext/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/f77/ext/Makefile.sm (revision 3396)
+++ /mpich2/branches/dev/kumudb/test/mpi/f77/ext/Makefile.sm (revision 4870)
@@ -1,5 +1,6 @@
 # We don't use a general LDADD for mtestf.o because c2fmult is a C-only
 # program
-DEPADD = @MPILIBLOC@ ../util/mtestf.o
+INCLUDES = -I../../include -I${srcdir}/../../include
+DEPADD = @MPILIBLOC@ ../util/mtestf.o ../../util/mtest.o
 smvar_do_sharedlibs = 0
 
@@ -15,5 +16,12 @@
 ctypesinf_LDADD = ../util/mtestf.o
 c2fmult_SOURCES = c2fmult.c
+c2fmult_LDADD = ../../util/mtest.o
+
+# need to add this to get it to appear in ../../f90/ext/Makefile.sm
+c2f90mult_LDADD = ../../util/mtest.o
 
 ../util/mtestf.o: 
 	(cd ../util && $(MAKE) mtestf.o)
+
+../util/mtest.o:
+	(cd ../../util && $(MAKE))
Index: /mpich2/branches/dev/kumudb/test/mpi/f77/ext/c2fmult.c
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/f77/ext/c2fmult.c (revision 100)
+++ /mpich2/branches/dev/kumudb/test/mpi/f77/ext/c2fmult.c (revision 4870)
@@ -15,4 +15,5 @@
 #include "mpi.h"
 #include <stdio.h>
+#include "mpitest.h"
 
 int main( int argc, char *argv[] )
@@ -21,10 +22,8 @@
     int      rc;
     int      errs = 0;
-    int      rank;
     int      buf[1];
     MPI_Request cRequest;
 
-    MPI_Init( &argc, &argv );
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+    MTest_Init( &argc, &argv );
 
     /* Request */
@@ -45,13 +44,5 @@
     MPI_Request_free( &cRequest );
 
-    if (rank == 0) {
-	if (errs) {
-	    fprintf(stderr, "Found %d errors\n", errs);
-	}
-	else {
-	    printf(" No Errors\n");
-	}
-    }
-    
+    MTest_Finalize( errs );
     MPI_Finalize();
     
Index: /mpich2/branches/dev/kumudb/test/mpi/f77/io/miscfilef.f
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/f77/io/miscfilef.f (revision 3594)
+++ /mpich2/branches/dev/kumudb/test/mpi/f77/io/miscfilef.f (revision 4870)
@@ -14,5 +14,5 @@
       integer rank, size
       integer fh, i, group, worldgroup, result
-      integer ierr, errs, toterrs
+      integer ierr, errs
       integer BUFSIZE
       parameter (BUFSIZE=1024)
@@ -26,5 +26,5 @@
 C      
       errs = 0
-      call mpi_init( ierr )
+      call mtest_init( ierr )
       call mpi_comm_rank( MPI_COMM_WORLD, rank, ierr )
       call mpi_comm_size( MPI_COMM_WORLD, size, ierr )
@@ -203,18 +203,8 @@
          call MPI_File_delete(filename, MPI_INFO_NULL, ierr )
       endif
-C
-C Get error summary
-      call MPI_Allreduce( errs, toterrs, 1, MPI_INTEGER, MPI_SUM,         &
-     &     MPI_COMM_WORLD, ierr )
-      if (rank .eq. 0) then
-         if( toterrs .gt. 0) then
-            print *, "Found ", toterrs, " errors"
-         else 
-            print *, " No Errors"
-         endif
-      endif
 
       call mpi_type_free( newtype, ierr )
 
+      call mtest_finalize( errs )
       call mpi_finalize( ierr )
       end
Index: /mpich2/branches/dev/kumudb/test/mpi/f77/io/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/f77/io/Makefile.sm (revision 100)
+++ /mpich2/branches/dev/kumudb/test/mpi/f77/io/Makefile.sm (revision 4870)
@@ -38,4 +38,6 @@
 atomicityf_SOURCES    = atomicityf.f
 miscfilef_SOURCES     = miscfilef.f
+miscfilef_LDADD     = ../util/mtestf.o
+
 setviewcurf_SOURCES   = setviewcurf.f
 setviewcurf_LDADD     = ../util/mtestf.o
Index: /mpich2/branches/dev/kumudb/test/mpi/f77/datatype/typenamef.f
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/f77/datatype/typenamef.f (revision 3594)
+++ /mpich2/branches/dev/kumudb/test/mpi/f77/datatype/typenamef.f (revision 4870)
@@ -14,5 +14,5 @@
       errs = 0
 
-      call MPI_Init(ierr)
+      call mtest_init( ierr )
 C
 C Check each Fortran datatype, including the size-specific ones
@@ -200,10 +200,5 @@
 C      endif
 
-      if (errs .gt. 0) then
-          print *, ' Found ', errs, ' errors'
-      else
-          print *, ' No Errors'
-      endif
-
+      call mtest_finalize( errs )
       call MPI_Finalize( ierr )
       end
Index: /mpich2/branches/dev/kumudb/test/mpi/pt2pt/cancelrecv.c
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/pt2pt/cancelrecv.c (revision 3463)
+++ /mpich2/branches/dev/kumudb/test/mpi/pt2pt/cancelrecv.c (revision 4870)
@@ -15,9 +15,9 @@
     MPI_Status  s[3];
     int *buf0, *buf1, *buf2;
-    int rank, size, src, dest, flag, errs = 0, toterrs;
+    int rank, size, src, dest, flag, errs = 0;
     int n0, n1, n2;
     MPI_Comm comm;
 
-    MPI_Init( &argc, &argv );
+    MTest_Init( &argc, &argv );
 
     MPI_Comm_size( MPI_COMM_WORLD, &size );
@@ -132,15 +132,5 @@
     }
 
-    MPI_Reduce( &errs, &toterrs, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD );
-    if (rank == 0) {
-	if (toterrs) { 
-	    printf( " Found %d errors\n", toterrs );
-	}
-	else {
-	    printf( " No Errors\n" );
-	}
-	fflush(stdout);
-    }
-
+    MTest_Finalize( errs );
     MPI_Finalize();
 
Index: /mpich2/branches/dev/kumudb/test/mpi/errors/topo/testlist
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/errors/topo/testlist (revision 100)
+++ /mpich2/branches/dev/kumudb/test/mpi/errors/topo/testlist (revision 4870)
Index: /mpich2/branches/dev/kumudb/test/mpi/errors/spawn/badport.c
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/errors/spawn/badport.c (revision 3347)
+++ /mpich2/branches/dev/kumudb/test/mpi/errors/spawn/badport.c (revision 4870)
@@ -6,4 +6,5 @@
 #include "mpi.h"
 #include <stdio.h>
+#include "mpitest.h"
 
 /* Set verbose to 1 to see the error message */
@@ -15,5 +16,5 @@
     MPI_Comm newcomm = MPI_COMM_NULL;
 
-    MPI_Init( &argc, &argv );
+    MTest_Init( &argc, &argv );
 
     MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
@@ -40,10 +41,5 @@
     fflush(stdout);
 
-    if (errs) {
-	printf( " Found %d errors\n", errs );
-    }
-    else
-	printf( " No Errors\n" );
-
+    MTest_Finalize( errs );
     MPI_Finalize();
 
Index: /mpich2/branches/dev/kumudb/test/mpi/errors/coll/bcastlength.c
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/errors/coll/bcastlength.c (revision 100)
+++ /mpich2/branches/dev/kumudb/test/mpi/errors/coll/bcastlength.c (revision 4870)
@@ -6,4 +6,5 @@
 #include <stdio.h>
 #include "mpi.h"
+#include "mpitest.h"
 
 /* Very simple test that Bcast handled mismatched lengths (while not a 
@@ -21,5 +22,5 @@
     int       slen;
 
-    MPI_Init( &argc, &argv );
+    MTest_Init( &argc, &argv );
     
     MPI_Errhandler_set( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
@@ -74,13 +75,5 @@
     MPI_Errhandler_set( MPI_COMM_WORLD, MPI_ERRORS_ARE_FATAL );
 
-    MPI_Allreduce( &errs, &toterrs, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-    if (rank == 0) {
-	if (toterrs == 0) {
-	    printf( " No Errors\n" );
-	}
-	else {
-	    printf( " Found %d errors\n", toterrs );
-	}
-    }
+    MTest_Finalize( errs );
     MPI_Finalize( );
     return 0;
Index: /mpich2/branches/dev/kumudb/test/mpi/errors/coll/rerr.c
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/errors/coll/rerr.c (revision 100)
+++ /mpich2/branches/dev/kumudb/test/mpi/errors/coll/rerr.c (revision 4870)
@@ -6,4 +6,5 @@
 #include <stdio.h>
 #include "mpi.h"
+#include "mpitest.h"
 
 /* Very simple test that Allreduce detects invalid (datatype,operation)
@@ -14,10 +15,9 @@
 int main( int argc, char *argv[] )
 {
-    int a, b, ierr, errs=0, toterrs;
-    int rank;
+    int a, b, ierr, errs=0;
     char      str[MPI_MAX_ERROR_STRING+1];
     int       slen;
 
-    MPI_Init( &argc, &argv );
+    MTest_Init( &argc, &argv );
     
     MPI_Errhandler_set( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
@@ -37,14 +37,5 @@
     MPI_Errhandler_set( MPI_COMM_WORLD, MPI_ERRORS_ARE_FATAL );
 
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-    MPI_Allreduce( &errs, &toterrs, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-    if (rank == 0) {
-	if (toterrs == 0) {
-	    printf( " No Errors\n" );
-	}
-	else {
-	    printf( " Found %d errors\n", toterrs );
-	}
-    }
+    MTest_Finalize( errs );
     MPI_Finalize( );
     return 0;
Index: /mpich2/branches/dev/kumudb/test/mpi/errors/comm/manysplit.c
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/errors/comm/manysplit.c (revision 897)
+++ /mpich2/branches/dev/kumudb/test/mpi/errors/comm/manysplit.c (revision 4870)
@@ -7,4 +7,5 @@
 #include <stdlib.h>
 #include <mpi.h>
+#include "mpitest.h"
 
 /* Test that comm_split fails gracefully when the number of communicators
@@ -19,7 +20,8 @@
   int i, rank;
   int rc, maxcomm;
+  int errs = 0;
   MPI_Comm comm[MAX_COMMS];
 
-  MPI_Init (&argc, &argv);
+  MTest_Init( &argc, &argv );
   MPI_Comm_rank ( MPI_COMM_WORLD, &rank );
   MPI_Errhandler_set( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
@@ -47,7 +49,5 @@
   }
   /* If we complete, there are no errors */
-  if (rank == 0) {
-      printf( " No Errors\n" );
-  }
+  MTest_Finalize( errs );
   MPI_Finalize();
   return 0;
Index: /mpich2/branches/dev/kumudb/test/mpi/errors/group/gerr.c
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/errors/group/gerr.c (revision 100)
+++ /mpich2/branches/dev/kumudb/test/mpi/errors/group/gerr.c (revision 4870)
@@ -7,4 +7,5 @@
 #include "mpi.h"
 #include <stdio.h>
+#include "mpitest.h"
 
 /*
@@ -16,12 +17,12 @@
 int main( int argc, char *argv[] )
 {
-    int errs = 0, toterrs;
+    int errs = 0;
     int rc;
-    int ranks[2], rank;
+    int ranks[2];
     MPI_Group ng;
     char      str[MPI_MAX_ERROR_STRING+1];
     int       slen;
 
-    MPI_Init( &argc, &argv );
+    MTest_Init( &argc, &argv );
     /* Set errors return */
     MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
@@ -41,15 +42,5 @@
     }
 
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-    MPI_Allreduce( &errs, &toterrs, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-    if (rank == 0) {
-	if (toterrs == 0) {
-	    printf( " No Errors\n" );
-	}
-	else {
-	    printf( " Found %d errors\n", toterrs );
-	}
-    }
-
+    MTest_Finalize( errs );
     MPI_Finalize( );
     return 0;
Index: /mpich2/branches/dev/kumudb/test/mpi/errors/cxx/errhan/errgetx.cxx
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/errors/cxx/errhan/errgetx.cxx (revision 3347)
+++ /mpich2/branches/dev/kumudb/test/mpi/errors/cxx/errhan/errgetx.cxx (revision 4870)
@@ -13,6 +13,8 @@
 */
 
+#include "mpitestconf.h"
 #include <mpi.h>
 #include <iostream>
+#include "mpitestcxx.h"
 
 /* #define VERBOSE */
@@ -64,5 +66,5 @@
     MPI::File file = MPI::FILE_NULL;
 
-    MPI::Init();
+    MTest_Init( );
 
     const unsigned int rank = MPI::COMM_WORLD.Get_rank();
@@ -79,10 +81,5 @@
     }
 
-    if (errs == 0) {
-        std::cout << " No Errors" << std::endl;
-    }
-    else {
-        std::cout << " Found " << errs << " errors" << std::endl;
-    }
+    MTest_Finalize( errs );
 
     win.Free();
Index: /mpich2/branches/dev/kumudb/test/mpi/errors/cxx/errhan/throwtest.cxx
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/errors/cxx/errhan/throwtest.cxx (revision 3319)
+++ /mpich2/branches/dev/kumudb/test/mpi/errors/cxx/errhan/throwtest.cxx (revision 4870)
@@ -16,4 +16,5 @@
 #include <mpi.h>
 #include <iostream>
+#include "mpitestcxx.h"
 
 /* #define VERBOSE */
@@ -61,5 +62,5 @@
     MPI::File file = MPI::FILE_NULL;
 
-    MPI::Init();
+    MTest_Init( );
 
     const unsigned int rank = MPI::COMM_WORLD.Get_rank();
@@ -160,10 +161,5 @@
     }
 
-    if (errs == 0) {
-        std::cout << " No Errors" << std::endl;
-    }
-    else {
-        std::cout << " Found " << errs << " errors" << std::endl;
-    }
+    MTest_Finalize( errs );
 
     win.Free();
Index: /mpich2/branches/dev/kumudb/test/mpi/errors/cxx/errhan/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/errors/cxx/errhan/Makefile.sm (revision 854)
+++ /mpich2/branches/dev/kumudb/test/mpi/errors/cxx/errhan/Makefile.sm (revision 4870)
@@ -4,5 +4,7 @@
 
 errgetx_SOURCES   = errgetx.cxx
+errgetx_LDADD     = ../../../cxx/util/mtest.o
 errsetx_SOURCES   = errsetx.cxx
+errsetx_LDADD     = ../../../cxx/util/mtest.o
 throwtest_SOURCES = throwtest.cxx
 
Index: /mpich2/branches/dev/kumudb/test/mpi/errors/cxx/errhan/errsetx.cxx
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/errors/cxx/errhan/errsetx.cxx (revision 100)
+++ /mpich2/branches/dev/kumudb/test/mpi/errors/cxx/errhan/errsetx.cxx (revision 4870)
@@ -5,6 +5,6 @@
  *      See COPYRIGHT in top-level directory.
  */
+#include "mpitestconf.h"
 #include "mpi.h"
-#include "mpitestconf.h"
 #ifdef HAVE_IOSTREAM
 // Not all C++ compilers have iostream instead of iostream.h
@@ -24,6 +24,4 @@
 #include "mpitestcxx.h"
 
-static int verbose = 0;
-
 static int ncalls = 0;
 void efn( MPI::Comm &comm, int *code, ... )
@@ -35,11 +33,9 @@
 {
     MPI::Errhandler eh;
-    char *filename;
     int size;
     bool foundMsg;
-    int errs = 0, toterrs, rank;
-    int sawErr;
+    int errs = 0;
 
-    MPI::Init();
+    MTest_Init( );
 
     size = MPI::COMM_WORLD.Get_size();
@@ -52,5 +48,4 @@
     eh = MPI::Comm::Create_errhandler( efn );
     MPI::COMM_WORLD.Set_errhandler( eh );
-    sawErr = 0;
     try {
 	foundMsg = MPI::COMM_WORLD.Iprobe( size, 0 );
@@ -62,5 +57,4 @@
 	    cout << "Unexpected error from Iprobe" << endl;
 	}
-	sawErr = 1;
     }
     if (ncalls != 1) {
@@ -70,14 +64,6 @@
 
     // Find out how many errors we saw
-    MPI::COMM_WORLD.Allreduce( &errs, &toterrs, 1, MPI::INT, MPI::SUM );
-    if (MPI::COMM_WORLD.Get_rank() == 0) {
-	if (toterrs == 0) {
-	    cout << " No Errors" << endl;
-	}
-	else {
-	    cout << " Saw " << toterrs << " errors" << endl;
-	}
-    }
 
+    MTest_Finalize( errs );
     MPI::Finalize();
 
Index: /mpich2/branches/dev/kumudb/test/mpi/errors/io/fileerrret.c
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/errors/io/fileerrret.c (revision 100)
+++ /mpich2/branches/dev/kumudb/test/mpi/errors/io/fileerrret.c (revision 4870)
@@ -29,7 +29,7 @@
     MPI_Errhandler eh;
     char filename[10];
-    int errs = 0, toterrs, rank, rc;
+    int errs = 0, rc;
 
-    MPI_Init( &argc, &argv );
+    MTest_Init( &argc, &argv );
 
     /* Test that the default error handler is errors return for files */
@@ -51,4 +51,5 @@
 		       MPI_MODE_RDWR, MPI_INFO_NULL, &fh );
     if (rc) {
+        errs++;
 	printf( "Returned error from open (should have called error handler instead)\n");
     }
@@ -59,15 +60,6 @@
     
     /* Find out how many errors we saw */
-    MPI_Allreduce( &errs, &toterrs, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-    if (rank == 0) {
-	if (toterrs == 0) {
-	    printf( " No Errors\n" );
-	}
-	else {
-	    printf( " Saw %d errors\n", toterrs );
-	}
-    }
 
+    MTest_Finalize( errs );
     MPI_Finalize();
 
Index: /mpich2/branches/dev/kumudb/test/mpi/errors/pt2pt/truncmsg2.c
===================================================================
--- /mpich2/branches/dev/kumudb/test/mpi/errors/pt2pt/truncmsg2.c (revision 1118)
+++ /mpich2/branches/dev/kumudb/test/mpi/errors/pt2pt/truncmsg2.c (revision 4870)
@@ -16,4 +16,5 @@
 
 #include <mpi.h>
+#include "mpitest.h"
 
 #define BUFSIZE 128
@@ -60,5 +61,5 @@
     int contig_indexed_type;
 
-    ret = MPI_Init(&argc, &argv);
+    MTest_Init( &argc, &argv );
     ret = MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
     ret = MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
@@ -120,7 +121,4 @@
 	    errs++;
 	}
-	else {
-	    printf( " No Errors\n" );
-	}
     }
 
@@ -133,4 +131,5 @@
     MPI_Free_mem(sendrec);
 
+    MTest_Finalize( errs );
     MPI_Finalize( );
 
Index: /mpich2/branches/dev/kumudb/configure.in
===================================================================
--- /mpich2/branches/dev/kumudb/configure.in (revision 4827)
+++ /mpich2/branches/dev/kumudb/configure.in (revision 4870)
@@ -241,5 +241,4 @@
 [--enable-echo  - Turn on strong echoing. The default is enable=no.] ,set -x)
 dnl
-AC_ARG_ENABLE(strict,[--enable-strict - Turn on strict debugging with gcc],,enable_strict=no)
 dnl
 AC_ARG_ENABLE(coverage,
@@ -1604,5 +1603,6 @@
 # Set CFLAGS for enable strict if necessary.  Do this *first* because
 # it may influence the output of the other tests
-PAC_CC_STRICT
+AC_ARG_ENABLE(strict,[--enable-strict - Turn on strict debugging with gcc],,enable_strict=no)
+PAC_CC_STRICT($enable_strict)
 if test -n "$pac_cc_strict_flags" ; then
     MPICH2_EXTRA_CFLAGS="$MPICH2_EXTRA_CFLAGS $pac_cc_strict_flags"
@@ -1808,4 +1808,73 @@
 	fi
     fi
+
+    # The MPI standard requires that MPI_Init in any language initialize
+    # MPI in all languages.  This can be a problem when objects produced 
+    # by the Fortran compiler require symbols from the Fortran runtime
+    # (making linking C-only programs unnecessarily difficult).  What we test 
+    # here is whether the much more restricted needs of the Fortran 
+    # initialize can be met with no special use of the Fortran runtime
+    pac_f_init_works_with_c=unknown
+    AC_MSG_CHECKING([whether Fortran init will work with C])
+    rm -f conftest*
+    cat > conftestc.c <<EOF
+#include <stdio.h>
+#include "confdefs.h"
+#ifdef F77_NAME_UPPER
+#define minit_ MINIT
+#elif defined(F77_NAME_LOWER) || defined(F77_NAME_MIXED)
+#define minit_ minit
+#endif
+int main( int argc, char *argv )
+{
+    minit_();
+    return 0;
+}
+char *v1 = 0;
+char *vc2 = 0;
+int  v2 = 0;
+minitc_( char *dv1, int d, char *dv2, int d2, int dv3 )
+{
+v1 = dv1;
+v2 = dv3;
+vc2 = dv2;
+*vc2 = ' ';
+}
+EOF
+    cat > conftestf.f <<EOF
+       subroutine minit()
+       common /m1/ vc, vc2
+       character *1 vc(1,1), vc2(1)
+       common /m2/ vd
+       integer vd
+       save /m1/, /m2/
+       call minitc( vc, vc2, vd )
+       end
+EOF
+   myfcompile='${F77-f77} -c $FFLAGS conftestf.f 1>&AC_FD_CC'
+   myccompile='${CC-cc} -c $CFLAGS conftestc.c 1>&AC_FD_CC'
+   if AC_TRY_EVAL(myfcompile) && test -s conftestf.o ; then
+       :
+   else 
+	echo "configure: failed program was:" >&AC_FD_CC
+        cat conftestf.f >&AC_FD_CC
+   fi
+   if AC_TRY_EVAL(myccompile) && test -s conftestc.o ; then
+       :
+   else 
+	echo "configure: failed program was:" >&AC_FD_CC
+        cat conftestc.c >&AC_FD_CC
+   fi
+   # Now try the link step
+   myclink='${CC-cc} $CFLAGS -o conftest conftestc.o conftestf.o $LDFLAGS >conftest.out 2>&1'
+   if AC_TRY_EVAL(myclink) && test -x conftest${ac_exeext} ; then
+      pac_f_init_works_with_c=yes
+   else
+      pac_f_init_works_with_c=no
+   fi
+   AC_MSG_RESULT($pac_f_init_works_with_c)
+   if test "$pac_f_init_works_with_c" = "yes" ; then
+       AC_DEFINE(HAVE_MPI_F_INIT_WORKS_WITH_C,1,[Define if the Fortran init code for MPI works from C programs without special libraries])
+   fi
 fi
 
@@ -2630,4 +2699,7 @@
 
 # Copy the mpicxx.h file to the main include directory
+# Move a working version of the mpicxx script to the bin directory
+# Create an alias mpic++ for mpicxx (BOOST, at least, makes invalid assumptions
+# about the name of the MPI C++ compilation script)
 AC_OUTPUT_COMMANDS([if test $enable_cxx = yes ; then 
 if test "$bashWorks" = yes ; then cp -f src/env/mpicxx.bash src/env/mpicxx ; fi
@@ -2640,4 +2712,5 @@
     src/env/mpicxx > bin/mpicxx ;
 chmod a+x bin/mpicxx
+ln -sf mpicxx bin/mpic++
 else
     rm -f src/env/mpicxx src/env/mpicxx.conf
@@ -3086,5 +3159,10 @@
 PAC_C_VOLATILE
 PAC_C_RESTRICT
+
+saveCFLAGS=$CFLAGS
+CFLAGS="$CFLAGS $MPICH2_EXTRA_CFLAGS"
 AC_C_INLINE
+CFLAGS=$saveCFLAGS
+
 PAC_C_GNU_ATTRIBUTE
 # We need to check for the endianess in order to implement the
@@ -4277,7 +4355,8 @@
         eval fullvarvalue=\$$fullvar
         #echo "$fullvar = $fullvarvalue"
-	if test "x$fullvarvalue" = "x" ; then
+	if test "x$fullvarvalue" = "x" -o \
+	        "x$fullvarvalue" = "xMPI_DATATYPE_NULL" ; then
              eval $fullf77var="MPI_DATATYPE_NULL"
-             continue
+ 	     continue
         fi
         value=0
@@ -5011,6 +5090,9 @@
 if test "$ac_cv_func_vsnprintf" = "yes" ; then
     # vsnprintf may be declared in stdio.h and may need stdarg.h 
+    saveCFLAGS=$CFLAGS
+    CFLAGS="$CFLAGS $MPICH2_EXTRA_CFLAGS"
     PAC_FUNC_NEEDS_DECL([#include <stdio.h>
 #include <stdarg.h>],vsnprintf)
+    CFLAGS=$saveCFLAGS
 fi
 # We would like to use strerror in the file namepublisher; it is also used
@@ -5021,5 +5103,8 @@
 AC_CHECK_FUNCS(snprintf)
 if test "$ac_cv_func_snprintf" = "yes" ; then
+    saveCFLAGS=$CFLAGS
+    CFLAGS="$CFLAGS $MPICH2_EXTRA_CFLAGS"
     PAC_FUNC_NEEDS_DECL([#include <stdio.h>],snprintf)
+    CFLAGS=$saveCFLAGS
 fi
 # if we are using stdarg, we may need va_copy .  Test to see if we have it
@@ -5030,4 +5115,6 @@
 # test in confdb/aclocal_cc.m4).
 AC_CACHE_CHECK([for va_copy],pac_cv_func_va_copy,[
+saveCFLAGS=$CFLAGS
+CFLAGS="$CFLAGS $MPICH2_EXTRA_CFLAGS"
 AC_TRY_LINK([
 #include <stdarg.h>
@@ -5040,10 +5127,12 @@
 }
 ],[foo1("a test %d", 3);],pac_cv_func_va_copy=yes,pac_cv_func_va_copy=no)])
+CFLAGS=$saveCFLAGS
+
 if test "$pac_cv_func_va_copy" = "yes" ; then
     AC_DEFINE(HAVE_VA_COPY,1,[Define if we have va_copy])
-fi
-# We might have __va_copy...
-if test "$pac_cv_func_va_copy" != "yes" ; then 
+else
     AC_CACHE_CHECK([for __va_copy],pac_cv_func___va_copy,[
+    saveCFLAGS=$CFLAGS
+    CFLAGS="$CFLAGS $MPICH2_EXTRA_CFLAGS"
     AC_TRY_LINK([
 #include <stdarg.h>
@@ -5056,6 +5145,7 @@
 }
 ],[foo1("a test %d", 3);],pac_cv_func___va_copy=yes,pac_cv_func___va_copy=no)])
+    CFLAGS=$saveCFLAGS
     if test "$pac_cv_func___va_copy" = "yes" ; then
-    AC_DEFINE(HAVE___VA_COPY,1,[Define if we have __va_copy])
+        AC_DEFINE(HAVE___VA_COPY,1,[Define if we have __va_copy])
     fi
 fi
@@ -5091,5 +5181,8 @@
     if test "$ac_cv_func_strdup" = "yes" ; then
         # Do we need to declare strdup?
+	saveCFLAGS=$CFLAGS
+	CFLAGS="$CFLAGS $MPICH2_EXTRA_CFLAGS"
         PAC_FUNC_NEEDS_DECL([#include <string.h>],strdup)
+	CFLAGS=$saveCFLAGS
     fi
 else
@@ -5122,15 +5215,24 @@
 AC_HAVE_FUNCS(mkstemp)
 if test "$ac_cv_func_mkstemp" = "yes" ; then
+    saveCFLAGS=$CFLAGS
+    CFLAGS="$CFLAGS $MPICH2_EXTRA_CFLAGS"
     PAC_FUNC_NEEDS_DECL([#include <stdlib.h>],mkstemp)
+    CFLAGS=$saveCFLAGS
 fi
 # fdopen() converts from an fd to a FILE*
 AC_HAVE_FUNCS(fdopen)
 if test "$ac_cv_func_fdopen" = "yes" ; then
+    saveCFLAGS=$CFLAGS
+    CFLAGS="$CFLAGS $MPICH2_EXTRA_CFLAGS"
     PAC_FUNC_NEEDS_DECL([#include <stdlib.h>],fdopen)
+    CFLAGS=$saveCFLAGS
 fi
 # putenv() sets environment variable
 AC_HAVE_FUNCS(putenv)
 if test "$ac_cv_func_putenv" = "yes" ; then
+    saveCFLAGS=$CFLAGS
+    CFLAGS="$CFLAGS $MPICH2_EXTRA_CFLAGS"
     PAC_FUNC_NEEDS_DECL([#include <stdlib.h>],putenv)
+    CFLAGS=$saveCFLAGS
 fi
 
@@ -5715,4 +5817,27 @@
 	    AC_DEFINE(HAVE_PTHREAD_MUTEX_RECURSIVE,1,[Define if PTHREAD_MUTEX_RECURSIVE is available in pthread.h])
 	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(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(PTHREAD_MUTEX_ERRORCHECK_VALUE,PTHREAD_MUTEX_ERRORCHECK_NP,
+                      [Define to an expression that will result in an error checking mutex type.])
+        fi
+
 	THR_LIBS="$THR_LIBS -lpthread"
 	MPICH2_THREAD_PACKAGE=pthreads
Index: /mpich2/branches/dev/kumudb/src/include/mpiimpl.h
===================================================================
--- /mpich2/branches/dev/kumudb/src/include/mpiimpl.h (revision 4718)
+++ /mpich2/branches/dev/kumudb/src/include/mpiimpl.h (revision 4870)
@@ -109,5 +109,5 @@
    before including mpidpre.h so that it can be used when a device or
    channel can use it if it's overriding MPIU_Memcpy.  */
-static inline void MPIUI_Memcpy(void * restrict dst, const void * restrict src, size_t len)
+static inline void MPIUI_Memcpy(void * dst, const void * src, size_t len)
 {
     memcpy(dst, src, len);
Index: /mpich2/branches/dev/kumudb/src/mpe2/src/wrappers/src/log_mpi_core.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpe2/src/wrappers/src/log_mpi_core.c (revision 4667)
+++ /mpich2/branches/dev/kumudb/src/mpe2/src/wrappers/src/log_mpi_core.c (revision 4870)
@@ -3555,31 +3555,6 @@
 #define MAKE_PROCNAME_FILE 1
 
-/* Copy of CLOG_Util_getenvbool() */
-static int MPE_Util_getenvbool( char *env_var, int default_value )
-{
-    char *env_val;
-
-    env_val = (char *) getenv( env_var );
-    if ( env_val != NULL ) {
-        if (    strcmp( env_val, "true" ) == 0
-             || strcmp( env_val, "TRUE" ) == 0
-             || strcmp( env_val, "yes" ) == 0
-             || strcmp( env_val, "YES" ) == 0 )
-            return 1;
-        else if (    strcmp( env_val, "false" ) == 0
-                  || strcmp( env_val, "FALSE" ) == 0
-                  || strcmp( env_val, "no" ) == 0
-                  || strcmp( env_val, "NO" ) == 0 )
-            return 0;
-        else {
-            fprintf( stderr, __FILE__":MPE_Util_getenvbool() - \n"
-                             "\t""Environment variable %s has invalid boolean "
-                             "value %s and will be set to %d.\n",
-                             env_var, env_val, default_value );
-            fflush( stderr );
-        }
-    }
-    return default_value;
-}
+/* Copy of CLOG_Util_getenvbool() in log_mpi_util.c */
+int MPE_Util_getenvbool( char *env_var, int default_value );
 
 int  MPI_Finalize( )
Index: /mpich2/branches/dev/kumudb/src/mpe2/src/wrappers/src/Makefile.in
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpe2/src/wrappers/src/Makefile.in (revision 4667)
+++ /mpich2/branches/dev/kumudb/src/mpe2/src/wrappers/src/Makefile.in (revision 4870)
@@ -64,12 +64,13 @@
 MPICC_LDFLAGS    = $(LDFLAGS) $(MPI_CFLAGS) $(MPE_LDOPTS)
 
-MPE_CSOURCES     =
-MPE_COBJECTS     = $(MPE_CSOURCES:.c=.@OBJEXT@)
+MPE_LOG_CSRC     = log_mpi_util.c log_mpi_core.c
+MPE_LOG_OBJS     = $(MPE_LOG_CSRC:.c=.@OBJEXT@)
 
-MPE_WSOURCES     =
-MPE_WOBJECTS     = $(MPE_WSOURCES:.c=.@OBJEXT@)
+MPE_F2C_CSRC     = log_mpi_util.c mpe_proff.c
+MPE_F2C_FSRC     = mpi_f2c_consts.f
+MPE_F2C_OBJS     = $(MPE_F2C_FSRC:.f=.@OBJEXT@) $(MPE_F2C_CSRC:.c=.@OBJEXT@)
 
-MPE_SHLCOBJECTS  = $(MPE_COBJECTS:.@OBJEXT@=.lo)
-MPE_SHLWOBJECTS  = $(MPE_WOBJECTS:.@OBJEXT@=.lo)
+MPE_LOG_SHLOBJS  = $(MPE_LOG_OBJS:.@OBJEXT@=.lo)
+MPE_F2C_SHLOBJS  = $(MPE_F2C_OBJS:.@OBJEXT@=.lo)
 
 .SUFFIXES: .c .f .@OBJEXT@ .lo .a @EXEEXT@
@@ -119,6 +120,6 @@
 # responsible if make works as Sun documents it).  To fix this, we
 # add all the objects to the library, not just the "recent" ones.
-${libbuild_dir}/lib$(LOG_LIBNAME).a: log_mpi_core.@OBJEXT@
-	$(AR) $(ARFLAGS) $@ log_mpi_core.@OBJEXT@
+${libbuild_dir}/lib$(LOG_LIBNAME).a: $(MPE_LOG_OBJS)
+	$(AR) $(ARFLAGS) $@ $(MPE_LOG_OBJS)
 	$(RANLIB) $@
 
@@ -127,6 +128,6 @@
 	$(RANLIB) $@
 
-${libbuild_dir}/lib$(F2CMPI_LIBNAME).a: mpi_f2c_consts.@OBJEXT@ mpe_proff.@OBJEXT@
-	$(AR) $(ARFLAGS) $@ mpi_f2c_consts.@OBJEXT@ mpe_proff.@OBJEXT@
+${libbuild_dir}/lib$(F2CMPI_LIBNAME).a: $(MPE_F2C_OBJS)
+	$(AR) $(ARFLAGS) $@ $(MPE_F2C_OBJS)
 	$(RANLIB) $@
 
Index: /mpich2/branches/dev/kumudb/src/mpe2/src/wrappers/src/log_mpi_util.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpe2/src/wrappers/src/log_mpi_util.c (revision 4870)
+++ /mpich2/branches/dev/kumudb/src/mpe2/src/wrappers/src/log_mpi_util.c (revision 4870)
@@ -0,0 +1,44 @@
+/*
+   (C) 2001 by Argonne National Laboratory.
+       See COPYRIGHT in top-level directory.
+*/
+#include "mpe_wrappers_conf.h"
+
+#if defined( STDC_HEADERS ) || defined( HAVE_STDLIB_H )
+#include <stdlib.h>
+#endif
+#if defined( STDC_HEADERS ) || defined( HAVE_STDIO_H )
+#include <stdio.h>
+#endif
+#if defined( STDC_HEADERS ) || defined( HAVE_STRING_H )
+#include <string.h>
+#endif
+
+/* Copy of CLOG_Util_getenvbool() */
+int MPE_Util_getenvbool( char *env_var, int default_value );
+int MPE_Util_getenvbool( char *env_var, int default_value )
+{ 
+    char *env_val;
+  
+    env_val = (char *) getenv( env_var );
+    if ( env_val != NULL ) {
+        if (    strcmp( env_val, "true" ) == 0
+             || strcmp( env_val, "TRUE" ) == 0
+             || strcmp( env_val, "yes" ) == 0 
+             || strcmp( env_val, "YES" ) == 0 )
+            return 1;
+        else if (    strcmp( env_val, "false" ) == 0
+                  || strcmp( env_val, "FALSE" ) == 0
+                  || strcmp( env_val, "no" ) == 0
+                  || strcmp( env_val, "NO" ) == 0 )
+            return 0;
+        else {
+            fprintf( stderr, __FILE__":MPE_Util_getenvbool() - \n"
+                             "\t""Environment variable %s has invalid boolean "
+                             "value %s and will be set to %d.\n",
+                             env_var, env_val, default_value );
+            fflush( stderr );
+        }
+    }
+    return default_value;
+}
Index: /mpich2/branches/dev/kumudb/src/mpe2/src/wrappers/src/mpi_f2c_consts.f
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpe2/src/wrappers/src/mpi_f2c_consts.f (revision 4667)
+++ /mpich2/branches/dev/kumudb/src/mpe2/src/wrappers/src/mpi_f2c_consts.f (revision 4870)
@@ -1,2 +1,6 @@
+! 
+!  (C) 2001 by Argonne National Laboratory.
+!      See COPYRIGHT in top-level directory.
+!
       subroutine fsub_mpi_fconsts( F_MPI_STATUS_SIZE, itrue, ifalse )
       implicit none
Index: /mpich2/branches/dev/kumudb/src/mpe2/src/wrappers/src/mpe_proff.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpe2/src/wrappers/src/mpe_proff.c (revision 4745)
+++ /mpich2/branches/dev/kumudb/src/mpe2/src/wrappers/src/mpe_proff.c (revision 4870)
@@ -478,31 +478,46 @@
 #endif
 
+/* Copy of CLOG_Util_getenvbool() in log_mpi_util.c */
+int MPE_Util_getenvbool( char *env_var, int default_value );
+
 void mper_fconsts_init( void );
 void mper_fconsts_init( void )
 {
+    int  world_rank;
+    int  use_mpih;
     /*
        Set MPI_STATUS_SIZE, fortran logicals,
            MPI_IN_PLACE, MPI_STATUS(ES)_IGNORE
     */
-/*
+
+    /* Default MPE_USE_FCONSTS_IN_MPIH = false */
+    use_mpih = MPE_Util_getenvbool( "MPE_USE_FCONSTS_IN_MPIH", 0 );
+    /* Let everyone in MPI_COMM_WORLD know what root has */
+    PMPI_Bcast( &use_mpih, 1, MPI_INT, 0, MPI_COMM_WORLD );
 #if defined( MPICH2 )
-    mpirinitf_();
-#endif
-*/
+    if ( use_mpih ) {
+        mpirinitf_();
+    }
+#endif
     fsub_mpi_fconsts_( &MPER_F_MPI_STATUS_SIZE, &MPER_F_TRUE, &MPER_F_FALSE );
 /* Use the determined values and ignore MPI_F_* from mpi.h */
-/*
 #if defined( HAVE_MPI_F_STATUS_IGNORE )
-    MPER_F_MPI_STATUS_IGNORE = MPI_F_STATUS_IGNORE;
+    if ( use_mpih ) {
+        MPER_F_MPI_STATUS_IGNORE = MPI_F_STATUS_IGNORE;
+    }
 #endif
 #if defined( HAVE_MPI_F_STATUSES_IGNORE )
-    MPER_F_MPI_STATUSES_IGNORE = MPI_F_STATUSES_IGNORE;
-#endif
-*/
-    printf( "f2c(MPI_IN_PLACE) = %p\n", MPER_F_MPI_IN_PLACE );
-    printf( "f2c(MPI_STATUS_IGNORE) = %p\n", MPER_F_MPI_STATUS_IGNORE );
-    printf( "f2c(MPI_STATUSES_IGNORE) = %p\n", MPER_F_MPI_STATUSES_IGNORE );
-    printf( "f2c(MPI_STATUS_SIZE) = %d\n", MPER_F_MPI_STATUS_SIZE );
-    printf( ".TRUE. = %d, .FALSE. = %d\n", MPER_F_TRUE, MPER_F_FALSE );
+    if ( use_mpih ) {
+        MPER_F_MPI_STATUSES_IGNORE = MPI_F_STATUSES_IGNORE;
+    }
+#endif
+    PMPI_Comm_rank( MPI_COMM_WORLD, &world_rank );
+    if ( world_rank == 0 ) {
+        printf( "f2c(MPI_IN_PLACE) = %p\n", MPER_F_MPI_IN_PLACE );
+        printf( "f2c(MPI_STATUS_IGNORE) = %p\n", MPER_F_MPI_STATUS_IGNORE );
+        printf( "f2c(MPI_STATUSES_IGNORE) = %p\n", MPER_F_MPI_STATUSES_IGNORE );
+        printf( "f2c(MPI_STATUS_SIZE) = %d\n", MPER_F_MPI_STATUS_SIZE );
+        printf( ".TRUE. = %d, .FALSE. = %d\n", MPER_F_TRUE, MPER_F_FALSE );
+    }
 }
 
Index: /mpich2/branches/dev/kumudb/src/mpe2/src/logging/configure.in
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpe2/src/logging/configure.in (revision 1013)
+++ /mpich2/branches/dev/kumudb/src/mpe2/src/logging/configure.in (revision 4870)
@@ -177,28 +177,28 @@
 
 dnl   -- Check if byteswapping needs to be done.
-if test "$cross_compiling" = "yes" -o "$cross_compiling" = 1 ; then
-    AC_MSG_CHECKING([for byte ordering])
-    if test "X$CROSS_BIGENDIAN" != "X" ; then
-        if test "$CROSS_BIGENDIAN" = "true" \
-             -o "$CROSS_BIGENDIAN" = "false" ; then
-            if test "$CROSS_BIGENDIAN" = "true" ; then
-                AC_DEFINE( WORDS_BIGENDIAN, 1,
-                           [Define if byte order is bigendian] )
-                AC_MSG_RESULT( [defined to be big endian] )
-            else
-                AC_MSG_RESULT( [defined to be little endian] )
-            fi
-        else
-            AC_DEFINE( WORDS_BIGENDIAN, 1,
-                       [Define if byte order is bigendian] )
-            AC_MSG_RESULT( [Unknown CROSS_BIGENDIAN, $CROSS_BIGENDIAN! Assumed big endian] )
-        fi
-    else
-        AC_DEFINE( WORDS_BIGENDIAN, 1, [Define if byte order is bigendian] )
-        AC_MSG_RESULT( [Undefined CROSS_BIGENDIAN! Assumed big endian] )
-    fi
-else
+dnl if test "$cross_compiling" = "yes" -o "$cross_compiling" = 1 ; then
+dnl     AC_MSG_CHECKING([for byte ordering])
+dnl     if test "X$CROSS_BIGENDIAN" != "X" ; then
+dnl         if test "$CROSS_BIGENDIAN" = "true" \
+dnl              -o "$CROSS_BIGENDIAN" = "false" ; then
+dnl             if test "$CROSS_BIGENDIAN" = "true" ; then
+dnl                 AC_DEFINE( WORDS_BIGENDIAN, 1,
+dnl                            [Define if byte order is bigendian] )
+dnl                 AC_MSG_RESULT( [defined to be big endian] )
+dnl             else
+dnl                 AC_MSG_RESULT( [defined to be little endian] )
+dnl             fi
+dnl         else
+dnl             AC_DEFINE( WORDS_BIGENDIAN, 1,
+dnl                        [Define if byte order is bigendian] )
+dnl             AC_MSG_RESULT( [Unknown CROSS_BIGENDIAN, $CROSS_BIGENDIAN! Assumed big endian] )
+dnl         fi
+dnl     else
+dnl         AC_DEFINE( WORDS_BIGENDIAN, 1, [Define if byte order is bigendian] )
+dnl         AC_MSG_RESULT( [Undefined CROSS_BIGENDIAN! Assumed big endian] )
+dnl     fi
+dnl else
     AC_C_BIGENDIAN
-fi
+dnl fi
 
 AC_CHECK_HEADERS(stdio.h stdlib.h string.h unistd.h sys/time.h sys/types.h sys/bitypes.h sys/stat.h fcntl.h)
Index: /mpich2/branches/dev/kumudb/src/mpe2/src/slog2sdk/sbin/install-package.in
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpe2/src/slog2sdk/sbin/install-package.in (revision 3775)
+++ /mpich2/branches/dev/kumudb/src/mpe2/src/slog2sdk/sbin/install-package.in (revision 4870)
@@ -38,7 +38,7 @@
 datadir=@datadir@
 docdir=@docdir@
-# Since autoconf < 2.60 does not set docdir,
-# check if it is set.  If not, set it accordingly.
-if [ "$docdir" != "@docdir@" ] ; then
+# Since autoconf < 2.60 does not set @docdir@ and @htmldir@,
+# If not set, docdir=@docdir@ remains, set them accordingly.
+if [ "$docdir" = "@docdir@" ] ; then
     docdir=${datadir}/doc/${PACKAGE}
 fi
@@ -387,7 +387,7 @@
     datadir=@datadir@
     docdir=@docdir@
-    # Since autoconf < 2.60 does not set docdir,
-    # check if it is set.  If not, set it accordingly.
-    if [ "$docdir" != "@docdir@" ] ; then
+    # Since autoconf < 2.60 does not set @docdir@ and @htmldir@,
+    # If not set, docdir=@docdir@ remains, set them accordingly.
+    if [ "$docdir" = "@docdir@" ] ; then
         docdir=${datadir}/doc/${PACKAGE}
     fi
Index: /mpich2/branches/dev/kumudb/src/mpe2/sbin/mpeinstall.in
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpe2/sbin/mpeinstall.in (revision 3777)
+++ /mpich2/branches/dev/kumudb/src/mpe2/sbin/mpeinstall.in (revision 4870)
@@ -39,10 +39,10 @@
 htmldir=@htmldir@
 mandir=@mandir@
-# Since autoconf < 2.60 does not set docdir and htmldir,
-# check if they are set.  If not, set them accordingly.
-if [ "$docdir" != "@docdir@" ] ; then
+# Since autoconf < 2.60 does not set @docdir@ and @htmldir@,
+# If not set, docdir=@docdir@ remains, set them accordingly.
+if [ "$docdir" = "@docdir@" ] ; then
     docdir=${datadir}/doc/${PACKAGE}
 fi
-if [ "$htmldir" != "@htmldir@" ] ; then
+if [ "$htmldir" = "@htmldir@" ] ; then
     htmldir=${docdir}
 fi
@@ -439,10 +439,10 @@
     htmldir=@htmldir@
     mandir=@mandir@
-    # Since autoconf < 2.60 does not set docdir and htmldir,
-    # check if they are set.  If not, set them accordingly.
-    if [ "$docdir" != "@docdir@" ] ; then
+    # Since autoconf < 2.60 does not set @docdir@ and @htmldir@,
+    # If not set, docdir=@docdir@ remains, set them accordingly.
+    if [ "$docdir" = "@docdir@" ] ; then
         docdir=${datadir}/doc/${PACKAGE}
     fi
-    if [ "$htmldir" != "@htmldir@" ] ; then
+    if [ "$htmldir" = "@htmldir@" ] ; then
         htmldir=${docdir}
     fi
Index: /mpich2/branches/dev/kumudb/src/mpe2/README
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpe2/README (revision 634)
+++ /mpich2/branches/dev/kumudb/src/mpe2/README (revision 4870)
@@ -348,4 +348,9 @@
                           setting it to "no" or "false".
 
+MPE_USE_FCONSTS_IN_MPIH : The boolean value determines if MPI_F_* constants
+                          from mpi.h will be used.  By default, MPE computes
+                          the MPI_F_* constants instead of reading from mpi.h.
+                          The affected constants are MPI_F_STATUS(ES)_IGNORE.
+
 Possible boolean values are "true", "false", "yes" and "no" in either
 all lower or upper cases.
Index: /mpich2/branches/dev/kumudb/src/mpe2/mpewrap.vcproj
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpe2/mpewrap.vcproj (revision 3902)
+++ /mpich2/branches/dev/kumudb/src/mpe2/mpewrap.vcproj (revision 4870)
@@ -1044,5 +1044,5 @@
 			</File>
 			<File
-				RelativePath=".\src\wrappers\src\mpe_proff.c"
+				RelativePath=".\src\wrappers\src\log_mpi_util.c"
 				>
 			</File>
Index: /mpich2/branches/dev/kumudb/src/mpi/romio/mpi-io/Makefile.in
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpi/romio/mpi-io/Makefile.in (revision 4010)
+++ /mpich2/branches/dev/kumudb/src/mpi/romio/mpi-io/Makefile.in (revision 4870)
@@ -7,10 +7,16 @@
 SHLIBNAME   = @SHLIBNAME@
 
-INCLUDE_DIR = -I@MPI_INCLUDE_DIR@ -I${srcdir} -I../include -I${srcdir}/../adio/include -I../adio/include -I${srcdir}/../../../include  -I../../../include 
-CFLAGS      = @CPPFLAGS@ @CFLAGS@ $(MPIOPROFILE) $(INCLUDE_DIR)
-
-top_builddir  = @master_topbuild_dir@
-LIBTOOL       = @LIBTOOL@
-C_COMPILE_SHL = $(CC_SHL) 
+#DEFS            = @DEFS@ -I. -I${srcdir}
+CPPFLAGS        = @CPPFLAGS@
+INCLUDES = -I@MPI_INCLUDE_DIR@ -I${srcdir} -I../include \
+	   -I${srcdir}/../adio/include -I../adio/include \
+	   -I${srcdir}/../../../include  -I../../../include 
+#CFLAGS      = $(CPPFLAGS) @CFLAGS@ $(MPIOPROFILE) $(INCLUDES)
+CFLAGS          = @CFLAGS@ $(MPIOPROFILE)
+top_builddir    = @master_topbuild_dir@
+LIBTOOL         = @LIBTOOL@
+C_COMPILE       = $(CC) $(DEFS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS)
+C_COMPILE_SHL   = $(CC_SHL) $(DEFS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS)
+#C_COMPILE_SHL = $(CC_SHL) 
 
 @VPATH@
@@ -109,12 +115,32 @@
 .SUFFIXES: $(SUFFIXES) .p .sp .lo .man .html .latex .txt 
 
+#	$(CC) $(CFLAGS) -c $<
 .c.o:
-	$(CC) $(CFLAGS) -c $<
+	@if [ "x$(VERBOSE)" != "x1" ] ; then \
+	  echo "  CC              $<" ; \
+	else \
+	  echo $(C_COMPILE) -c $< ; \
+	fi
+	@$(C_COMPILE) -c $<
+#	$(C_COMPILE_SHL) $(CFLAGS) -c $< -o _s$*.o
+#	@mv -f _s$*.o $*.lo
 .c.lo:
-	$(C_COMPILE_SHL) $(CFLAGS) -c $< -o _s$*.o
+	@if [ "x$(VERBOSE)" != "x1" ] ; then \
+	  echo "  CC              $<" ; \
+	else \
+	  echo $(C_COMPILE_SHL) -c $< -o _s$*.o ; \
+	  echo mv -f _s$*.o $*.lo ; \
+	fi
+	@$(C_COMPILE_SHL) -c $< -o _s$*.o
 	@mv -f _s$*.o $*.lo
 
+#	$(CC) $(CFLAGS) -c $< -o _$*.o
 .c.p:
-	$(CC) $(CFLAGS) -c $< -o _$*.o
+	@if [ "x$(VERBOSE)" != "x1" ] ; then \
+	  echo "  CC              $<" ; \
+	else \
+	  echo $(C_COMPILE) -c $< -o _$*.o ; \
+	fi
+	@$(C_COMPILE) -c $< -o _$*.o
 
 #	@cp $(srcdir)/$*.c _$*.c
@@ -122,6 +148,14 @@
 # Send the output to a .o file because some compilers require all object
 # files to have an extension of .o
+#	$(C_COMPILE_SHL) $(CFLAGS) -c $< -o _sp$*.o
+#	@mv -f _sp$*.o _$*.lo
 .c.sp:
-	$(C_COMPILE_SHL) $(CFLAGS) -c $< -o _sp$*.o
+	@if [ "x$(VERBOSE)" != "x1" ] ; then \
+	  echo "  CC              $<" ; \
+	else \
+	  echo $(C_COMPILE_SHL) -c $< -o _sp$*.o ; \
+	  echo mv -f _sp$*.o _$*.lo ; \
+	fi
+	@$(C_COMPILE_SHL) -c $< -o _sp$*.o
 	@mv -f _sp$*.o _$*.lo
 
@@ -186,109 +220,109 @@
 # Rules for the profiling objects
 _close.o: close.c
-	$(CC) $(CFLAGS) -c $(srcdir)/close.c -o _close.o
+	$(C_COMPILE) -c $(srcdir)/close.c -o _close.o
 _read.o: read.c
-	$(CC) $(CFLAGS) -c $(srcdir)/read.c -o _read.o
+	$(C_COMPILE) -c $(srcdir)/read.c -o _read.o
 _open.o: open.c
-	$(CC) $(CFLAGS) -c $(srcdir)/open.c -o _open.o
+	$(C_COMPILE) -c $(srcdir)/open.c -o _open.o
 _get_extent.o: get_extent.c
-	$(CC) $(CFLAGS) -c $(srcdir)/get_extent.c -o _get_extent.o
+	$(C_COMPILE) -c $(srcdir)/get_extent.c -o _get_extent.o
 _write.o: write.c
-	$(CC) $(CFLAGS) -c $(srcdir)/write.c -o _write.o
+	$(C_COMPILE) -c $(srcdir)/write.c -o _write.o
 _set_view.o: set_view.c
-	$(CC) $(CFLAGS) -c $(srcdir)/set_view.c -o _set_view.o
+	$(C_COMPILE) -c $(srcdir)/set_view.c -o _set_view.o
 _seek.o: seek.c
-	$(CC) $(CFLAGS) -c $(srcdir)/seek.c -o _seek.o
+	$(C_COMPILE) -c $(srcdir)/seek.c -o _seek.o
 _read_at.o: read_at.c
-	$(CC) $(CFLAGS) -c $(srcdir)/read_at.c -o _read_at.o
+	$(C_COMPILE) -c $(srcdir)/read_at.c -o _read_at.o
 _prealloc.o: prealloc.c
-	$(CC) $(CFLAGS) -c $(srcdir)/prealloc.c -o _prealloc.o
+	$(C_COMPILE) -c $(srcdir)/prealloc.c -o _prealloc.o
 _iread.o: iread.c
-	$(CC) $(CFLAGS) -c $(srcdir)/iread.c -o _iread.o
+	$(C_COMPILE) -c $(srcdir)/iread.c -o _iread.o
 _iwrite.o: iwrite.c
-	$(CC) $(CFLAGS) -c $(srcdir)/iwrite.c -o _iwrite.o
+	$(C_COMPILE) -c $(srcdir)/iwrite.c -o _iwrite.o
 _get_posn.o: get_posn.c
-	$(CC) $(CFLAGS) -c $(srcdir)/get_posn.c -o _get_posn.o
+	$(C_COMPILE) -c $(srcdir)/get_posn.c -o _get_posn.o
 _delete.o: delete.c
-	$(CC) $(CFLAGS) -c $(srcdir)/delete.c -o _delete.o
+	$(C_COMPILE) -c $(srcdir)/delete.c -o _delete.o
 _read_all.o: read_all.c
-	$(CC) $(CFLAGS) -c $(srcdir)/read_all.c -o _read_all.o
+	$(C_COMPILE) -c $(srcdir)/read_all.c -o _read_all.o
 _get_bytoff.o: get_bytoff.c
-	$(CC) $(CFLAGS) -c $(srcdir)/get_bytoff.c -o _get_bytoff.o
+	$(C_COMPILE) -c $(srcdir)/get_bytoff.c -o _get_bytoff.o
 _read_atall.o: read_atall.c
-	$(CC) $(CFLAGS) -c $(srcdir)/read_atall.c -o _read_atall.o
+	$(C_COMPILE) -c $(srcdir)/read_atall.c -o _read_atall.o
 _iread_at.o: iread_at.c
-	$(CC) $(CFLAGS) -c $(srcdir)/iread_at.c -o _iread_at.o
+	$(C_COMPILE) -c $(srcdir)/iread_at.c -o _iread_at.o
 _iwrite_at.o: iwrite_at.c
-	$(CC) $(CFLAGS) -c $(srcdir)/iwrite_at.c -o _iwrite_at.o
+	$(C_COMPILE) -c $(srcdir)/iwrite_at.c -o _iwrite_at.o
 _get_group.o: get_group.c
-	$(CC) $(CFLAGS) -c $(srcdir)/get_group.c -o _get_group.o
+	$(C_COMPILE) -c $(srcdir)/get_group.c -o _get_group.o
 _get_amode.o: get_amode.c
-	$(CC) $(CFLAGS) -c $(srcdir)/get_amode.c -o _get_amode.o
+	$(C_COMPILE) -c $(srcdir)/get_amode.c -o _get_amode.o
 _write_all.o: write_all.c
-	$(CC) $(CFLAGS) -c $(srcdir)/write_all.c -o _write_all.o
+	$(C_COMPILE) -c $(srcdir)/write_all.c -o _write_all.o
 _write_at.o: write_at.c
-	$(CC) $(CFLAGS) -c $(srcdir)/write_at.c -o _write_at.o
+	$(C_COMPILE) -c $(srcdir)/write_at.c -o _write_at.o
 _write_atall.o: write_atall.c
-	$(CC) $(CFLAGS) -c $(srcdir)/write_atall.c -o _write_atall.o
+	$(C_COMPILE) -c $(srcdir)/write_atall.c -o _write_atall.o
 _get_view.o: get_view.c
-	$(CC) $(CFLAGS) -c $(srcdir)/get_view.c -o _get_view.o
+	$(C_COMPILE) -c $(srcdir)/get_view.c -o _get_view.o
 _fsync.o: fsync.c
-	$(CC) $(CFLAGS) -c $(srcdir)/fsync.c -o _fsync.o
+	$(C_COMPILE) -c $(srcdir)/fsync.c -o _fsync.o
 _get_atom.o: get_atom.c
-	$(CC) $(CFLAGS) -c $(srcdir)/get_atom.c -o _get_atom.o
+	$(C_COMPILE) -c $(srcdir)/get_atom.c -o _get_atom.o
 _set_atom.o: set_atom.c
-	$(CC) $(CFLAGS) -c $(srcdir)/set_atom.c -o _set_atom.o
+	$(C_COMPILE) -c $(srcdir)/set_atom.c -o _set_atom.o
 _set_size.o: set_size.c
-	$(CC) $(CFLAGS) -c $(srcdir)/set_size.c -o _set_size.o
+	$(C_COMPILE) -c $(srcdir)/set_size.c -o _set_size.o
 _get_size.o: get_size.c
-	$(CC) $(CFLAGS) -c $(srcdir)/get_size.c -o _get_size.o
+	$(C_COMPILE) -c $(srcdir)/get_size.c -o _get_size.o
 _file_f2c.o: file_f2c.c
-	$(CC) $(CFLAGS) -c $(srcdir)/file_f2c.c -o _file_f2c.o
+	$(C_COMPILE) -c $(srcdir)/file_f2c.c -o _file_f2c.o
 _file_c2f.o: file_c2f.c
-	$(CC) $(CFLAGS) -c $(srcdir)/file_c2f.c -o _file_c2f.o
+	$(C_COMPILE) -c $(srcdir)/file_c2f.c -o _file_c2f.o
 _set_info.o: set_info.c
-	$(CC) $(CFLAGS) -c $(srcdir)/set_info.c -o _set_info.o
+	$(C_COMPILE) -c $(srcdir)/set_info.c -o _set_info.o
 _get_info.o: get_info.c
-	$(CC) $(CFLAGS) -c $(srcdir)/get_info.c -o _get_info.o
+	$(C_COMPILE) -c $(srcdir)/get_info.c -o _get_info.o
 _rd_atallb.o: rd_atallb.c
-	$(CC) $(CFLAGS) -c $(srcdir)/rd_atallb.c -o _rd_atallb.o
+	$(C_COMPILE) -c $(srcdir)/rd_atallb.c -o _rd_atallb.o
 _rd_atalle.o: rd_atalle.c
-	$(CC) $(CFLAGS) -c $(srcdir)/rd_atalle.c -o _rd_atalle.o
+	$(C_COMPILE) -c $(srcdir)/rd_atalle.c -o _rd_atalle.o
 _read_allb.o: read_allb.c
-	$(CC) $(CFLAGS) -c $(srcdir)/read_allb.c -o _read_allb.o
+	$(C_COMPILE) -c $(srcdir)/read_allb.c -o _read_allb.o
 _read_alle.o: read_alle.c
-	$(CC) $(CFLAGS) -c $(srcdir)/read_alle.c -o _read_alle.o
+	$(C_COMPILE) -c $(srcdir)/read_alle.c -o _read_alle.o
 _wr_atallb.o: wr_atallb.c
-	$(CC) $(CFLAGS) -c $(srcdir)/wr_atallb.c -o _wr_atallb.o
+	$(C_COMPILE) -c $(srcdir)/wr_atallb.c -o _wr_atallb.o
 _wr_atalle.o: wr_atalle.c
-	$(CC) $(CFLAGS) -c $(srcdir)/wr_atalle.c -o _wr_atalle.o
+	$(C_COMPILE) -c $(srcdir)/wr_atalle.c -o _wr_atalle.o
 _write_allb.o: write_allb.c
-	$(CC) $(CFLAGS) -c $(srcdir)/write_allb.c -o _write_allb.o
+	$(C_COMPILE) -c $(srcdir)/write_allb.c -o _write_allb.o
 _write_alle.o: write_alle.c
-	$(CC) $(CFLAGS) -c $(srcdir)/write_alle.c -o _write_alle.o
+	$(C_COMPILE) -c $(srcdir)/write_alle.c -o _write_alle.o
 _get_posn_sh.o: get_posn_sh.c
-	$(CC) $(CFLAGS) -c $(srcdir)/get_posn_sh.c -o _get_posn_sh.o
+	$(C_COMPILE) -c $(srcdir)/get_posn_sh.c -o _get_posn_sh.o
 _iread_sh.o: iread_sh.c
-	$(CC) $(CFLAGS) -c $(srcdir)/iread_sh.c -o _iread_sh.o
+	$(C_COMPILE) -c $(srcdir)/iread_sh.c -o _iread_sh.o
 _read_sh.o: read_sh.c
-	$(CC) $(CFLAGS) -c $(srcdir)/read_sh.c -o _read_sh.o
+	$(C_COMPILE) -c $(srcdir)/read_sh.c -o _read_sh.o
 _write_sh.o: write_sh.c
-	$(CC) $(CFLAGS) -c $(srcdir)/write_sh.c -o _write_sh.o
+	$(C_COMPILE) -c $(srcdir)/write_sh.c -o _write_sh.o
 _iwrite_sh.o: iwrite_sh.c
-	$(CC) $(CFLAGS) -c $(srcdir)/iwrite_sh.c -o _iwrite_sh.o
+	$(C_COMPILE) -c $(srcdir)/iwrite_sh.c -o _iwrite_sh.o
 _seek_sh.o: seek_sh.c
-	$(CC) $(CFLAGS) -c $(srcdir)/seek_sh.c -o _seek_sh.o
+	$(C_COMPILE) -c $(srcdir)/seek_sh.c -o _seek_sh.o
 _read_ord.o: read_ord.c
-	$(CC) $(CFLAGS) -c $(srcdir)/read_ord.c -o _read_ord.o
+	$(C_COMPILE) -c $(srcdir)/read_ord.c -o _read_ord.o
 _read_orde.o: read_orde.c
-	$(CC) $(CFLAGS) -c $(srcdir)/read_orde.c -o _read_orde.o
+	$(C_COMPILE) -c $(srcdir)/read_orde.c -o _read_orde.o
 _write_ordb.o: write_ordb.c
-	$(CC) $(CFLAGS) -c $(srcdir)/write_ordb.c -o _write_ordb.o
+	$(C_COMPILE) -c $(srcdir)/write_ordb.c -o _write_ordb.o
 _read_ordb.o: read_ordb.c
-	$(CC) $(CFLAGS) -c $(srcdir)/read_ordb.c -o _read_ordb.o
+	$(C_COMPILE) -c $(srcdir)/read_ordb.c -o _read_ordb.o
 _write_ord.o: write_ord.c
-	$(CC) $(CFLAGS) -c $(srcdir)/write_ord.c -o _write_ord.o
+	$(C_COMPILE) -c $(srcdir)/write_ord.c -o _write_ord.o
 _write_orde.o: write_orde.c
-	$(CC) $(CFLAGS) -c $(srcdir)/write_orde.c -o _write_orde.o
+	$(C_COMPILE) -c $(srcdir)/write_orde.c -o _write_orde.o
 _register_datarep.o: register_datarep.c
-	$(CC) $(CFLAGS) -c $(srcdir)/register_datarep.c -o _register_datarep.o
+	$(C_COMPILE) -c $(srcdir)/register_datarep.c -o _register_datarep.o
Index: /mpich2/branches/dev/kumudb/src/mpi/romio/mpi-io/mpioimpl.h
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpi/romio/mpi-io/mpioimpl.h (revision 4674)
+++ /mpich2/branches/dev/kumudb/src/mpi/romio/mpi-io/mpioimpl.h (revision 4870)
@@ -53,6 +53,6 @@
    four functions.  Defining these as empty should not change the behavior 
    of correct programs */
-#define MPIU_THREAD_CS_ENTER(ALLFUNC,)
-#define MPIU_THREAD_CS_EXIT(ALLFUNC,)
+#define MPIU_THREAD_CS_ENTER(x,y)
+#define MPIU_THREAD_CS_EXIT(x,y)
 #define MPIR_Nest_incr()
 #define MPIR_Nest_decr()
Index: /mpich2/branches/dev/kumudb/src/mpi/romio/mpi-io/glue/mpich2/Makefile.in
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpi/romio/mpi-io/glue/mpich2/Makefile.in (revision 100)
+++ /mpich2/branches/dev/kumudb/src/mpi/romio/mpi-io/glue/mpich2/Makefile.in (revision 4870)
@@ -7,10 +7,15 @@
 SHLIBNAME   = @SHLIBNAME@
 
-INCLUDE_DIR = -I@MPI_INCLUDE_DIR@ -I../../../include -I${srcdir}/../../../mpi-io -I${srcdir}/../../../adio/include -I../../../adio/include -I${srcdir}/../../../../../../src/include  -I../../../../../../src/include 
-CFLAGS      = -DHAVE_MPI_INFO_SRC @CPPFLAGS@ @CFLAGS@ $(MPIOPROFILE) $(INCLUDE_DIR)
+#DEFS            = @DEFS@ -I. -I${srcdir}
+CPPFLAGS        = @CPPFLAGS@
+INCLUDES = -I@MPI_INCLUDE_DIR@ -I../../../include -I${srcdir}/../../../mpi-io -I${srcdir}/../../../adio/include -I../../../adio/include -I${srcdir}/../../../../../../src/include  -I../../../../../../src/include 
+#CFLAGS      = -DHAVE_MPI_INFO_SRC @CPPFLAGS@ @CFLAGS@ $(MPIOPROFILE) $(INCLUDES)
+CFLAGS          = -DHAVE_MPI_INFO_SRC @CFLAGS@ $(MPIOPROFILE)
 
 top_builddir  = @master_topbuild_dir@
 LIBTOOL       = @LIBTOOL@
-C_COMPILE_SHL = $(CC_SHL)
+C_COMPILE       = $(CC) $(DEFS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS)
+C_COMPILE_SHL   = $(CC_SHL) $(DEFS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS)
+#C_COMPILE_SHL = $(CC_SHL) 
 
 @VPATH@
@@ -25,17 +30,39 @@
 .SUFFIXES: $(SUFFIXES) .p .lo
 
+#	$(CC) $(CFLAGS) -c $<
 .c.o:
-	$(CC) $(CFLAGS) -c $<
+	@if [ "x$(VERBOSE)" != "x1" ] ; then \
+	  echo "  CC              $<" ; \
+	else \
+	  echo $(C_COMPILE) -c $< ; \
+	fi
+	@$(C_COMPILE) -c $<
+#	$(C_COMPILE_SHL) $(CFLAGS) -c $< -o _s$*.o
+#	@mv -f _s$*.o $*.lo
 .c.lo:
-	$(C_COMPILE_SHL) $(CFLAGS) -c $< -o _s$*.o
+	@if [ "x$(VERBOSE)" != "x1" ] ; then \
+	  echo "  CC              $<" ; \
+	else \
+	  echo $(C_COMPILE_SHL) -c $< -o _s$*.o ; \
+	  echo mv -f _s$*.o $*.lo ; \
+	fi
+	@$(C_COMPILE_SHL) -c $< -o _s$*.o
 	@mv -f _s$*.o $*.lo
 
+#	$(CC) $(CFLAGS) -c $< -o _$*.o
 .c.p:
-	@cp $(srcdir)/$*.c _$*.c
-	$(CC) $(CFLAGS) -c _$*.c
-	@rm -f _$*.c
+	@if [ "x$(VERBOSE)" != "x1" ] ; then \
+	  echo "  CC              $<" ; \
+	else \
+	  echo $(C_COMPILE) -c $< -o _$*.o ; \
+	fi
+	@$(C_COMPILE) -c $< -o _$*.o
 
 profile: 
 	sleep 1
+
+coverage:
+	-@for file in  ${MPIO_OBJECTS:.o=.c} ; do \
+		gcov -b -f $$file ; done
 
 $(LIBNAME): $(MPIO_OBJECTS)
Index: /mpich2/branches/dev/kumudb/src/mpi/romio/mpi-io/fortran/Makefile.in
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpi/romio/mpi-io/fortran/Makefile.in (revision 100)
+++ /mpich2/branches/dev/kumudb/src/mpi/romio/mpi-io/fortran/Makefile.in (revision 4870)
@@ -7,10 +7,11 @@
 SHLIBNAME   = @SHLIBNAME@
 
-INCLUDE_DIR = -I@MPI_INCLUDE_DIR@ -I../../include -I${srcdir}/../../adio/include -I../../adio/include -I${srcdir}/..
-CFLAGS      = -DMPIO_FORTRAN_SRC @CFLAGS@ $(MPIOPROFILE) $(INCLUDE_DIR)
+INCLUDES    = -I@MPI_INCLUDE_DIR@ -I../../include -I${srcdir}/../../adio/include -I../../adio/include -I${srcdir}/..
+CFLAGS      = -DMPIO_FORTRAN_SRC @CFLAGS@ $(MPIOPROFILE) 
 
 top_builddir  = @master_topbuild_dir@
 LIBTOOL       = @LIBTOOL@
-C_COMPILE_SHL = $(CC_SHL)
+C_COMPILE       = $(CC) $(DEFS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS)
+C_COMPILE_SHL   = $(CC_SHL) $(DEFS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS)
 
 @VPATH@
@@ -66,8 +67,19 @@
 
 .c.o:
-	$(CC) $(CFLAGS) -c $<
+	@if [ "x$(VERBOSE)" != "x1" ] ; then \
+	  echo "  CC              $<" ; \
+	else \
+	  echo $(C_COMPILE) -c $< ; \
+	fi
+	@$(C_COMPILE) -c $<
 
 .c.lo:
-	$(C_COMPILE_SHL) $(CFLAGS) -c $< -o _s$*.o
+	@if [ "x$(VERBOSE)" != "x1" ] ; then \
+	  echo "  CC              $<" ; \
+	else \
+	  echo $(C_COMPILE_SHL) -c $< -o _s$*.o ; \
+	  echo mv -f _s$*.o $*.lo ; \
+	fi
+	@$(C_COMPILE_SHL) -c $< -o _s$*.o
 	@mv -f _s$*.o $*.lo
 
Index: /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_lustre/Makefile.in
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_lustre/Makefile.in (revision 4055)
+++ /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_lustre/Makefile.in (revision 4870)
@@ -7,10 +7,10 @@
 SHLIBNAME   = @SHLIBNAME@
 
-INCLUDE_DIR = -I@MPI_INCLUDE_DIR@ -I${srcdir}/../include -I../include -I../../include -I${srcdir}/../../../../include -I../../../../include
-CFLAGS      = @CPPFLAGS@ @CFLAGS@ $(INCLUDE_DIR)
+INCLUDES    = -I@MPI_INCLUDE_DIR@ -I${srcdir}/../include -I../include -I../../include -I${srcdir}/../../../../include -I../../../../include
+CFLAGS      = @CPPFLAGS@ @CFLAGS@ $(INCLUDES)
 
 top_builddir  = @master_topbuild_dir@
 LIBTOOL       = @LIBTOOL@
-C_COMPILE_SHL = $(CC_SHL) @CFLAGS@ $(INCLUDE_DIR)
+C_COMPILE_SHL = $(CC_SHL) @CFLAGS@ $(INCLUDES)
 
 @VPATH@
Index: /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_pvfs/Makefile.in
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_pvfs/Makefile.in (revision 100)
+++ /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_pvfs/Makefile.in (revision 4870)
@@ -7,10 +7,15 @@
 SHLIBNAME   = @SHLIBNAME@
 
-INCLUDE_DIR = -I@MPI_INCLUDE_DIR@ -I${srcdir}/../include -I../include -I../../include  -I${srcdir}/../../../../include -I../../../../include
-CFLAGS      = @CPPFLAGS@ @CFLAGS@ $(INCLUDE_DIR)
+#DEFS            = @DEFS@ -I. -I${srcdir}
+CPPFLAGS        = @CPPFLAGS@
+INCLUDES    = -I@MPI_INCLUDE_DIR@ -I${srcdir}/../include -I../include -I../../include  -I${srcdir}/../../../../include -I../../../../include
+#CFLAGS      = @CPPFLAGS@ @CFLAGS@ $(INCLUDES) 
+CFLAGS          = @CFLAGS@
 
 top_builddir  = @master_topbuild_dir@
 LIBTOOL       = @LIBTOOL@
-C_COMPILE_SHL = $(CC_SHL) 
+C_COMPILE       = $(CC) $(DEFS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS)
+C_COMPILE_SHL   = $(CC_SHL) $(DEFS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS)
+#C_COMPILE_SHL = $(CC_SHL) 
 
 @VPATH@
@@ -29,8 +34,22 @@
 .SUFFIXES: $(SUFFIXES) .p .lo
 
+#	$(CC) $(CFLAGS) -c $<
 .c.o:
-	$(CC) $(CFLAGS) -c $<
+	@if [ "x$(VERBOSE)" != "x1" ] ; then \
+	  echo "  CC              $<" ; \
+	else \
+	  echo $(C_COMPILE) -c $< ; \
+	fi
+	@$(C_COMPILE) -c $<
+#	$(C_COMPILE_SHL) $(CFLAGS) -c $< -o _s$*.o
+#	@mv -f _s$*.o $*.lo
 .c.lo:
-	$(C_COMPILE_SHL) $(CFLAGS) -c $< -o _s$*.o
+	@if [ "x$(VERBOSE)" != "x1" ] ; then \
+	  echo "  CC              $<" ; \
+	else \
+	  echo $(C_COMPILE_SHL) -c $< -o _s$*.o ; \
+	  echo mv -f _s$*.o $*.lo ; \
+	fi
+	@$(C_COMPILE_SHL) -c $< -o _s$*.o
 	@mv -f _s$*.o $*.lo
 
Index: /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_hfs/Makefile.in
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_hfs/Makefile.in (revision 100)
+++ /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_hfs/Makefile.in (revision 4870)
@@ -4,6 +4,6 @@
 srcdir      = @srcdir@
 
-INCLUDE_DIR = -I@MPI_INCLUDE_DIR@ -I${srcdir}/../include -I../include -I../../include -I${srcdir}/../../../../include -I../../../../include
-CFLAGS      = @CPPFLAGS@ @CFLAGS@ $(INCLUDE_DIR)
+INCLUDES    = -I@MPI_INCLUDE_DIR@ -I${srcdir}/../include -I../include -I../../include -I${srcdir}/../../../../include -I../../../../include
+CFLAGS      = @CPPFLAGS@ @CFLAGS@ $(INCLUDES)
 
 @VPATH@
Index: /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_piofs/Makefile.in
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_piofs/Makefile.in (revision 100)
+++ /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_piofs/Makefile.in (revision 4870)
@@ -4,6 +4,6 @@
 srcdir      = @srcdir@
 
-INCLUDE_DIR = -I@MPI_INCLUDE_DIR@ -I${srcdir}/../include -I../include -I../../include  -I${srcdir}/../../../../include -I../../../../include
-CFLAGS      = @CPPFLAGS@ @CFLAGS@ $(INCLUDE_DIR)
+INCLUDES    = -I@MPI_INCLUDE_DIR@ -I${srcdir}/../include -I../include -I../../include  -I${srcdir}/../../../../include -I../../../../include
+CFLAGS      = @CPPFLAGS@ @CFLAGS@ $(INCLUDES)
 
 @VPATH@
Index: /mpich2/branches/dev/kumudb/src/mpi/romio/adio/common/Makefile.in
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpi/romio/adio/common/Makefile.in (revision 2944)
+++ /mpich2/branches/dev/kumudb/src/mpi/romio/adio/common/Makefile.in (revision 4870)
@@ -8,12 +8,16 @@
 SHLIBNAME   = @SHLIBNAME@
 
-INCLUDE_DIR = -I@MPI_INCLUDE_DIR@ -I${srcdir}/../include -I../include \
+#DEFS            = @DEFS@ -I. -I${srcdir}
+CPPFLAGS        = @CPPFLAGS@
+INCLUDES = -I@MPI_INCLUDE_DIR@ -I${srcdir}/../include -I../include \
 	-I../../include -I${srcdir}/../../../../../src/include \
 	-I../../../../../src/include
-CFLAGS      = @CPPFLAGS@ @CFLAGS@ $(INCLUDE_DIR) 
-
-top_builddir  = @master_topbuild_dir@
-LIBTOOL       = @LIBTOOL@
-C_COMPILE_SHL = $(CC_SHL) 
+#CFLAGS      = @CPPFLAGS@ @CFLAGS@ $(INCLUDES) 
+CFLAGS          = @CFLAGS@
+top_builddir    = @master_topbuild_dir@
+LIBTOOL         = @LIBTOOL@
+C_COMPILE       = $(CC) $(DEFS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS)
+C_COMPILE_SHL   = $(CC_SHL) $(DEFS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS)
+#C_COMPILE_SHL = $(CC_SHL) 
 
 @VPATH@
@@ -42,8 +46,22 @@
 .SUFFIXES: $(SUFFIXES) .p .lo
 
+#	$(CC) $(CFLAGS) $(INC) -c $<
 .c.o:
-	$(CC) $(CFLAGS) $(INC) -c $<
+	@if [ "x$(VERBOSE)" != "x1" ] ; then \
+	  echo "  CC              $<" ; \
+	else \
+	  echo $(C_COMPILE) -c $< ; \
+	fi
+	@$(C_COMPILE) -c $<
+#	$(C_COMPILE_SHL) $(CFLAGS) -c $< -o _s$*.o
+#	@mv -f _s$*.o $*.lo
 .c.lo:
-	$(C_COMPILE_SHL) $(CFLAGS) -c $< -o _s$*.o
+	@if [ "x$(VERBOSE)" != "x1" ] ; then \
+	  echo "  CC              $<" ; \
+	else \
+	  echo $(C_COMPILE_SHL) -c $< -o _s$*.o ; \
+	  echo mv -f _s$*.o $*.lo ; \
+	fi
+	@$(C_COMPILE_SHL) -c $< -o _s$*.o
 	@mv -f _s$*.o $*.lo
 
@@ -57,4 +75,8 @@
 	$(AR) $(SHLIBNAME).la $(AD_LOOBJECTS)
 
+coverage:
+	-@for file in  ${AD_OBJECTS:.o=.c} ; do \
+		gcov -b -f $$file ; done
+
 clean:
 	@rm -f *.o *.lo *.gcno *.gcda *.bb *.bbg
Index: /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_nfs/Makefile.in
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_nfs/Makefile.in (revision 3078)
+++ /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_nfs/Makefile.in (revision 4870)
@@ -7,10 +7,15 @@
 SHLIBNAME   = @SHLIBNAME@
 
-INCLUDE_DIR = -I@MPI_INCLUDE_DIR@ -I${srcdir}/../include -I../include -I../../include -I${srcdir}/../../../../include -I../../../../include
-CFLAGS      = @CPPFLAGS@ @CFLAGS@ $(INCLUDE_DIR)
+#DEFS            = @DEFS@ -I. -I${srcdir}
+CPPFLAGS        = @CPPFLAGS@
+INCLUDES    = -I@MPI_INCLUDE_DIR@ -I${srcdir}/../include -I../include -I../../include -I${srcdir}/../../../../include -I../../../../include
+#CFLAGS      = @CPPFLAGS@ @CFLAGS@ $(INCLUDES)
+CFLAGS          = @CFLAGS@
 
 top_builddir  = @master_topbuild_dir@
 LIBTOOL       = @LIBTOOL@
-C_COMPILE_SHL = $(CC_SHL) 
+C_COMPILE       = $(CC) $(DEFS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS)
+C_COMPILE_SHL   = $(CC_SHL) $(DEFS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS)
+#C_COMPILE_SHL = $(CC_SHL) 
 
 @VPATH@
@@ -28,8 +33,22 @@
 .SUFFIXES: $(SUFFIXES) .p .lo
 
+#	$(CC) $(CFLAGS) -c $<
 .c.o:
-	$(CC) $(CFLAGS) -c $<
+	@if [ "x$(VERBOSE)" != "x1" ] ; then \
+	  echo "  CC              $<" ; \
+	else \
+	  echo $(C_COMPILE) -c $< ; \
+	fi
+	@$(C_COMPILE) -c $<
+#	$(C_COMPILE_SHL) $(CFLAGS) -c $< -o _s$*.o
+#	@mv -f _s$*.o $*.lo
 .c.lo:
-	$(C_COMPILE_SHL) $(CFLAGS) -c $< -o _s$*.o
+	@if [ "x$(VERBOSE)" != "x1" ] ; then \
+	  echo "  CC              $<" ; \
+	else \
+	  echo $(C_COMPILE_SHL) -c $< -o _s$*.o ; \
+	  echo mv -f _s$*.o $*.lo ; \
+	fi
+	@$(C_COMPILE_SHL) -c $< -o _s$*.o
 	@mv -f _s$*.o $*.lo
 
Index: /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_bglockless/Makefile.in
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_bglockless/Makefile.in (revision 2953)
+++ /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_bglockless/Makefile.in (revision 4870)
@@ -7,6 +7,6 @@
 SHLIBNAME   = @SHLIBNAME@
 
-INCLUDE_DIR = -I@MPI_INCLUDE_DIR@ -I${srcdir}/../include -I../include -I../../include  -I${srcdir}/../../../../include -I../../../../include
-CFLAGS      = @CPPFLAGS@ @CFLAGS@ $(INCLUDE_DIR)
+INCLUDES    = -I@MPI_INCLUDE_DIR@ -I${srcdir}/../include -I../include -I../../include  -I${srcdir}/../../../../include -I../../../../include
+CFLAGS      = @CPPFLAGS@ @CFLAGS@ $(INCLUDES)
 
 top_builddir  = @master_topbuild_dir@
Index: /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_pfs/Makefile.in
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_pfs/Makefile.in (revision 100)
+++ /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_pfs/Makefile.in (revision 4870)
@@ -4,6 +4,6 @@
 srcdir      = @srcdir@
 
-INCLUDE_DIR = -I@MPI_INCLUDE_DIR@  -I${srcdir}/../include -I../include -I../../include  -I${srcdir}/../../../../include -I../../../../include 
-CFLAGS      = @CPPFLAGS@ @CFLAGS@ $(INCLUDE_DIR)
+INCLUDES    = -I@MPI_INCLUDE_DIR@  -I${srcdir}/../include -I../include -I../../include  -I${srcdir}/../../../../include -I../../../../include 
+CFLAGS      = @CPPFLAGS@ @CFLAGS@ $(INCLUDES)
 
 @VPATH@
Index: /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_sfs/Makefile.in
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_sfs/Makefile.in (revision 100)
+++ /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_sfs/Makefile.in (revision 4870)
@@ -4,6 +4,6 @@
 srcdir      = @srcdir@
 
-INCLUDE_DIR = -I@MPI_INCLUDE_DIR@ -I${srcdir}/../include -I../include -I../../include  -I${srcdir}/../../../../include -I../../../../include
-CFLAGS      = @CPPFLAGS@ @CFLAGS@ $(INCLUDE_DIR)
+INCLUDES    = -I@MPI_INCLUDE_DIR@ -I${srcdir}/../include -I../include -I../../include  -I${srcdir}/../../../../include -I../../../../include
+CFLAGS      = @CPPFLAGS@ @CFLAGS@ $(INCLUDES)
 
 @VPATH@
Index: /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_ufs/Makefile.in
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_ufs/Makefile.in (revision 100)
+++ /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_ufs/Makefile.in (revision 4870)
@@ -7,10 +7,15 @@
 SHLIBNAME   = @SHLIBNAME@
 
-INCLUDE_DIR = -I@MPI_INCLUDE_DIR@ -I${srcdir}/../include -I../include -I../../include  -I${srcdir}/../../../../include -I../../../../include
-CFLAGS      = @CPPFLAGS@ @CFLAGS@ $(INCLUDE_DIR)
+#DEFS            = @DEFS@ -I. -I${srcdir}
+CPPFLAGS        = @CPPFLAGS@
+INCLUDES = -I@MPI_INCLUDE_DIR@ -I${srcdir}/../include -I../include -I../../include  -I${srcdir}/../../../../include -I../../../../include
+#CFLAGS      = @CPPFLAGS@ @CFLAGS@ $(INCLUDES) 
+CFLAGS          = @CFLAGS@
 
 top_builddir  = @master_topbuild_dir@
 LIBTOOL       = @LIBTOOL@
-C_COMPILE_SHL = $(CC_SHL) 
+C_COMPILE       = $(CC) $(DEFS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS)
+C_COMPILE_SHL   = $(CC_SHL) $(DEFS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS)
+#C_COMPILE_SHL = $(CC_SHL) 
 
 @VPATH@
@@ -26,8 +31,22 @@
 .SUFFIXES: $(SUFFIXES) .p .lo
 
+#	$(CC) $(CFLAGS) -c $<
 .c.o:
-	$(CC) $(CFLAGS) -c $<
+	@if [ "x$(VERBOSE)" != "x1" ] ; then \
+	  echo "  CC              $<" ; \
+	else \
+	  echo $(C_COMPILE) -c $< ; \
+	fi
+	@$(C_COMPILE) -c $<
+#	$(C_COMPILE_SHL) $(CFLAGS) -c $< -o _s$*.o
+#	@mv -f _s$*.o $*.lo
 .c.lo:
-	$(C_COMPILE_SHL) $(CFLAGS) -c $< -o _s$*.o
+	@if [ "x$(VERBOSE)" != "x1" ] ; then \
+	  echo "  CC              $<" ; \
+	else \
+	  echo $(C_COMPILE_SHL) -c $< -o _s$*.o ; \
+	  echo mv -f _s$*.o $*.lo ; \
+	fi
+	@$(C_COMPILE_SHL) -c $< -o _s$*.o
 	@mv -f _s$*.o $*.lo
 
Index: /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_zoidfs/Makefile.in
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_zoidfs/Makefile.in (revision 3444)
+++ /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_zoidfs/Makefile.in (revision 4870)
@@ -7,6 +7,6 @@
 SHLIBNAME   = @SHLIBNAME@
 
-INCLUDE_DIR = -I@MPI_INCLUDE_DIR@ -I${srcdir}/../include -I../include -I../../include  -I${srcdir}/../../../../include -I../../../../include
-CFLAGS      = @CPPFLAGS@ @CFLAGS@ $(INCLUDE_DIR)
+INCLUDES    = -I@MPI_INCLUDE_DIR@ -I${srcdir}/../include -I../include -I../../include  -I${srcdir}/../../../../include -I../../../../include
+CFLAGS      = @CPPFLAGS@ @CFLAGS@ $(INCLUDES)
 
 top_builddir  = @master_topbuild_dir@
Index: /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_gridftp/Makefile.in
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_gridftp/Makefile.in (revision 3078)
+++ /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_gridftp/Makefile.in (revision 4870)
@@ -7,6 +7,6 @@
 SHLIBNAME   = @SHLIBNAME@
 
-INCLUDE_DIR = -I@MPI_INCLUDE_DIR@ -I${srcdir}/../include -I../include -I../../include  -I${srcdir}/../../../../include -I../../../../include
-CFLAGS      = @CFLAGS@ $(INCLUDE_DIR)
+INCLUDES    = -I@MPI_INCLUDE_DIR@ -I${srcdir}/../include -I../include -I../../include  -I${srcdir}/../../../../include -I../../../../include
+CFLAGS      = @CFLAGS@ $(INCLUDES)
 
 top_builddir  = @master_topbuild_dir@
Index: /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_pvfs2/Makefile.in
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_pvfs2/Makefile.in (revision 2947)
+++ /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_pvfs2/Makefile.in (revision 4870)
@@ -7,10 +7,11 @@
 SHLIBNAME   = @SHLIBNAME@
 
-INCLUDE_DIR = -I@MPI_INCLUDE_DIR@ -I${srcdir}/../include -I../include -I../../include  -I${srcdir}/../../../../include -I../../../../include
-CFLAGS      = @CPPFLAGS@ @CFLAGS@ $(INCLUDE_DIR)
+INCLUDES    = -I@MPI_INCLUDE_DIR@ -I${srcdir}/../include -I../include -I../../include  -I${srcdir}/../../../../include -I../../../../include
+CFLAGS      = @CPPFLAGS@ @CFLAGS@ $(INCLUDES)
 
 top_builddir  = @master_topbuild_dir@
 LIBTOOL       = @LIBTOOL@
-C_COMPILE_SHL = $(CC_SHL)
+C_COMPILE       = $(CC) $(DEFS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS)
+C_COMPILE_SHL   = $(CC_SHL) $(DEFS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS)
 
 @VPATH@
@@ -32,7 +33,18 @@
 
 .c.o:
-	$(CC) $(CFLAGS) -c $<
+	@if [ "x$(VERBOSE)" != "x1" ] ; then \
+	    echo "  CC              $<" ; \
+	else \
+	    echo $(C_COMPILE) -c $< ; \
+	fi
+	@$(C_COMPILE) -c $<
 .c.lo:
-	$(C_COMPILE_SHL) $(CFLAGS) -c $< -o _s$*.o
+	@if [ "x$(VERBOSE)" != "x1" ] ; then \
+	    echo "  CC              $<" ; \
+	else \
+	    echo $(C_COMPILE_SHL) -c $< -o _s$*.o ; \
+	    echo mv -f _s$*.o $*.lo ; \
+	fi
+	@$(C_COMPILE_SHL) -c $< -o _s$*.o
 	@mv -f _s$*.o $*.lo
 
Index: /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_xfs/Makefile.in
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_xfs/Makefile.in (revision 100)
+++ /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_xfs/Makefile.in (revision 4870)
@@ -7,6 +7,6 @@
 SHLIBNAME   = @SHLIBNAME@
 
-INCLUDE_DIR = -I@MPI_INCLUDE_DIR@ -I${srcdir}/../include -I../include -I../../include  -I${srcdir}/../../../../include -I../../../../include
-CFLAGS      = @CPPFLAGS@ @CFLAGS@ $(INCLUDE_DIR)
+INCLUDES    = -I@MPI_INCLUDE_DIR@ -I${srcdir}/../include -I../include -I../../include  -I${srcdir}/../../../../include -I../../../../include
+CFLAGS      = @CPPFLAGS@ @CFLAGS@ $(INCLUDES)
 
 top_builddir  = @master_topbuild_dir@
Index: /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_bgl/Makefile.in
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_bgl/Makefile.in (revision 3101)
+++ /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_bgl/Makefile.in (revision 4870)
@@ -6,8 +6,8 @@
 SHLIBNAME   = @SHLIBNAME@
 
-INCLUDE_DIR = -I@MPI_INCLUDE_DIR@ -I${srcdir}/../include -I../include -I../../include  -I${srcdir}/../../../../include -I../../../../include @CPPFLAGS@
-CFLAGS      = @CFLAGS@ $(INCLUDE_DIR) -DBGL_OPTIM_STEP1_2=1 -DBGL_OPTIM_STEP1_1=1
+INCLUDES = -I@MPI_INCLUDE_DIR@ -I${srcdir}/../include -I../include -I../../include  -I${srcdir}/../../../../include -I../../../../include @CPPFLAGS@
+CFLAGS      = @CFLAGS@ $(INCLUDES) -DBGL_OPTIM_STEP1_2=1 -DBGL_OPTIM_STEP1_1=1
 
-C_COMPILE_SHL = $(CC_SHL) @CFLAGS@ $(INCLUDE_DIR)
+C_COMPILE_SHL = $(CC_SHL) @CFLAGS@ $(INCLUDES)
 
 @VPATH@
Index: /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_panfs/Makefile.in
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_panfs/Makefile.in (revision 100)
+++ /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_panfs/Makefile.in (revision 4870)
@@ -7,6 +7,6 @@
 SHLIBNAME   = @SHLIBNAME@
 
-INCLUDE_DIR = -I@MPI_INCLUDE_DIR@ -I${srcdir}/../include -I../include -I../../include -I${srcdir}/../../../../include -I../../../../include -I/opt/panfs/include
-CFLAGS      = @CFLAGS@ $(INCLUDE_DIR)
+INCLUDES    = -I@MPI_INCLUDE_DIR@ -I${srcdir}/../include -I../include -I../../include -I${srcdir}/../../../../include -I../../../../include -I/opt/panfs/include
+CFLAGS      = @CFLAGS@ $(INCLUDES)
 
 C_COMPILE_SHL = $(CC_SHL)
Index: /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_testfs/Makefile.in
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_testfs/Makefile.in (revision 100)
+++ /mpich2/branches/dev/kumudb/src/mpi/romio/adio/ad_testfs/Makefile.in (revision 4870)
@@ -8,10 +8,15 @@
 SHLIBNAME   = @SHLIBNAME@
 
-INCLUDE_DIR = -I@MPI_INCLUDE_DIR@ -I${srcdir}/../include -I../include -I../../include  -I${srcdir}/../../../../include -I../../../../include
-CFLAGS      = @CPPFLAGS@ @CFLAGS@ $(INCLUDE_DIR)
+#DEFS            = @DEFS@ -I. -I${srcdir}
+CPPFLAGS        = @CPPFLAGS@
+INCLUDES = -I@MPI_INCLUDE_DIR@ -I${srcdir}/../include -I../include -I../../include  -I${srcdir}/../../../../include -I../../../../include
+#CFLAGS      = @CPPFLAGS@ @CFLAGS@ $(INCLUDES) 
+CFLAGS          = @CFLAGS@
 
 top_builddir  = @master_topbuild_dir@
 LIBTOOL       = @LIBTOOL@
-C_COMPILE_SHL = $(CC_SHL) 
+C_COMPILE       = $(CC) $(DEFS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS)
+C_COMPILE_SHL   = $(CC_SHL) $(DEFS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS)
+#C_COMPILE_SHL = $(CC_SHL) 
 
 @VPATH@
@@ -31,8 +36,22 @@
 .SUFFIXES: $(SUFFIXES) .p .lo
 
+#	$(CC) $(CFLAGS) -c $<
 .c.o:
-	$(CC) $(CFLAGS) -c $<
+	@if [ "x$(VERBOSE)" != "x1" ] ; then \
+	  echo "  CC              $<" ; \
+	else \
+	  echo $(C_COMPILE) -c $< ; \
+	fi
+	@$(C_COMPILE) -c $<
+#	$(C_COMPILE_SHL) $(CFLAGS) -c $< -o _s$*.o
+#	@mv -f _s$*.o $*.lo
 .c.lo:
-	$(C_COMPILE_SHL) $(CFLAGS) -c $< -o _s$*.o
+	@if [ "x$(VERBOSE)" != "x1" ] ; then \
+	  echo "  CC              $<" ; \
+	else \
+	  echo $(C_COMPILE_SHL) -c $< -o _s$*.o ; \
+	  echo mv -f _s$*.o $*.lo ; \
+	fi
+	@$(C_COMPILE_SHL) -c $< -o _s$*.o
 	@mv -f _s$*.o $*.lo
 
Index: /mpich2/branches/dev/kumudb/src/mpi/init/finalize.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpi/init/finalize.c (revision 4060)
+++ /mpich2/branches/dev/kumudb/src/mpi/init/finalize.c (revision 4870)
@@ -180,13 +180,4 @@
     }
 
-    /* At this point, we end the critical section for the Finalize call.
-       Since we've set MPIR_Process.initialized value to POST_FINALIZED, 
-       if the user erroneously calls Finalize from another thread, an
-       error message will be issued. */
-    /* We put this here to avoid nesting problems with the callbacks - 
-       however, an erroneous user program could cause problems here if if
-       makes its own MPI calls. */
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
-    
     /* FIXME: Why is this not one of the finalize callbacks?.  Do we need
        pre and post MPID_Finalize callbacks? */
@@ -249,4 +240,5 @@
 #endif
 
+    MPIU_THREAD_CS_EXIT(ALLFUNC,);
     MPIR_Process.initialized = MPICH_POST_FINALIZED;
 
@@ -317,5 +309,7 @@
 #   endif
     mpi_errno = MPIR_Err_return_comm( 0, FCNAME, mpi_errno );
-    MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    if (MPIR_Process.initialized < MPICH_POST_FINALIZED) {
+        MPIU_THREAD_CS_EXIT(ALLFUNC,);
+    }
     goto fn_exit;
     /* --END ERROR HANDLING-- */
Index: /mpich2/branches/dev/kumudb/src/mpi/init/initthread.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpi/init/initthread.c (revision 4567)
+++ /mpich2/branches/dev/kumudb/src/mpi/init/initthread.c (revision 4870)
@@ -45,4 +45,21 @@
    how MPICH2 was configured. */
 extern const char MPIR_Version_device[];
+
+/* Make sure the Fortran symbols are initialized unless it will cause problems
+   for C programs linked with the C compilers (i.e., not using the 
+   compilation scripts).  These provide the declarations for the initialization
+   routine and the variable used to indicate whether the init needs to be
+   called. */
+#if defined(HAVE_FORTRAN_BINDING) && defined(HAVE_MPI_F_INIT_WORKS_WITH_C)
+#ifdef F77_NAME_UPPER
+#define mpirinitf_ MPIRINITF
+#elif defined(F77_NAME_LOWER) || defined(F77_NAME_MIXED)
+#define mpirinitf_ mpirinitf
+#endif
+void mpirinitf_(void);
+/* Note that we don't include MPIR_F_NeedInit because we unconditionally
+   call mpirinitf in this case, and the Fortran binding routines 
+   do not test MPIR_F_NeedInit when HAVE_MPI_F_INIT_WORKS_WITH_C is set */
+#endif
 
 #ifdef HAVE_WINDOWS_H
@@ -412,10 +429,15 @@
 #endif
 
-    /* FIXME: There is no code for this comment */
-    /* We now initialize the Fortran symbols from within the Fortran 
+    /* Initialize the C versions of the Fortran link-time constants.
+       
+       We now initialize the Fortran symbols from within the Fortran 
        interface in the routine that first needs the symbols.
        This fixes a problem with symbols added by a Fortran compiler that 
        are not part of the C runtime environment (the Portland group
-       compilers would do this) */
+       compilers would do this) 
+    */
+#if defined(HAVE_FORTRAN_BINDING) && defined(HAVE_MPI_F_INIT_WORKS_WITH_C)
+    mpirinitf_();
+#endif
 
     /* --BEGIN ERROR HANDLING-- */
Index: /mpich2/branches/dev/kumudb/src/mpi/datatype/get_elements.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpi/datatype/get_elements.c (revision 1249)
+++ /mpich2/branches/dev/kumudb/src/mpi/datatype/get_elements.c (revision 4870)
@@ -387,7 +387,13 @@
 	}
 	else {
-	    *elements = MPIR_Type_get_basic_type_elements(&byte_count,
-							  -1,
-							  datatype);
+	    /* Behaves just like MPI_Get_Count in the predefined case */
+	    int size;
+	    MPID_Datatype_get_size_macro(datatype, size);
+            if ((byte_count % size) != 0)
+                *elements = MPI_UNDEFINED;
+            else
+                *elements = MPIR_Type_get_basic_type_elements(&byte_count,
+							      -1,
+							      datatype);
 	}
 	MPIU_Assert(byte_count >= 0);
Index: /mpich2/branches/dev/kumudb/src/mpi/datatype/pack.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpi/datatype/pack.c (revision 1249)
+++ /mpich2/branches/dev/kumudb/src/mpi/datatype/pack.c (revision 4870)
@@ -69,4 +69,8 @@
     MPID_Comm *comm_ptr = NULL;
     MPID_Segment *segp;
+    int contig;
+    MPI_Aint dt_true_lb;
+    MPI_Aint data_sz;
+
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_PACK);
 
@@ -160,4 +164,26 @@
     }
 
+    /* Handle contig case quickly */
+    if (HANDLE_GET_KIND(datatype) == HANDLE_KIND_BUILTIN) {
+        contig     = TRUE;
+        dt_true_lb = 0;
+        data_sz    = incount * MPID_Datatype_get_basic_size(datatype);
+    } else {
+        MPID_Datatype *dt_ptr;
+        MPID_Datatype_get_ptr(datatype, dt_ptr);
+	contig     = dt_ptr->is_contig;
+        dt_true_lb = dt_ptr->true_lb;
+        data_sz    = incount * dt_ptr->size;
+    }
+
+    if (contig) {
+        MPIU_Memcpy((char *) outbuf + *position, (char *)inbuf + dt_true_lb, data_sz);
+        *position = (int)((MPI_Aint)*position + data_sz);
+        goto fn_exit;
+    }
+    
+
+    /* non-contig case */
+    
     /* TODO: CHECK RETURN VALUES?? */
     /* TODO: SHOULD THIS ALL BE IN A MPID_PACK??? */
Index: /mpich2/branches/dev/kumudb/src/mpi/datatype/unpack.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpi/datatype/unpack.c (revision 1249)
+++ /mpich2/branches/dev/kumudb/src/mpi/datatype/unpack.c (revision 4870)
@@ -65,4 +65,7 @@
     MPID_Comm *comm_ptr = NULL;
     MPID_Segment *segp;
+    int contig;
+    MPI_Aint dt_true_lb;
+    MPI_Aint data_sz;
     MPID_MPI_STATE_DECL(MPID_STATE_MPI_UNPACK);
 
@@ -124,4 +127,25 @@
     }
 
+    /* Handle contig case quickly */
+    if (HANDLE_GET_KIND(datatype) == HANDLE_KIND_BUILTIN) {
+        contig     = TRUE;
+        dt_true_lb = 0;
+        data_sz    = outcount * MPID_Datatype_get_basic_size(datatype);
+    } else {
+        MPID_Datatype *dt_ptr;
+        MPID_Datatype_get_ptr(datatype, dt_ptr);
+	contig     = dt_ptr->is_contig;
+        dt_true_lb = dt_ptr->true_lb;
+        data_sz    = outcount * dt_ptr->size;
+    }
+
+    if (contig) {
+        MPIU_Memcpy((char *) outbuf + dt_true_lb, (char *)inbuf + *position, data_sz);
+        *position = (int)((MPI_Aint)*position + data_sz);
+        goto fn_exit;
+    }
+    
+
+    /* non-contig case */
     segp = MPID_Segment_alloc();
     MPIU_ERR_CHKANDJUMP1((segp == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc");
Index: /mpich2/branches/dev/kumudb/src/pmi/smpd/smpd_ipmi.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/pmi/smpd/smpd_ipmi.c (revision 4502)
+++ /mpich2/branches/dev/kumudb/src/pmi/smpd/smpd_ipmi.c (revision 4870)
@@ -2051,6 +2051,6 @@
     if (strcmp(str, DBS_SUCCESS_STR))
     {
-	/* FIXME: If we are going to use pmi for the publish/lookup interface then gets should be allowed to fail without printing errors */
-	pmi_err_printf("PMI_KVS_Get failed: '%s'\n", str);
+        /* Unable to find the keyval in db. The caller should handle this error */
+	pmi_dbg_printf("PMI_KVS_Get failed: '%s'\n", str);
 	return PMI_FAIL;
     }
Index: /mpich2/branches/dev/kumudb/src/env/mpif90.bash.in
===================================================================
--- /mpich2/branches/dev/kumudb/src/env/mpif90.bash.in (revision 4441)
+++ /mpich2/branches/dev/kumudb/src/env/mpif90.bash.in (revision 4870)
@@ -341,8 +341,8 @@
         mpilibs="$F90_LINKPATH_SHL$libdir $mpilibs"
     fi
-    $Show $F90 $F90FLAGS $LDFLAGS "${allargs[@]}" $F90INCDIRS $F90MODDIRS -L$libdir -L$opalibdir $F90MODLIBS $mpilibs $MPI_OTHERLIBS
+    $Show $F90 $MPICH2_MPIF90_FLAGS $F90FLAGS $LDFLAGS "${allargs[@]}" $F90INCDIRS $F90MODDIRS -L$libdir -L$opalibdir $MPICH2_LDFLAGS $F90MODLIBS $mpilibs $MPI_OTHERLIBS
     rc=$?
 else
-    $Show $F90 $F90FLAGS "${allargs[@]}" $F90INCDIRS $F90MODDIRS
+    $Show $F90 $MPICH2_MPIF90_FLAGS $F90FLAGS "${allargs[@]}" $F90INCDIRS $F90MODDIRS
     rc=$?
 fi
Index: /mpich2/branches/dev/kumudb/src/env/mpicxx.bash.in
===================================================================
--- /mpich2/branches/dev/kumudb/src/env/mpicxx.bash.in (revision 4441)
+++ /mpich2/branches/dev/kumudb/src/env/mpicxx.bash.in (revision 4870)
@@ -246,8 +246,8 @@
         shllibpath="$CXX_LINKPATH_SHL$libdir"
     fi
-    $Show $CXX $CXXFLAGS $LDFLAGS "${allargs[@]}" -I$includedir -L$libdir -L$opalibdir $shllibpath $cxxlibs $mpilibs $MPI_OTHERLIBS
+    $Show $CXX $MPICH2_MPICXX_FLAGS $CXXFLAGS $LDFLAGS "${allargs[@]}" -I$includedir -L$libdir -L$opalibdir $shllibpath $MPICH2_LDFLAGS $cxxlibs $mpilibs $MPI_OTHERLIBS
     rc=$?
 else
-    $Show $CXX $CXXFLAGS "${allargs[@]}" -I$includedir
+    $Show $CXX $MPICH2_MPICXX_FLAGS $CXXFLAGS "${allargs[@]}" -I$includedir
     rc=$?
 fi
Index: /mpich2/branches/dev/kumudb/src/env/mpif77.bash.in
===================================================================
--- /mpich2/branches/dev/kumudb/src/env/mpif77.bash.in (revision 4441)
+++ /mpich2/branches/dev/kumudb/src/env/mpif77.bash.in (revision 4870)
@@ -294,8 +294,8 @@
         mpilibs="$FC_LINKPATH_SHL$libdir $mpilibs"
     fi
-    $Show $FC $FFLAGS $LDFLAGS "${allargs[@]}" -I$includedir -L$libdir -L$opalibdir $mpilibs $MPI_OTHERLIBS
+    $Show $FC $MPICH2_MPIF77_FLAGS $FFLAGS $LDFLAGS "${allargs[@]}" -I$includedir -L$libdir -L$opalibdir $MPICH2_LDFLAGS $mpilibs $MPI_OTHERLIBS
     rc=$?
 else
-    $Show $FC $FFLAGS "${allargs[@]}" -I$includedir
+    $Show $FC $MPICH2_MPIF77_FLAGS $FFLAGS "${allargs[@]}" -I$includedir
     rc=$?
 fi
Index: /mpich2/branches/dev/kumudb/src/env/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/src/env/Makefile.sm (revision 4811)
+++ /mpich2/branches/dev/kumudb/src/env/Makefile.sm (revision 4870)
@@ -14,2 +14,9 @@
 optinstall_SCRIPT = mpicxx mpif77 mpif90
 optinstall_ETC = mpicxx.conf mpif77.conf mpif90.conf
+# Provide an alias for mpicxx to support tools that assume that mpicxx is
+# called mpic++
+install-postamble:
+	if [ -x ${DESTDIR}${bindir}/mpicxx ] ; then \
+	    cd ${DESTDIR}${bindir} && ln -sf mpicxx mpic++ ; fi
+uninstall-postamble:
+	rm -f ${DESTDIR}${bindir}/mpic++
Index: /mpich2/branches/dev/kumudb/src/env/mpicc.in
===================================================================
--- /mpich2/branches/dev/kumudb/src/env/mpicc.in (revision 4441)
+++ /mpich2/branches/dev/kumudb/src/env/mpicc.in (revision 4870)
@@ -255,8 +255,8 @@
 	mpilibs="$C_LINKPATH_SHL$libdir $mpilibs"
     fi
-    $Show $CC $CFLAGS $LDFLAGS $allargs -I$includedir -L$libdir -L$opalibdir $mpilibs $MPI_OTHERLIBS
+    $Show $CC $MPICH2_MPICC_FLAGS $CFLAGS $LDFLAGS $allargs -I$includedir -L$libdir -L$opalibdir $MPICH2_LDFLAGS $mpilibs $MPI_OTHERLIBS
     rc=$?
 else
-    $Show $CC $CFLAGS $allargs -I$includedir
+    $Show $CC $MPICH2_MPICC_FLAGS $CFLAGS $allargs -I$includedir
     rc=$?
 fi
Index: /mpich2/branches/dev/kumudb/src/env/mpif90.in
===================================================================
--- /mpich2/branches/dev/kumudb/src/env/mpif90.in (revision 4441)
+++ /mpich2/branches/dev/kumudb/src/env/mpif90.in (revision 4870)
@@ -363,8 +363,8 @@
         mpilibs="$F90_LINKPATH_SHL$libdir $mpilibs"
     fi
-    $Show $F90 $F90FLAGS $LDFLAGS $allargs $F90INCDIRS $F90MODDIRS -L$libdir -L$opalibdir $F90MODLIBS $mpilibs $MPI_OTHERLIBS
+    $Show $F90 $MPICH2_MPIF90_FLAGS $F90FLAGS $LDFLAGS $allargs $F90INCDIRS $F90MODDIRS -L$libdir -L$opalibdir $MPICH2_LDFLAGS $F90MODLIBS $mpilibs $MPI_OTHERLIBS
     rc=$?
 else
-    $Show $F90 $F90FLAGS $allargs $F90INCDIRS $F90MODDIRS
+    $Show $F90 $MPICH2_MPIF90_FLAGS $F90FLAGS $allargs $F90INCDIRS $F90MODDIRS
     rc=$?
 fi
Index: /mpich2/branches/dev/kumudb/src/env/mpicc.bash.in
===================================================================
--- /mpich2/branches/dev/kumudb/src/env/mpicc.bash.in (revision 4441)
+++ /mpich2/branches/dev/kumudb/src/env/mpicc.bash.in (revision 4870)
@@ -246,8 +246,8 @@
 	mpilibs="$C_LINKPATH_SHL$libdir $mpilibs"
     fi
-    $Show $CC $CFLAGS $LDFLAGS "${allargs[@]}" -I$includedir -L$libdir -L$opalibdir $mpilibs $MPI_OTHERLIBS
+    $Show $CC $MPICH2_MPICC_FLAGS $CFLAGS $LDFLAGS "${allargs[@]}" -I$includedir -L$libdir -L$opalibdir $MPICH2_LDFLAGS $mpilibs $MPI_OTHERLIBS
     rc=$?
 else
-    $Show $CC $CFLAGS "${allargs[@]}" -I$includedir
+    $Show $CC $MPICH2_MPICC_FLAGS $CFLAGS "${allargs[@]}" -I$includedir
     rc=$?
 fi
Index: /mpich2/branches/dev/kumudb/src/env/mpicxx.in
===================================================================
--- /mpich2/branches/dev/kumudb/src/env/mpicxx.in (revision 4441)
+++ /mpich2/branches/dev/kumudb/src/env/mpicxx.in (revision 4870)
@@ -255,8 +255,8 @@
         shllibpath="$CXX_LINKPATH_SHL$libdir"
     fi
-    $Show $CXX $CXXFLAGS $LDFLAGS $allargs -I$includedir -L$libdir -L$opalibdir $shllibpath $cxxlibs $mpilibs $MPI_OTHERLIBS
+    $Show $CXX $MPICH2_MPICXX_FLAGS $CXXFLAGS $LDFLAGS $allargs -I$includedir -L$libdir -L$opalibdir $shllibpath $MPICH2_LDFLAGS $cxxlibs $mpilibs $MPI_OTHERLIBS
     rc=$?
 else
-    $Show $CXX $CXXFLAGS $allargs -I$includedir
+    $Show $CXX $MPICH2_MPICXX_FLAGS $CXXFLAGS $allargs -I$includedir
     rc=$?
 fi
Index: /mpich2/branches/dev/kumudb/src/env/mpif77.in
===================================================================
--- /mpich2/branches/dev/kumudb/src/env/mpif77.in (revision 4441)
+++ /mpich2/branches/dev/kumudb/src/env/mpif77.in (revision 4870)
@@ -316,8 +316,8 @@
         mpilibs="$FC_LINKPATH_SHL$libdir $mpilibs"
     fi
-    $Show $FC $FFLAGS $LDFLAGS $allargs -I$includedir -L$libdir -L$opalibdir $mpilibs $MPI_OTHERLIBS
+    $Show $FC $MPICH2_MPIF77_FLAGS $FFLAGS $LDFLAGS $allargs -I$includedir -L$libdir -L$opalibdir $MPICH2_LDFLAGS $mpilibs $MPI_OTHERLIBS
     rc=$?
 else
-    $Show $FC $FFLAGS $allargs -I$includedir
+    $Show $FC $MPICH2_MPIF77_FLAGS $FFLAGS $allargs -I$includedir
     rc=$?
 fi
Index: /mpich2/branches/dev/kumudb/src/mpid/common/datatype/mpid_ext32_datatype.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpid/common/datatype/mpid_ext32_datatype.c (revision 100)
+++ /mpich2/branches/dev/kumudb/src/mpid/common/datatype/mpid_ext32_datatype.c (revision 4870)
@@ -60,5 +60,5 @@
 {
     MPI_Aint ret = (MPI_Aint) 0;
-    int i = 0;
+    unsigned int i = 0;
     for(i = 0; i < (sizeof(external32_basic_size_array) /
                     sizeof(external32_basic_size_t)); i++)
Index: /mpich2/branches/dev/kumudb/src/mpid/common/datatype/dataloop/dataloop_create_contig.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpid/common/datatype/dataloop/dataloop_create_contig.c (revision 100)
+++ /mpich2/branches/dev/kumudb/src/mpid/common/datatype/dataloop/dataloop_create_contig.c (revision 4870)
@@ -127,10 +127,4 @@
 	else
 	{
-	    DLOOP_Dataloop *old_loop_ptr;
-	    int old_loop_sz = 0;
-
-	    DLOOP_Handle_get_loopptr_macro(oldtype, old_loop_ptr, flag);
-	    DLOOP_Handle_get_loopsize_macro(oldtype, old_loop_sz, flag);
-
 	    /* allocate space for new loop including copy of old */
 	    PREPEND_PREFIX(Dataloop_alloc_and_copy)(DLOOP_KIND_CONTIG,
Index: /mpich2/branches/dev/kumudb/src/mpid/common/datatype/dataloop/dataloop_create_struct.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpid/common/datatype/dataloop/dataloop_create_struct.c (revision 3939)
+++ /mpich2/branches/dev/kumudb/src/mpid/common/datatype/dataloop/dataloop_create_struct.c (revision 4870)
@@ -372,5 +372,4 @@
 	{
 	    DLOOP_Dataloop *old_loop_ptr;
-	    int old_loop_sz;
 	    DLOOP_Offset old_extent;
 
Index: /mpich2/branches/dev/kumudb/src/mpid/ch3/channels/ssm/configure.in
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpid/ch3/channels/ssm/configure.in (revision 3234)
+++ /mpich2/branches/dev/kumudb/src/mpid/ch3/channels/ssm/configure.in (revision 4870)
@@ -31,4 +31,5 @@
 
 echo "RUNNING CONFIGURE FOR THE SOCK-SHARED_MEMORY CHANNEL"
+echo "WARNING: THIS CHANNEL IS DEPRECATED AND WILL BE REMOVED IN FUTURE RELEASES OF MPICH2"
 
 save_libs=$LIBS
Index: /mpich2/branches/dev/kumudb/src/mpid/ch3/channels/nemesis/nemesis/include/mpid_nem_memdefs.h
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpid/ch3/channels/nemesis/nemesis/include/mpid_nem_memdefs.h (revision 4707)
+++ /mpich2/branches/dev/kumudb/src/mpid/ch3/channels/nemesis/nemesis/include/mpid_nem_memdefs.h (revision 4870)
@@ -265,5 +265,6 @@
 
 #else
-#define MPIU_Memcpy(dst, src, n) do { volatile void * restrict d = (dst); volatile const void *restrict s = (src); MPIUI_Memcpy((void *)d, (const void *)s, n); }while (0)
+/* #define MPIU_Memcpy(dst, src, n) do { volatile void * restrict d = (dst); volatile const void *restrict s = (src); MPIUI_Memcpy((void *)d, (const void *)s, n); }while (0) */
+#define MPIU_Memcpy(dst, src, n) MPIUI_Memcpy(dst, src, n)
 #endif
 
Index: /mpich2/branches/dev/kumudb/src/mpid/ch3/channels/nemesis/nemesis/netmod/tcp/socksm.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpid/ch3/channels/nemesis/nemesis/netmod/tcp/socksm.c (revision 4707)
+++ /mpich2/branches/dev/kumudb/src/mpid/ch3/channels/nemesis/nemesis/netmod/tcp/socksm.c (revision 4870)
@@ -1556,5 +1556,5 @@
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_tcp_sm_init()
+int MPID_nem_tcp_sm_init(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -1601,5 +1601,5 @@
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_tcp_sm_finalize()
+int MPID_nem_tcp_sm_finalize(void)
 {
     freenode_t *node;
Index: /mpich2/branches/dev/kumudb/src/mpid/ch3/channels/nemesis/nemesis/netmod/tcp/tcp_send.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpid/ch3/channels/nemesis/nemesis/netmod/tcp/tcp_send.c (revision 4511)
+++ /mpich2/branches/dev/kumudb/src/mpid/ch3/channels/nemesis/nemesis/netmod/tcp/tcp_send.c (revision 4870)
@@ -49,5 +49,5 @@
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_tcp_send_init()
+int MPID_nem_tcp_send_init(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -187,5 +187,5 @@
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_tcp_send_finalize()
+int MPID_nem_tcp_send_finalize(void)
 {
     int mpi_errno = MPI_SUCCESS;
Index: /mpich2/branches/dev/kumudb/src/mpid/ch3/channels/nemesis/nemesis/netmod/tcp/tcp_finalize.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpid/ch3/channels/nemesis/nemesis/netmod/tcp/tcp_finalize.c (revision 4415)
+++ /mpich2/branches/dev/kumudb/src/mpid/ch3/channels/nemesis/nemesis/netmod/tcp/tcp_finalize.c (revision 4870)
@@ -11,5 +11,5 @@
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_tcp_finalize()
+int MPID_nem_tcp_finalize(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -41,5 +41,5 @@
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_tcp_ckpt_shutdown()
+int MPID_nem_tcp_ckpt_shutdown(void)
 {
     return MPID_nem_tcp_finalize();
Index: /mpich2/branches/dev/kumudb/src/mpid/ch3/channels/nemesis/nemesis/netmod/tcp/tcp_init.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpid/ch3/channels/nemesis/nemesis/netmod/tcp/tcp_init.c (revision 4707)
+++ /mpich2/branches/dev/kumudb/src/mpid/ch3/channels/nemesis/nemesis/netmod/tcp/tcp_init.c (revision 4870)
@@ -232,27 +232,25 @@
         }
     }
-
+    
+    if (ifaddr.len > 0 && ifaddr.type == AF_INET)
     {
-	char ifname[256];
-	unsigned char *p;
-	if (ifaddr.len > 0 && ifaddr.type == AF_INET)
+        unsigned char *p;
+        p = (unsigned char *)(ifaddr.ifaddr);
+        MPIU_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 );
+        mpi_errno = MPIU_Str_add_string_arg(bc_val_p, val_max_sz_p, MPIDI_CH3I_IFNAME_KEY, ifname);
+        if (mpi_errno != MPIU_STR_SUCCESS)
         {
-	    p = (unsigned char *)(ifaddr.ifaddr);
-	    MPIU_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 );
-	    mpi_errno = MPIU_Str_add_string_arg(bc_val_p, val_max_sz_p, MPIDI_CH3I_IFNAME_KEY, ifname);
-	    if (mpi_errno != MPIU_STR_SUCCESS)
+            if (mpi_errno == MPIU_STR_NOMEM)
             {
-		if (mpi_errno == MPIU_STR_NOMEM)
-                {
-		    MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard_len");
-		}
-		else
-                {
-		    MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
-		}
-	    }
-	}
-    }
+                MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard_len");
+            }
+            else
+            {
+                MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
+            }
+        }
+    }
+    
 
     /*     printf("MPID_nem_tcp_get_business_card. port=%d\n", sock_id.sin_port); */
Index: /mpich2/branches/dev/kumudb/src/mpid/ch3/channels/nemesis/nemesis/netmod/tcp/tcp_impl.h
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpid/ch3/channels/nemesis/nemesis/netmod/tcp/tcp_impl.h (revision 4530)
+++ /mpich2/branches/dev/kumudb/src/mpid/ch3/channels/nemesis/nemesis/netmod/tcp/tcp_impl.h (revision 4870)
@@ -155,5 +155,6 @@
 S*/
 typedef struct MPIDU_Sock_ifaddr_t {
-    int len, type;
+    unsigned int len;
+    int type;
     unsigned char ifaddr[16];
 } MPIDU_Sock_ifaddr_t;
Index: /mpich2/branches/dev/kumudb/src/mpid/ch3/channels/nemesis/nemesis/netmod/newmad/newmad_init.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpid/ch3/channels/nemesis/nemesis/netmod/newmad/newmad_init.c (revision 4738)
+++ /mpich2/branches/dev/kumudb/src/mpid/ch3/channels/nemesis/nemesis/netmod/newmad/newmad_init.c (revision 4870)
@@ -404,10 +404,10 @@
 {
     MPIDI_CH3I_VC           *vc_ch = (MPIDI_CH3I_VC *)vc->channel_private;
-    char                     business_card[4*(MPID_NEM_NMAD_MAX_SIZE)];
+    char                     business_card[MPID_NEM_NMAD_MAX_SIZE];
     int                      mpi_errno = MPI_SUCCESS;   
     int                      ret;
     int                      index;
 
-    mpi_errno = vc->pg->getConnInfo(vc->pg_rank, business_card, 4*(MPID_NEM_NMAD_MAX_SIZE), vc->pg);
+    mpi_errno = vc->pg->getConnInfo(vc->pg_rank, business_card,MPID_NEM_NMAD_MAX_SIZE, vc->pg);
     if (mpi_errno) MPIU_ERR_POP(mpi_errno);
        
@@ -428,40 +428,13 @@
 	
 	if (vc->lpid > mpid_nem_newmad_myrank){
-	    ret = nm_core_gate_accept(mpid_nem_newmad_pcore,VC_FIELD(vc, p_gate), drv_id[index], NULL);
+	    ret = nm_core_gate_accept(mpid_nem_newmad_pcore,init_reqs[vc->lpid].p_gate, drv_id[index], NULL);
 	}
 	else if (vc->lpid < mpid_nem_newmad_myrank){
-	    ret = nm_core_gate_connect(mpid_nem_newmad_pcore,VC_FIELD(vc, p_gate), drv_id[index], VC_FIELD(vc, url[index]));
+	    ret = nm_core_gate_connect(mpid_nem_newmad_pcore,init_reqs[vc->lpid].p_gate, drv_id[index], VC_FIELD(vc, url[index]));
 	}
     }
-   
-   if (vc->lpid > mpid_nem_newmad_myrank)
-   {
-      nm_sr_irecv_with_ref(mpid_nem_newmad_pcore,
-			   init_reqs[vc->lpid].p_gate,
-			   0xfffffffc,
-			   &(init_reqs[vc->lpid].process_no),
-			   sizeof(int),
-			   &(init_reqs[vc->lpid].init_request),
-			   (void *)&(init_reqs[vc->lpid]));
-      
-      nm_sr_request_monitor(mpid_nem_newmad_pcore,&(init_reqs[vc->lpid].init_request),NM_SR_EVENT_RECV_COMPLETED,
-			    &MPID_nem_newmad_recv_init_msg);
-   }
-   else if (vc->lpid < mpid_nem_newmad_myrank)
-   {
-      nm_gate_ref_set(init_reqs[vc->lpid].p_gate,(void*)vc);
-      VC_FIELD(vc, p_gate) = init_reqs[vc->lpid].p_gate;
-      
-      nm_sr_isend(mpid_nem_newmad_pcore,
-		  init_reqs[vc->lpid].p_gate,
-		  0xfffffffc,
-		  &mpid_nem_newmad_myrank,
-		  sizeof(int),
-		  &(init_reqs[vc->lpid].init_request));
-      
-      nm_sr_request_monitor(mpid_nem_newmad_pcore,&(init_reqs[vc->lpid].init_request),NM_SR_EVENT_SEND_COMPLETED,
-			    &MPID_nem_newmad_send_init_msg);
-   }
-
+
+   MPIDI_CHANGE_VC_STATE(vc, ACTIVE);
+   
    vc->eager_max_msg_sz = 32768;
    vc->rndvSend_fn      = NULL;
@@ -484,4 +457,38 @@
 int MPID_nem_newmad_post_init(void)
 {
+   MPIDI_PG_t *pg_p;
+   int         index;
+
+   pg_p = MPIDI_Process.my_pg;
+   for (index = 0; index < pg_p->size ; index++)
+   {
+      if((index != mpid_nem_newmad_myrank) && !(MPID_NEM_IS_LOCAL(index))) 
+      {
+	 MPIDI_VC_t *vc;
+	 MPIDI_PG_Get_vc_set_active(pg_p, index, &vc);
+
+	 if (vc->lpid > mpid_nem_newmad_myrank)
+	 {
+	    nm_sr_irecv_with_ref(mpid_nem_newmad_pcore,init_reqs[vc->lpid].p_gate,0xfffffffc,
+				 &(init_reqs[vc->lpid].process_no),sizeof(int),&(init_reqs[vc->lpid].init_request),
+				 (void *)&(init_reqs[vc->lpid]));
+	      
+	    nm_sr_request_monitor(mpid_nem_newmad_pcore,&(init_reqs[vc->lpid].init_request),NM_SR_EVENT_RECV_COMPLETED,
+				  &MPID_nem_newmad_recv_init_msg);
+	 }
+	 else if (vc->lpid < mpid_nem_newmad_myrank)
+	 {
+	    nm_gate_ref_set(init_reqs[vc->lpid].p_gate,(void*)vc);
+	    VC_FIELD(vc, p_gate) = init_reqs[vc->lpid].p_gate;
+	    
+	    nm_sr_isend(mpid_nem_newmad_pcore,init_reqs[vc->lpid].p_gate,0xfffffffc,&mpid_nem_newmad_myrank,sizeof(int),
+			&(init_reqs[vc->lpid].init_request));
+	    
+	    nm_sr_request_monitor(mpid_nem_newmad_pcore,&(init_reqs[vc->lpid].init_request),NM_SR_EVENT_SEND_COMPLETED,
+				  &MPID_nem_newmad_send_init_msg);
+	 }
+      }
+   }
+   
    while((num_recv_req > 0) || (num_send_req > 0))
      nm_schedule(mpid_nem_newmad_pcore);
Index: /mpich2/branches/dev/kumudb/src/mpid/ch3/channels/nemesis/nemesis/netmod/newmad/newmad_impl.h
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpid/ch3/channels/nemesis/nemesis/netmod/newmad/newmad_impl.h (revision 4737)
+++ /mpich2/branches/dev/kumudb/src/mpid/ch3/channels/nemesis/nemesis/netmod/newmad/newmad_impl.h (revision 4870)
@@ -69,5 +69,5 @@
 
 #define MPID_NEM_NMAD_MAX_NETS 4
-#define MPID_NEM_NMAD_MAX_SIZE MPID_NEM_MAX_NETMOD_STRING_LEN
+#define MPID_NEM_NMAD_MAX_SIZE (10*(MPID_NEM_MAX_NETMOD_STRING_LEN))
 typedef nm_gate_t mpid_nem_newmad_p_gate_t;
 
Index: /mpich2/branches/dev/kumudb/src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_alloc.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_alloc.c (revision 4538)
+++ /mpich2/branches/dev/kumudb/src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_alloc.c (revision 4870)
@@ -448,5 +448,5 @@
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_CH3I_Seg_destroy()
+int MPIDI_CH3I_Seg_destroy(void)
 {
     int mpi_errno = MPI_SUCCESS;
Index: /mpich2/branches/dev/kumudb/src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_finalize.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_finalize.c (revision 4371)
+++ /mpich2/branches/dev/kumudb/src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_finalize.c (revision 4870)
@@ -15,5 +15,5 @@
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_finalize()
+int MPID_nem_finalize(void)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -77,5 +77,5 @@
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_ckpt_shutdown()
+int MPID_nem_ckpt_shutdown(void)
 {
     int mpi_errno = MPI_SUCCESS;
Index: /mpich2/branches/dev/kumudb/src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_lmt_shm.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_lmt_shm.c (revision 4707)
+++ /mpich2/branches/dev/kumudb/src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_lmt_shm.c (revision 4870)
@@ -760,5 +760,5 @@
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_lmt_shm_progress()
+int MPID_nem_lmt_shm_progress(void)
 {
     int mpi_errno = MPI_SUCCESS;
Index: /mpich2/branches/dev/kumudb/src/mpid/ch3/channels/shm/configure.in
===================================================================
--- /mpich2/branches/dev/kumudb/src/mpid/ch3/channels/shm/configure.in (revision 3234)
+++ /mpich2/branches/dev/kumudb/src/mpid/ch3/channels/shm/configure.in (revision 4870)
@@ -31,4 +31,5 @@
 
 echo "RUNNING CONFIGURE FOR THE SHARED MEMORY CHANNEL"
+echo "WARNING: THIS CHANNEL IS DEPRECATED AND WILL BE REMOVED IN FUTURE RELEASES OF MPICH2"
 
 dnl
Index: /mpich2/branches/dev/kumudb/src/binding/cxx/buildiface
===================================================================
--- /mpich2/branches/dev/kumudb/src/binding/cxx/buildiface (revision 4250)
+++ /mpich2/branches/dev/kumudb/src/binding/cxx/buildiface (revision 4870)
@@ -409,6 +409,5 @@
 #		    'Create_keyval' => 'int',
 		    'Free_keyval' =>  'static:0:1',
-# this routine is special and cannot be auto-generated
-#		    'Call_errhandler' => 0,
+		    'Call_errhandler' => 0,
 		    'Set_name' => '0:2',
 		    'Get_name' => '0:3',
@@ -530,6 +529,5 @@
 		   'Get_errhandler' => 'MPI_Errhandler',
 		   'Set_errhandler' => 0,
-                   # this routine is special and cannot be autogenerated
- 		   #'Call_errhandler' => 0,
+ 		   'Call_errhandler' => 0,
 		   );		
 #     %class_mpi2file = ( 
@@ -595,6 +593,5 @@
 		    'Fence' => '0', 
 		    'Get_group' => 'MPI_Group',
-                    # this routine is special and cannot be auto-generated
-		    #'Call_errhandler' => 0,
+		    'Call_errhandler' => 0,
 		    'Get_attr' => '0',
 		    'Start' => '0',
@@ -1006,4 +1003,7 @@
     $defer_definition{"Join"}         = "Comm";
     $defer_definition{"Merge"}        = "Intercomm";
+    $defer_definition{"Call_errhandler"} = "Comm";
+    $defer_definition{"Call_errhandler"} = "File";
+    $defer_definition{"Call_errhandler"} = "Win";
 
     $dtype_Get_name_init = "    MPIR_CXX_InitDatatypeNames();";
@@ -3267,5 +3267,4 @@
     *(void **)attr_out = attr_in; return 0;} 
     static Errhandler Create_errhandler( Errhandler_fn * );
-    virtual void Call_errhandler( int errcode ) const;
 \n";
 }
@@ -3278,5 +3277,4 @@
 
     static Errhandler Create_errhandler( Errhandler_fn * );
-    virtual void Call_errhandler( int errcode ) const;
 \n";
 }
@@ -3289,5 +3287,4 @@
 
     static Errhandler Create_errhandler( Errhandler_fn * );
-    virtual void Call_errhandler( int errcode ) const;
 
     typedef int Copy_attr_function(const Win& oldwin, int win_keyval, void* extra_state, void* attribute_val_in, void* attribute_val_out, bool& flag); 
Index: /mpich2/branches/dev/kumudb/src/binding/f77/buildiface
===================================================================
--- /mpich2/branches/dev/kumudb/src/binding/f77/buildiface (revision 4624)
+++ /mpich2/branches/dev/kumudb/src/binding/f77/buildiface (revision 4870)
@@ -83,7 +83,15 @@
 # Fortran runtime.  Thus, we must check whether the values are initialized
 # before any use in any routine.
+#
+# Having said the above, however, if the environment (specifically, the
+# C and Fortran compilers) makes it easy for the C init routines to initialize
+# the Fortran environment, then we should make that easy.  This is indicated
+# by the CPP name HAVE_MPI_F_INIT_WORKS_WITH_C.  If that is defined, then
+# there is no lazy initialization of these values.
 $specialInitAdded = 0;
 $specialInitString = "\
-    if (MPIR_F_NeedInit){ mpirinitf_(); MPIR_F_NeedInit = 0; }";
+#ifndef HAVE_MPI_F_INIT_WORKS_WITH_C
+    if (MPIR_F_NeedInit){ mpirinitf_(); MPIR_F_NeedInit = 0; }
+#endif";
 
 # Process arguments
Index: /mpich2/branches/dev/kumudb/src/binding/f90/configure.in
===================================================================
--- /mpich2/branches/dev/kumudb/src/binding/f90/configure.in (revision 604)
+++ /mpich2/branches/dev/kumudb/src/binding/f90/configure.in (revision 4870)
@@ -65,6 +65,6 @@
 # Get the C compiler (needed for type_create_f90_xxx functions)
 PAC_PROG_CC
-dnl Set CFLAGS for enable strict if necessary
-PAC_CC_STRICT
+
+PAC_ARG_STRICT
 AC_C_CONST
 
Index: /mpich2/branches/dev/kumudb/src/pm/gforker/configure.in
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/gforker/configure.in (revision 604)
+++ /mpich2/branches/dev/kumudb/src/pm/gforker/configure.in (revision 4870)
@@ -86,6 +86,6 @@
 dnl Find a C compiler (choose gcc first)
 AC_PROG_CC
-dnl Set CFLAGS for enable strict if necessary
-PAC_CC_STRICT
+
+PAC_ARG_STRICT
 AC_PROG_INSTALL
 PAC_PROG_CHECK_INSTALL_WORKS
Index: /mpich2/branches/dev/kumudb/src/pm/smpd/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/smpd/Makefile.sm (revision 4586)
+++ /mpich2/branches/dev/kumudb/src/pm/smpd/Makefile.sm (revision 4870)
@@ -6,5 +6,5 @@
  smpd_handle_command.c smpd_session.c smpd_start_mgr.c smpd_barrier.c \
  smpd_do_console.c smpd_restart.c smpd_host_util.c smpd_handle_spawn.c
-win_sources = smpd_job.c smpd_mapdrive.c smpd_register.c smpd_ad.cpp
+win_sources = smpd_job.c smpd_mapdrive.c smpd_register.c smpd_ad.cpp smpd_affinitize.c
 #mpiexec_SOURCES = mpiexec.c mp_parse_command_line.c
 #smpd_SOURCES = smpd.c smpd_cmd_args.c smpd_watchprocs.c
Index: /mpich2/branches/dev/kumudb/src/pm/smpd/smpd_affinitize.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/smpd/smpd_affinitize.c (revision 4870)
+++ /mpich2/branches/dev/kumudb/src/pm/smpd/smpd_affinitize.c (revision 4870)
@@ -0,0 +1,331 @@
+#include "smpd.h"
+#include <stdlib.h>
+
+#define MAX_PROCESSORS (sizeof(DWORD_PTR) * 8)
+
+/*
+    The relative priorities of system resources.  Small non-negative values
+    are considered more important (i.e. higher priority).
+*/
+typedef int priority_t;
+static const priority_t prioUnused    =-1;
+static const priority_t prioCacheBase = 1;  /* L1 cache will have priority Base+1, etc. */
+static const priority_t prioPackage   = 1000;
+static const priority_t prioNuma      = 1001;
+
+/*
+    An entry in the processor information priority table.  Each entry contains 
+    the priority of a given system resource type (e.g. L1 cache, L2 cache, etc.)
+    along with a list of all resources of that type.  For each resource, the set
+    of processes sharing that resouce is stored in the list.
+*/
+
+typedef struct
+{
+    priority_t priority;
+    int nResources;
+    struct
+    {
+        DWORD_PTR ProcessorMask;
+        int UsageCount;
+    } resources[MAX_PROCESSORS];
+} ResourceTableEntry;
+
+
+static unsigned int s_affinity_idx = 0;
+static unsigned int s_affinity_max = 0;
+static DWORD_PTR s_affinity_table[MAX_PROCESSORS];
+
+DWORD_PTR smpd_get_next_process_affinity_mask()
+{
+    DWORD_PTR Mask;
+    if (s_affinity_max == 0)
+        return 0;
+
+    Mask = s_affinity_table[s_affinity_idx % s_affinity_max];
+    s_affinity_idx++;
+    return Mask;
+}
+
+
+static inline LONG_PTR lowest_bit(LONG_PTR x)
+{
+    return (x & -x);
+}
+
+static inline BOOL one_bit_set(LONG_PTR x)
+{
+    return ( x == lowest_bit(x) );
+}
+
+
+static inline priority_t get_relationship_priority(SYSTEM_LOGICAL_PROCESSOR_INFORMATION* pInfo)
+{
+    switch (pInfo->Relationship)
+    {
+        case RelationProcessorCore :
+            return prioUnused;
+
+        /* FIXME: Is this defined for win32 ?
+    	case RelationProcessorPackage :
+            return prioPackage;
+        */
+
+    	case RelationCache :
+    	{
+            switch (pInfo->Cache.Type)
+            {
+                case CacheUnified:
+                case CacheData:
+                    return prioCacheBase + pInfo->Cache.Level;
+                    
+                case CacheInstruction:
+                case CacheTrace:
+                    return prioUnused;
+
+                default:
+                    return prioUnused;
+            }
+    	}
+
+    	case RelationNumaNode :
+            return prioNuma;
+                	
+    	default:
+            return prioUnused;
+    }
+}
+
+
+/*
+    This function is used to sort the array of SYSTEM_LOGICAL_PROCESSOR_INFORMATION
+    by relationship priority (from highest to lowest importance).
+*/
+static int __cdecl compare_proc_info(const void *p1, const void *p2)
+{
+    SYSTEM_LOGICAL_PROCESSOR_INFORMATION* pInfo1;
+    SYSTEM_LOGICAL_PROCESSOR_INFORMATION* pInfo2;
+    int prio1, prio2;
+    DWORD_PTR mask1, mask2;
+
+    pInfo1 = (SYSTEM_LOGICAL_PROCESSOR_INFORMATION*) p1;
+    pInfo2 = (SYSTEM_LOGICAL_PROCESSOR_INFORMATION*) p2;
+    
+    prio1 = get_relationship_priority(pInfo1);
+    prio2 = get_relationship_priority(pInfo2);
+
+    if (prio1 < prio2)
+        return -1;
+    if (prio1 > prio2)
+        return 1;
+
+    mask1 = pInfo1->ProcessorMask;
+    mask2 = pInfo2->ProcessorMask;
+
+    return mask1 < mask2 ? -1 : (mask1 > mask2 ? 1 : 0);
+}
+
+
+/*
+    Group resources types by priority in the resource table.
+
+    PRECONDITION: pInfo must be sorted according to the compare_proc_info function above
+*/
+static int init_resource_table(SYSTEM_LOGICAL_PROCESSOR_INFORMATION* pInfo, int count, ResourceTableEntry *pTable)
+{
+    int nTableEntries = 0, i=0, j=0, k=0;
+    priority_t prevPrio = prioUnused;
+    DWORD_PTR EntryMask = 0;
+
+    for (i=0; i<count; i++)
+    {
+        priority_t prio = get_relationship_priority(&pInfo[i]);
+        if (prio == prioUnused)
+            continue;
+
+        SMPDU_Assert(prio >= prevPrio);
+        if (prio != prevPrio)
+        {
+            pTable[nTableEntries].priority = prio;
+            pTable[nTableEntries].nResources = 0;
+            EntryMask = 0;
+            nTableEntries++;
+        }
+
+        SMPDU_Assert( ( EntryMask & pInfo[i].ProcessorMask ) == 0);
+        EntryMask |= pInfo[i].ProcessorMask;
+
+        j = nTableEntries - 1;
+        k = pTable[j].nResources;
+        pTable[j].resources[k].ProcessorMask = pInfo[i].ProcessorMask;
+        pTable[j].resources[k].UsageCount = 0;
+        pTable[j].nResources++;
+
+        prevPrio = prio;
+    }
+
+    return nTableEntries;
+}
+
+
+static DWORD_PTR get_min_usage_mask(DWORD_PTR CandidateMask, ResourceTableEntry *pEntry)
+{
+    /*
+        From among the currently remaining set of candidates, find all processors that map 
+        to one of the least heavily used resources of the current type.  If no candidate 
+        processor maps onto a resource of the current type, zero is returned.
+    */
+    int minUsageCount = INT_MAX, j=0;
+    DWORD_PTR minUsageMask = 0;
+    for (j=0; j<pEntry->nResources; j++)
+    {
+        if ( (pEntry->resources[j].ProcessorMask & CandidateMask) != 0)
+        {
+            if (pEntry->resources[j].UsageCount < minUsageCount)
+            {
+                minUsageMask  = pEntry->resources[j].ProcessorMask;
+                minUsageCount = pEntry->resources[j].UsageCount;
+            }
+            else if (pEntry->resources[j].UsageCount == minUsageCount)
+            {
+                minUsageMask |= pEntry->resources[j].ProcessorMask;
+            }
+        }
+    }
+    return minUsageMask;
+}
+
+
+static DWORD_PTR get_least_used_processor_bit(DWORD_PTR CandidateMask, ResourceTableEntry *pTable, int nTableEntries)
+{
+    int i=0;
+    for (i=0; i<nTableEntries && !one_bit_set(CandidateMask); i++)
+    {
+        DWORD_PTR minUsageMask = get_min_usage_mask(CandidateMask, &pTable[i]);
+
+        /*
+            Information about this resource type is unavailable for the remaining candidate processors.
+            However, it may be available for the next, lower-priority resource type, so move on.
+        */
+        if (minUsageMask == 0)
+            continue;
+
+        /*
+            Update the candidate set only to include the processors mapping to the least-used resources.
+            Move on to the next, lower-priority resource type.
+        */
+        CandidateMask &= minUsageMask;
+        SMPDU_Assert(CandidateMask != 0);
+    }
+
+    /*
+        Return the mask for only one processor, in case more than one candidate remains.
+    */
+    return lowest_bit(CandidateMask);
+}
+
+
+static void update_usage_counts(DWORD_PTR AssignMask, ResourceTableEntry *pTable, int nTableEntries)
+{
+    int i=0, j=0;
+    for (i=0; i<nTableEntries; i++)
+    {
+        for (j=0; j<pTable[i].nResources; j++)
+        {
+            if ( (pTable[i].resources[j].ProcessorMask & AssignMask) != 0 )
+            {
+                pTable[i].resources[j].UsageCount++;
+                break;
+            }
+        }
+    }
+}
+
+/*
+    This function initilizes the affinity table.  The processor assignments to processes 
+    are distributed so as to balance the use of system resources.
+*/
+void smpd_init_affinity_table()
+{
+    /*
+        Get this process affinity mask (the system mask is unused)
+    */
+    int count, nTableEntries;
+    BOOL fSucc;
+    DWORD Length;
+    DWORD_PTR SystemMask, ReserveMask, PrimaryMask;
+    DWORD_PTR UsableProcessorMask;
+    SYSTEM_LOGICAL_PROCESSOR_INFORMATION* pInfo = NULL;
+    ResourceTableEntry* pTable = NULL;
+
+    fSucc = GetProcessAffinityMask(GetCurrentProcess(), &UsableProcessorMask, &SystemMask);
+    if(!fSucc)
+        return;
+
+    /*
+        Retrieve the length required to store the processor information data
+    */
+    Length = 0;
+    /* FIXME: Check return val */
+    GetLogicalProcessorInformation(NULL, &Length);
+    if(Length == 0)
+        return;
+
+    /*
+        Allocate the processor information buffer
+    */
+    pInfo = (SYSTEM_LOGICAL_PROCESSOR_INFORMATION*) malloc(Length);
+    if(pInfo == NULL)
+        return;
+
+    /*
+        Query for the processors information
+    */
+    fSucc = GetLogicalProcessorInformation(pInfo, &Length);
+    if(!fSucc)
+        goto fn_exit;
+    
+    count = Length / sizeof(SYSTEM_LOGICAL_PROCESSOR_INFORMATION);
+
+    /*
+        Sort the processor data in order of priority, from most to least important.
+    */
+    qsort(pInfo, count, sizeof(SYSTEM_LOGICAL_PROCESSOR_INFORMATION), compare_proc_info);
+
+    pTable = (ResourceTableEntry*) malloc(count * sizeof(ResourceTableEntry));
+    if (pTable == NULL)
+        goto fn_exit;
+
+    /*
+        Initialize resource table from the sorted PROCESSOR_INFORMATION array
+    */
+    nTableEntries = init_resource_table(pInfo, count, pTable);
+
+    /*
+        Reserve CPU zero.  We will not assigned a reserved processor to a process unless all other
+        processors are already busy.  We can generalize this code to reserve other processors.
+    */
+    ReserveMask = 0x1;
+    ReserveMask &= UsableProcessorMask;
+
+    /*
+        First assign all primary processors, then all the reserve processors.
+    */
+    PrimaryMask = ( UsableProcessorMask & ~ReserveMask );
+    while ( (PrimaryMask | ReserveMask) != 0)
+    {
+        DWORD_PTR AssignMask;
+        DWORD_PTR* pRemainMask = ( PrimaryMask != 0 ? &PrimaryMask : &ReserveMask );
+        AssignMask = get_least_used_processor_bit(*pRemainMask, pTable, nTableEntries);
+        update_usage_counts(AssignMask, pTable, nTableEntries);
+
+        s_affinity_table[s_affinity_max] = AssignMask;
+        s_affinity_max++;
+        *pRemainMask &= ~AssignMask;
+    }
+
+    free(pTable);
+fn_exit:
+    free(pInfo);
+}
+
Index: /mpich2/branches/dev/kumudb/src/pm/smpd/smpd_handle_command.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/smpd/smpd_handle_command.c (revision 4502)
+++ /mpich2/branches/dev/kumudb/src/pm/smpd/smpd_handle_command.c (revision 4870)
@@ -735,4 +735,15 @@
 	    goto launch_failure;
 	}
+#ifdef HAVE_WINDOWS_H
+    if(smpd_process.set_affinity)
+    {
+        result = smpd_add_command_int_arg(cmd_ptr, "af", 1);
+        if(result != SMPD_SUCCESS)
+        {
+            smpd_err_printf("Unable to add the affinity flag to the launch command\n");
+            goto launch_failure;
+        }
+    }
+#endif
 	if (launch_node_ptr->priority_class != SMPD_DEFAULT_PRIORITY_CLASS)
 	{
@@ -2251,4 +2262,7 @@
     MPIU_Str_get_int_arg(cmd->cmd, "pc", &priority_class);
     MPIU_Str_get_int_arg(cmd->cmd, "pt", &priority_thread);
+#ifdef HAVE_WINDOWS_H
+    MPIU_Str_get_int_arg(cmd->cmd, "af", &smpd_process.set_affinity);
+#endif
     /* parse the -m drive mapping options */
     nmaps = 0;
Index: /mpich2/branches/dev/kumudb/src/pm/smpd/smpd_connect.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/smpd/smpd_connect.c (revision 4502)
+++ /mpich2/branches/dev/kumudb/src/pm/smpd/smpd_connect.c (revision 4870)
@@ -98,4 +98,7 @@
       0,                /* nproc_exited           */
       SMPD_FALSE,       /* verbose                */
+#ifdef HAVE_WINDOWS_H
+      SMPD_FALSE,       /* set_affinity             */
+#endif
       /*SMPD_FALSE,*/       /* shutdown               */
       /*SMPD_FALSE,*/       /* restart                */
Index: /mpich2/branches/dev/kumudb/src/pm/smpd/smpd_cmd_args.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/smpd/smpd_cmd_args.c (revision 4502)
+++ /mpich2/branches/dev/kumudb/src/pm/smpd/smpd_cmd_args.c (revision 4870)
@@ -443,4 +443,8 @@
 	    smpd_dbg_printf("unable to set the ctrl handler for the smpd manager, error %d.\n", result);
 	}
+#ifdef HAVE_WINDOWS_H
+    /* FIXME: smpd_init_affinity_table() Does not return error codes if it fails */
+    smpd_init_affinity_table();
+#endif
 
 	smpd_process.bService = SMPD_FALSE;
Index: /mpich2/branches/dev/kumudb/src/pm/smpd/smpd.h
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/smpd/smpd.h (revision 4502)
+++ /mpich2/branches/dev/kumudb/src/pm/smpd/smpd.h (revision 4870)
@@ -703,4 +703,7 @@
     int nproc, nproc_launched, nproc_exited;
     SMPD_BOOL verbose;
+#ifdef HAVE_WINDOWS_H
+    SMPD_BOOL set_affinity;
+#endif
     /*SMPD_BOOL shutdown, restart, validate, do_status;*/ /* built in commands */
     smpd_builtin_commands_t builtin_cmd;
@@ -968,4 +971,9 @@
 int smpd_handle_delayed_spawn_command(void);
 
+#ifdef HAVE_WINDOWS_H
+    DWORD_PTR smpd_get_next_process_affinity_mask(void );
+    void smpd_init_affinity_table(void );
+#endif
+
 #if defined(__cplusplus)
 }
Index: /mpich2/branches/dev/kumudb/src/pm/smpd/mp_parse_command_line.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/smpd/mp_parse_command_line.c (revision 4502)
+++ /mpich2/branches/dev/kumudb/src/pm/smpd/mp_parse_command_line.c (revision 4870)
@@ -101,4 +101,7 @@
     printf("  launch on the specified hosts\n");
     printf("  In the second version the number of processes = m1 + m2 + ... + mn\n");
+    printf("-binding proc_binding_scheme\n");
+    printf("  Set the proc nbinding for each of the launched processes to a single core.\n");
+    printf("  Currently only \"auto\" is supported as the proc_binding_scheme \n"); 
     printf("-map drive:\\\\host\\share\n");
     printf("  map a drive on all the nodes\n");
@@ -1013,4 +1016,20 @@
 		num_args_to_strip = 2;
 	    }
+#ifdef HAVE_WINDOWS_H
+        else if (strcmp(&(*argvp)[1][1], "binding") == 0)
+        {
+            if(strcmp(&(*argvp)[2][0], "auto") == 0)
+            {
+                smpd_process.set_affinity = TRUE;
+            }
+            else
+            {
+                printf("Error: Only process binding scheme supported is \"auto\"\n");
+                smpd_exit_fn(FCNAME);
+                return SMPD_FAIL;
+            }
+            num_args_to_strip = 2;
+        }
+#endif
 	    else if (strcmp(&(*argvp)[1][1], "map") == 0)
 	    {
Index: /mpich2/branches/dev/kumudb/src/pm/smpd/smpd_util.vcproj
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/smpd/smpd_util.vcproj (revision 4502)
+++ /mpich2/branches/dev/kumudb/src/pm/smpd/smpd_util.vcproj (revision 4870)
@@ -1022,4 +1022,8 @@
 			</File>
 			<File
+				RelativePath=".\smpd_affinitize.c"
+				>
+			</File>
+			<File
 				RelativePath="smpd_authenticate.c"
 				>
Index: /mpich2/branches/dev/kumudb/src/pm/smpd/smpd_launch_process.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/smpd/smpd_launch_process.c (revision 4506)
+++ /mpich2/branches/dev/kumudb/src/pm/smpd/smpd_launch_process.c (revision 4870)
@@ -1286,4 +1286,18 @@
 	bSuccess = FALSE;
     }
+
+#ifdef HAVE_WINDOWS_H
+    if(smpd_process.set_affinity)
+    {
+        ULONG_PTR mask = smpd_get_next_process_affinity_mask();
+        if(mask != NULL)
+        {
+            /* FIXME: The return vals of these functions are not checked ! */
+            smpd_dbg_printf("Setting the process/thread affinity (mask=%ul)\n", mask);
+            SetProcessAffinityMask(psInfo.hProcess, mask);
+            SetThreadAffinityMask(psInfo.hThread, mask);
+        }
+    }
+#endif
 
     FreeEnvironmentStrings((TCHAR*)pEnv);
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/utils/sock/Makefile.mk
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/utils/sock/Makefile.mk (revision 4870)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/utils/sock/Makefile.mk (revision 4870)
@@ -0,0 +1,7 @@
+# -*- Mode: Makefile; -*-
+#
+# (C) 2008 by Argonne National Laboratory.
+#     See COPYRIGHT in top-level directory.
+#
+
+libhydra_a_SOURCES += $(top_srcdir)/utils/sock/sock.c
Index: /ich2/branches/dev/kumudb/src/pm/hydra/utils/sock/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/utils/sock/Makefile.sm (revision 4726)
+++  (revision )
@@ -1,14 +1,0 @@
-# -*- Mode: Makefile; -*-
-#
-# (C) 2008 by Argonne National Laboratory.
-#     See COPYRIGHT in top-level directory.
-#
-
-HYDRA_LIB_PATH = ../../lib
-
-libhydra_a_DIR = ${HYDRA_LIB_PATH}
-libhydra_a_SOURCES = sock.c
-INCLUDES = -I${abs_srcdir}/../../include \
-	-I../../include \
-	-I${abs_srcdir}/../../mpl/include \
-	-I../../mpl/include
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/utils/signals/Makefile.mk
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/utils/signals/Makefile.mk (revision 4870)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/utils/signals/Makefile.mk (revision 4870)
@@ -0,0 +1,7 @@
+# -*- Mode: Makefile; -*-
+#
+# (C) 2008 by Argonne National Laboratory.
+#     See COPYRIGHT in top-level directory.
+#
+
+libhydra_a_SOURCES += $(top_srcdir)/utils/signals/signals.c
Index: /ich2/branches/dev/kumudb/src/pm/hydra/utils/signals/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/utils/signals/Makefile.sm (revision 4726)
+++  (revision )
@@ -1,14 +1,0 @@
-# -*- Mode: Makefile; -*-
-#
-# (C) 2008 by Argonne National Laboratory.
-#     See COPYRIGHT in top-level directory.
-#
-
-HYDRA_LIB_PATH = ../../lib
-
-libhydra_a_DIR = ${HYDRA_LIB_PATH}
-libhydra_a_SOURCES = signals.c
-INCLUDES = -I${abs_srcdir}/../../include \
-	-I../../include \
-	-I${abs_srcdir}/../../mpl/include \
-	-I../../mpl/include
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/utils/timer/Makefile.mk
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/utils/timer/Makefile.mk (revision 4870)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/utils/timer/Makefile.mk (revision 4870)
@@ -0,0 +1,7 @@
+# -*- Mode: Makefile; -*-
+#
+# (C) 2008 by Argonne National Laboratory.
+#     See COPYRIGHT in top-level directory.
+#
+
+libhydra_a_SOURCES += $(top_srcdir)/utils/timer/timer.c
Index: /ich2/branches/dev/kumudb/src/pm/hydra/utils/timer/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/utils/timer/Makefile.sm (revision 4726)
+++  (revision )
@@ -1,14 +1,0 @@
-# -*- Mode: Makefile; -*-
-#
-# (C) 2008 by Argonne National Laboratory.
-#     See COPYRIGHT in top-level directory.
-#
-
-HYDRA_LIB_PATH = ../../lib
-
-libhydra_a_DIR = ${HYDRA_LIB_PATH}
-libhydra_a_SOURCES = timer.c
-INCLUDES = -I${abs_srcdir}/../../include \
-	-I../../include \
-	-I${abs_srcdir}/../../mpl/include \
-	-I../../mpl/include
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/utils/Makefile.mk
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/utils/Makefile.mk (revision 4870)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/utils/Makefile.mk (revision 4870)
@@ -0,0 +1,19 @@
+# -*- Mode: Makefile; -*-
+#
+# (C) 2008 by Argonne National Laboratory.
+#     See COPYRIGHT in top-level directory.
+#
+
+include utils/args/Makefile.mk
+include utils/dbg/Makefile.mk
+include utils/env/Makefile.mk
+include utils/launch/Makefile.mk
+include utils/signals/Makefile.mk
+include utils/sock/Makefile.mk
+include utils/string/Makefile.mk
+include utils/timer/Makefile.mk
+
+if hydra_procbind
+include utils/bind/Makefile.mk
+include utils/plpa/Makefile.mk
+endif
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/utils/string/Makefile.mk
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/utils/string/Makefile.mk (revision 4870)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/utils/string/Makefile.mk (revision 4870)
@@ -0,0 +1,7 @@
+# -*- Mode: Makefile; -*-
+#
+# (C) 2008 by Argonne National Laboratory.
+#     See COPYRIGHT in top-level directory.
+#
+
+libhydra_a_SOURCES += $(top_srcdir)/utils/string/string.c
Index: /ich2/branches/dev/kumudb/src/pm/hydra/utils/string/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/utils/string/Makefile.sm (revision 4726)
+++  (revision )
@@ -1,14 +1,0 @@
-# -*- Mode: Makefile; -*-
-#
-# (C) 2008 by Argonne National Laboratory.
-#     See COPYRIGHT in top-level directory.
-#
-
-HYDRA_LIB_PATH = ../../lib
-
-libhydra_a_DIR = ${HYDRA_LIB_PATH}
-libhydra_a_SOURCES = string.c
-INCLUDES = -I${abs_srcdir}/../../include \
-	-I../../include \
-	-I${abs_srcdir}/../../mpl/include \
-	-I../../mpl/include
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/utils/env/Makefile.mk
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/utils/env/Makefile.mk (revision 4870)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/utils/env/Makefile.mk (revision 4870)
@@ -0,0 +1,7 @@
+# -*- Mode: Makefile; -*-
+#
+# (C) 2008 by Argonne National Laboratory.
+#     See COPYRIGHT in top-level directory.
+#
+
+libhydra_a_SOURCES += $(top_srcdir)/utils/env/env.c
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/utils/env/env.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/utils/env/env.c (revision 4519)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/utils/env/env.c (revision 4870)
@@ -115,5 +115,5 @@
 
 
-HYD_Status HYDU_list_global_env(HYD_Env_t ** env_list)
+HYD_Status HYDU_list_inherited_env(HYD_Env_t ** env_list)
 {
     HYD_Env_t *env;
@@ -309,5 +309,5 @@
 
 
-HYD_Status HYDU_putenv(HYD_Env_t * env)
+HYD_Status HYDU_putenv(HYD_Env_t * env, HYD_Env_overwrite_t overwrite)
 {
     char *tmp[HYD_NUM_TMP_STRINGS], *str;
@@ -316,4 +316,8 @@
 
     HYDU_FUNC_ENTER();
+
+    /* If the overwrite flag is false, just exit */
+    if (getenv(env->env_name) && (overwrite == HYD_ENV_OVERWRITE_FALSE))
+        goto fn_exit;
 
     i = 0;
@@ -339,5 +343,5 @@
 
 
-HYD_Status HYDU_putenv_list(HYD_Env_t * env_list)
+HYD_Status HYDU_putenv_list(HYD_Env_t * env_list, HYD_Env_overwrite_t overwrite)
 {
     HYD_Env_t *env;
@@ -347,5 +351,5 @@
 
     for (env = env_list; env; env = env->next) {
-        status = HYDU_putenv(env);
+        status = HYDU_putenv(env, overwrite);
         HYDU_ERR_POP(status, "putenv failed\n");
     }
Index: /ich2/branches/dev/kumudb/src/pm/hydra/utils/env/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/utils/env/Makefile.sm (revision 4726)
+++  (revision )
@@ -1,14 +1,0 @@
-# -*- Mode: Makefile; -*-
-#
-# (C) 2008 by Argonne National Laboratory.
-#     See COPYRIGHT in top-level directory.
-#
-
-HYDRA_LIB_PATH = ../../lib
-
-libhydra_a_DIR = ${HYDRA_LIB_PATH}
-libhydra_a_SOURCES = env.c
-INCLUDES = -I${abs_srcdir}/../../include \
-	-I../../include \
-	-I${abs_srcdir}/../../mpl/include \
-	-I../../mpl/include
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/utils/launch/Makefile.mk
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/utils/launch/Makefile.mk (revision 4870)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/utils/launch/Makefile.mk (revision 4870)
@@ -0,0 +1,8 @@
+# -*- Mode: Makefile; -*-
+#
+# (C) 2008 by Argonne National Laboratory.
+#     See COPYRIGHT in top-level directory.
+#
+
+libhydra_a_SOURCES += $(top_srcdir)/utils/launch/allocate.c \
+	$(top_srcdir)/utils/launch/launch.c
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/utils/launch/allocate.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/utils/launch/allocate.c (revision 4556)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/utils/launch/allocate.c (revision 4870)
@@ -22,5 +22,5 @@
     (*base)->partition_id = partition_id++;
     (*base)->active = 0;
-    (*base)->exec_args[0] = NULL;
+    (*base)->exec_args = NULL;
 
     (*base)->next = NULL;
@@ -37,5 +37,8 @@
     if (base->name)
         HYDU_FREE(base->name);
-    HYDU_free_strlist(base->exec_args);
+    if (base->exec_args) {
+        HYDU_free_strlist(base->exec_args);
+        HYDU_FREE(base->exec_args);
+    }
 
     HYDU_FREE(base);
@@ -82,5 +85,4 @@
     (*exec_info)->user_env = NULL;
     (*exec_info)->prop = HYD_ENV_PROP_UNSET;
-    (*exec_info)->prop_env = NULL;
     (*exec_info)->next = NULL;
 
@@ -107,7 +109,4 @@
         HYDU_env_free_list(exec_info->user_env);
         exec_info->user_env = NULL;
-
-        HYDU_env_free_list(exec_info->prop_env);
-        exec_info->prop_env = NULL;
 
         HYDU_FREE(exec_info);
@@ -154,6 +153,6 @@
             texec = exec->next;
             HYDU_free_strlist(exec->exec);
-            if (exec->prop_env)
-                HYDU_env_free(exec->prop_env);
+            if (exec->user_env)
+                HYDU_env_free(exec->user_env);
             HYDU_FREE(exec);
             exec = texec;
@@ -372,5 +371,5 @@
     (*exec)->proc_count = 0;
     (*exec)->prop = HYD_ENV_PROP_UNSET;
-    (*exec)->prop_env = NULL;
+    (*exec)->user_env = NULL;
     (*exec)->next = NULL;
 
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/utils/launch/launch.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/utils/launch/launch.c (revision 4631)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/utils/launch/launch.c (revision 4870)
@@ -55,16 +55,21 @@
 
         if (env_list) {
-            status = HYDU_putenv_list(env_list);
+            status = HYDU_putenv_list(env_list, HYD_ENV_OVERWRITE_FALSE);
             HYDU_ERR_POP(status, "unable to putenv\n");
         }
 
+#if defined HAVE_PROC_BINDING
         if (core >= 0) {
             status = HYDU_bind_process(core);
             HYDU_ERR_POP(status, "bind process failed\n");
         }
+#endif /* HAVE_PROC_BINDING */
 
         if (execvp(client_arg[0], client_arg) < 0) {
-            HYDU_ERR_SETANDJUMP1(status, HYD_INTERNAL_ERROR, "execvp error (%s)\n",
-                                 HYDU_strerror(errno));
+            /* The child process should never get back to the proxy
+             * code; if there is an error, just throw it here and
+             * exit. */
+            printf("execvp error on file %s (%s)\n", client_arg[0], HYDU_strerror(errno));
+            exit(-1);
         }
     }
@@ -110,8 +115,10 @@
         close(2);
 
+#if defined HAVE_PROC_BINDING
         if (core >= 0) {
             status = HYDU_bind_process(core);
             HYDU_ERR_POP(status, "bind process failed\n");
         }
+#endif /* HAVE_PROC_BINDING */
     }
     else {      /* Parent process */
@@ -123,6 +130,8 @@
     return status;
 
-  fn_fail:
-    goto fn_exit;
+#if defined HAVE_PROC_BINDING
+  fn_fail:
+    goto fn_exit;
+#endif /* HAVE_PROC_BINDING */
 }
 
Index: /ich2/branches/dev/kumudb/src/pm/hydra/utils/launch/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/utils/launch/Makefile.sm (revision 4726)
+++  (revision )
@@ -1,14 +1,0 @@
-# -*- Mode: Makefile; -*-
-#
-# (C) 2008 by Argonne National Laboratory.
-#     See COPYRIGHT in top-level directory.
-#
-
-HYDRA_LIB_PATH = ../../lib
-
-libhydra_a_DIR = ${HYDRA_LIB_PATH}
-libhydra_a_SOURCES = allocate.c launch.c
-INCLUDES = -I${abs_srcdir}/../../include \
-	-I../../include \
-	-I${abs_srcdir}/../../mpl/include \
-	-I../../mpl/include
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/utils/args/Makefile.mk
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/utils/args/Makefile.mk (revision 4870)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/utils/args/Makefile.mk (revision 4870)
@@ -0,0 +1,7 @@
+# -*- Mode: Makefile; -*-
+#
+# (C) 2008 by Argonne National Laboratory.
+#     See COPYRIGHT in top-level directory.
+#
+
+libhydra_a_SOURCES += $(top_srcdir)/utils/args/args.c
Index: /ich2/branches/dev/kumudb/src/pm/hydra/utils/args/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/utils/args/Makefile.sm (revision 4726)
+++  (revision )
@@ -1,14 +1,0 @@
-# -*- Mode: Makefile; -*-
-#
-# (C) 2008 by Argonne National Laboratory.
-#     See COPYRIGHT in top-level directory.
-#
-
-HYDRA_LIB_PATH = ../../lib
-
-libhydra_a_DIR = ${HYDRA_LIB_PATH}
-libhydra_a_SOURCES = args.c
-INCLUDES = -I${abs_srcdir}/../../include \
-	-I../../include \
-	-I${abs_srcdir}/../../mpl/include \
-	-I../../mpl/include
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/utils/bind/Makefile.mk
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/utils/bind/Makefile.mk (revision 4870)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/utils/bind/Makefile.mk (revision 4870)
@@ -0,0 +1,7 @@
+# -*- Mode: Makefile; -*-
+#
+# (C) 2008 by Argonne National Laboratory.
+#     See COPYRIGHT in top-level directory.
+#
+
+libhydra_a_SOURCES += $(top_srcdir)/utils/bind/bind.c
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/utils/bind/bind.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/utils/bind/bind.c (revision 4616)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/utils/bind/bind.c (revision 4870)
@@ -99,5 +99,4 @@
                 break;
             bind_info.user_bind_map[i++] = atoi(str);
-            fflush(stdout);
             str = strtok(NULL, ",");
         } while (1);
Index: /ich2/branches/dev/kumudb/src/pm/hydra/utils/bind/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/utils/bind/Makefile.sm (revision 4726)
+++  (revision )
@@ -1,16 +1,0 @@
-# -*- Mode: Makefile; -*-
-#
-# (C) 2008 by Argonne National Laboratory.
-#     See COPYRIGHT in top-level directory.
-#
-
-HYDRA_LIB_PATH = ../../lib
-
-libhydra_a_DIR = ${HYDRA_LIB_PATH}
-libhydra_a_SOURCES = bind.c
-INCLUDES = -I${abs_srcdir}/../../include \
-	-I../../include \
-	-I${abs_srcdir}/../plpa \
-	-I../plpa \
-	-I${abs_srcdir}/../../mpl/include \
-	-I../../mpl/include
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/utils/dbg/Makefile.mk
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/utils/dbg/Makefile.mk (revision 4870)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/utils/dbg/Makefile.mk (revision 4870)
@@ -0,0 +1,7 @@
+# -*- Mode: Makefile; -*-
+#
+# (C) 2008 by Argonne National Laboratory.
+#     See COPYRIGHT in top-level directory.
+#
+
+libhydra_a_SOURCES += $(top_srcdir)/utils/dbg/dbg.c
Index: /ich2/branches/dev/kumudb/src/pm/hydra/utils/dbg/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/utils/dbg/Makefile.sm (revision 4726)
+++  (revision )
@@ -1,14 +1,0 @@
-# -*- Mode: Makefile; -*-
-#
-# (C) 2008 by Argonne National Laboratory.
-#     See COPYRIGHT in top-level directory.
-#
-
-HYDRA_LIB_PATH = ../../lib
-
-libhydra_a_DIR = ${HYDRA_LIB_PATH}
-libhydra_a_SOURCES = dbg.c
-INCLUDES = -I${abs_srcdir}/../../include \
-	-I../../include \
-	-I${abs_srcdir}/../../mpl/include \
-	-I../../mpl/include
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/utils/plpa/Makefile.mk
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/utils/plpa/Makefile.mk (revision 4870)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/utils/plpa/Makefile.mk (revision 4870)
@@ -0,0 +1,10 @@
+# -*- Mode: Makefile; -*-
+#
+# (C) 2008 by Argonne National Laboratory.
+#     See COPYRIGHT in top-level directory.
+#
+
+libhydra_a_SOURCES += $(top_srcdir)/utils/plpa/plpa_api_probe.c \
+	$(top_srcdir)/utils/plpa/plpa_dispatch.c \
+	$(top_srcdir)/utils/plpa/plpa_map.c \
+	$(top_srcdir)/utils/plpa/plpa_runtime.c
Index: /ich2/branches/dev/kumudb/src/pm/hydra/utils/plpa/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/utils/plpa/Makefile.sm (revision 4726)
+++  (revision )
@@ -1,16 +1,0 @@
-# -*- Mode: Makefile; -*-
-#
-# (C) 2008 by Argonne National Laboratory.
-#     See COPYRIGHT in top-level directory.
-#
-
-HYDRA_LIB_PATH = ../../lib
-
-libhydra_a_DIR = ${HYDRA_LIB_PATH}
-libhydra_a_SOURCES = plpa_api_probe.c plpa_dispatch.c plpa_map.c plpa_runtime.c
-INCLUDES = -I${abs_srcdir}/../../include \
-	-I../../include \
-	-I${abs_srcdir} \
-	-I. \
-	-I${abs_srcdir}/../../mpl/include \
-	-I../../mpl/include
Index: /ich2/branches/dev/kumudb/src/pm/hydra/utils/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/utils/Makefile.sm (revision 4192)
+++  (revision )
@@ -1,8 +1,0 @@
-# -*- Mode: Makefile; -*-
-#
-# (C) 2008 by Argonne National Laboratory.
-#     See COPYRIGHT in top-level directory.
-#
-
-SUBDIRS_opt_utils = plpa bind .
-SUBDIRS = args dbg env launch signals sock string timer @opt_utils@
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/demux/Makefile.mk
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/demux/Makefile.mk (revision 4870)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/demux/Makefile.mk (revision 4870)
@@ -0,0 +1,7 @@
+# -*- Mode: Makefile; -*-
+#
+# (C) 2008 by Argonne National Laboratory.
+#     See COPYRIGHT in top-level directory.
+#
+
+libhydra_a_SOURCES += $(top_srcdir)/demux/demux.c
Index: /ich2/branches/dev/kumudb/src/pm/hydra/demux/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/demux/Makefile.sm (revision 4726)
+++  (revision )
@@ -1,14 +1,0 @@
-# -*- Mode: Makefile; -*-
-#
-# (C) 2008 by Argonne National Laboratory.
-#     See COPYRIGHT in top-level directory.
-#
-
-HYDRA_LIB_PATH = ../lib
-
-libhydra_a_DIR = ${HYDRA_LIB_PATH}
-libhydra_a_SOURCES = demux.c
-INCLUDES = -I${abs_srcdir}/../include \
-	-I../include \
-	-I${abs_srcdir}/../mpl/include \
-	-I../mpl/include
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/include/hydra_base.h
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/include/hydra_base.h (revision 4631)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/include/hydra_base.h (revision 4870)
@@ -121,4 +121,9 @@
 } HYD_Env_t;
 
+typedef enum HYD_Env_overwrite {
+    HYD_ENV_OVERWRITE_TRUE,
+    HYD_ENV_OVERWRITE_FALSE
+} HYD_Env_overwrite_t;
+
 typedef enum {
     HYD_ENV_PROP_UNSET,
@@ -150,5 +155,5 @@
     int proc_count;
     HYD_Env_prop_t prop;
-    HYD_Env_t *prop_env;
+    HYD_Env_t *user_env;
 
     int pgid;                   /* All executables with the same PGID belong to the same
@@ -183,5 +188,5 @@
 struct HYD_Partition_base {
     char *name;
-    char *exec_args[HYD_NUM_TMP_STRINGS];       /* Full argument list */
+    char **exec_args;       /* Full argument list */
 
     int partition_id;
@@ -225,5 +230,4 @@
     HYD_Env_t *user_env;
     HYD_Env_prop_t prop;
-    HYD_Env_t *prop_env;
 
     struct HYD_Exec_info *next;
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/include/hydra.h
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/include/hydra.h (revision 4601)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/include/hydra.h (revision 4870)
@@ -35,9 +35,8 @@
 
     /* Global environment */
-    HYD_Env_t *global_env;
     HYD_Env_t *system_env;
     HYD_Env_t *user_env;
+    HYD_Env_t *inherited_env;
     HYD_Env_prop_t prop;
-    HYD_Env_t *prop_env;
 
      HYD_Status(*stdin_cb) (int fd, HYD_Event_t events, void *userp);
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/include/hydra_utils.h
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/include/hydra_utils.h (revision 4726)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/include/hydra_utils.h (revision 4870)
@@ -15,8 +15,20 @@
 #if !defined COMPILER_ACCEPTS_VA_ARGS
 #define HYDU_Error_printf HYDU_Error_printf_simple
-#elif defined COMPILER_ACCEPTS_FUNC && defined __LINE__
+#elif defined HAVE__FUNC__ && defined __LINE__
 #define HYDU_Error_printf(...)                            \
     {                                                     \
         fprintf(stderr, "%s (%d): ", __func__, __LINE__); \
+        HYDU_Error_printf_simple(__VA_ARGS__);            \
+    }
+#elif defined HAVE_CAP__FUNC__ && defined __LINE__
+#define HYDU_Error_printf(...)                            \
+    {                                                     \
+        fprintf(stderr, "%s (%d): ", __FUNC__, __LINE__); \
+        HYDU_Error_printf_simple(__VA_ARGS__);            \
+    }
+#elif defined HAVE__FUNCTION__ && defined __LINE__
+#define HYDU_Error_printf(...)                            \
+    {                                                     \
+        fprintf(stderr, "%s (%d): ", __FUNCTION__, __LINE__); \
         HYDU_Error_printf_simple(__VA_ARGS__);            \
     }
@@ -118,7 +130,4 @@
 #define HYDU_FUNC_ENTER() {}
 #define HYDU_FUNC_EXIT() {}
-#elif defined COMPILER_ACCEPTS_FUNC
-#define HYDU_FUNC_ENTER() {}
-#define HYDU_FUNC_EXIT() {}
 #else
 #define HYDU_FUNC_ENTER() {}
@@ -133,13 +142,9 @@
 
 /* bind */
-#if defined PROC_BINDING
+#if defined HAVE_PROC_BINDING
 HYD_Status HYDU_bind_init(char *user_bind_map);
 HYD_Status HYDU_bind_process(int core);
 int HYDU_bind_get_core_id(int id, HYD_Binding binding);
-#else
-#define HYDU_bind_init(...) HYD_SUCCESS
-#define HYDU_bind_process(...) HYD_SUCCESS
-#define HYDU_bind_get_core_id(...) (-1)
-#endif /* PROC_BINDING */
+#endif /* HAVE_PROC_BINDING */
 
 
@@ -147,5 +152,5 @@
 HYD_Env_t *HYDU_str_to_env(char *str);
 HYD_Status HYDU_list_append_env_to_str(HYD_Env_t * env_list, char **str_list);
-HYD_Status HYDU_list_global_env(HYD_Env_t ** env_list);
+HYD_Status HYDU_list_inherited_env(HYD_Env_t ** env_list);
 HYD_Env_t *HYDU_env_list_dup(HYD_Env_t * env);
 HYD_Status HYDU_env_create(HYD_Env_t ** env, char *env_name, char *env_value);
@@ -154,6 +159,6 @@
 HYD_Env_t *HYDU_env_lookup(HYD_Env_t env, HYD_Env_t * env_list);
 HYD_Status HYDU_append_env_to_list(HYD_Env_t env, HYD_Env_t ** env_list);
-HYD_Status HYDU_putenv(HYD_Env_t * env);
-HYD_Status HYDU_putenv_list(HYD_Env_t * env_list);
+HYD_Status HYDU_putenv(HYD_Env_t * env, HYD_Env_overwrite_t overwrite);
+HYD_Status HYDU_putenv_list(HYD_Env_t * env_list, HYD_Env_overwrite_t overwrite);
 HYD_Status HYDU_comma_list_to_env_list(char *str, HYD_Env_t ** env_list);
 
@@ -264,4 +269,17 @@
     }
 
+#define HYDU_STRLIST_CONSOLIDATE(strlist, i, status)                    \
+    {                                                                   \
+        char *out;                                                      \
+        if ((i) >= (HYD_NUM_TMP_STRINGS / 2)) {                         \
+            (strlist)[(i)] = NULL;                                      \
+            (status) = HYDU_str_alloc_and_join((strlist), &out);        \
+            HYDU_ERR_POP((status), "unable to join strings\n");         \
+            HYDU_free_strlist((strlist));                               \
+            strlist[0] = out;                                           \
+            (i) = 1;                                                    \
+        }                                                               \
+    }
+
 HYD_Status HYDU_list_append_strlist(char **exec, char **client_arg);
 HYD_Status HYDU_print_strlist(char **args);
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/configure.in
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/configure.in (revision 4825)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/configure.in (revision 4870)
@@ -5,27 +5,15 @@
 #
 
-dnl Caching is usually WRONG for systems with cross-mounted file systems
-dnl (the cache file may correspond to a different system).  Since configure
-dnl is not on a performance-critical path, go for robustness over speed.
-define([AC_CACHE_LOAD],)
-define([AC_CACHE_SAVE],)
-
-AC_INIT()
-
-dnl The MPICH2 top-level configure adds a bunch of flags to the
-dnl user-defined CFLAGS by processing different configure command-line
-dnl arguments (--enable-g, --enable-default-optimization). These updated
-dnl flags are passed down as a separate flag. Here, we don't care about
-dnl the user-defined flags, but rather this updated flags, so we just
-dnl overwrite CFLAGS with them.
+AC_INIT([Hydra], [0.1])
+AC_CONFIG_AUX_DIR(mpl/confdb)
+AM_INIT_AUTOMAKE([-Wall -Werror foreign 1.11])
+
+dnl When built as a subconfigure, pull in FLAGS from above
 PAC_SUBCONFIG_INIT()
 
 AC_CONFIG_HEADER(include/hydra_config.h)
 
-dnl Set the directory that contains support scripts such as install-sh and
-dnl config.guess
-AC_CONFIG_AUX_DIR(confdb)
-dnl
-echo "RUNNING CONFIGURE FOR THE HYDRA PM"
+# Check for special types
+AC_TYPE_SIZE_T
 
 dnl Bug in autoconf adds -O2 and -g by default. Make sure we only get
@@ -35,24 +23,32 @@
 CFLAGS=$save_cflags
 
-if test "$FROM_MPICH2" = "yes" ; then
-   AC_DEFINE(INSIDE_MPICH2,1,[Define if compiling within MPICH2])
-fi
+AM_PROG_MKDIR_P
+AC_PROG_RANLIB
+PAC_ARG_CACHING
+PAC_ARG_STRICT
+PAC_C_GNU_ATTRIBUTE
+PAC_CC_FUNCTION_NAME_SYMBOL
 
 dnl Check if the necessary headers are available
 AC_CHECK_HEADERS(unistd.h stdlib.h string.h strings.h stdarg.h sys/types.h sys/socket.h \
-		 sched.h pthread.h sys/stat.h)
-
-# Check for special types
-AC_TYPE_SIZE_T
-PAC_C_GNU_ATTRIBUTE
+		 sched.h pthread.h sys/stat.h sys/param.h netinet/in.h netinet/tcp.h \
+		 sys/un.h netdb.h)
+
+dnl Check if the pthread library is present. Apparently, just checking
+dnl for pthread.h is not sufficient.
+AC_CHECK_LIB(pthread,pthread_create,pthread_lib_exists=yes,pthread_lib_exists=no)
+
+dnl Check if the upper-level enabled threads support
+if test "$MPICH2_THREAD_PACKAGE" != "none" -a "$pthread_lib_exists" = "yes" ; then
+   AC_DEFINE(HAVE_THREAD_SUPPORT,1,[Define thread support])
+   LDFLAGS="$LDFLAGS -lpthread"
+fi
+
+AC_CHECK_LIB(socket,socket,LDFLAGS="$LDFLAGS -lsocket",)
+AC_CHECK_LIB(gethostbyname,nsl,LDFLAGS="$LDFLAGS -lnsl",)
 
 dnl Check for necessary functions
-AC_CHECK_FUNCS(gettimeofday time strdup sigaction signal usleep alloca snprintf unsetenv \
+AC_CHECK_FUNCS(gettimeofday time strdup sigaction signal usleep alloca unsetenv \
 	       strerror strsignal putenv)
-
-dnl Check if the upper-level enabled threads support
-if test "$MPICH2_THREAD_PACKAGE" != "none" ; then
-   AC_DEFINE(HAVE_THREAD_SUPPORT,1,[Define thread support])
-fi
 
 # putenv() sets environment variable
@@ -89,6 +85,11 @@
 hydra_bss_names="`echo $hydra_bss | sed -e 's/:/ /g' -e 's/,/ /g'`"
 AC_DEFINE_UNQUOTED(HYDRA_BSS_NAMES,"$hydra_bss_names",[Definition of enabled bootstrap servers])
+AM_SUBST_NOTMAKE(hydra_bss_names)
 AC_SUBST(hydra_bss_names)
 
+hydra_bss_ssh=false
+hydra_bss_rsh=false
+hydra_bss_fork=false
+hydra_bss_slurm=false
 for hydra_bss_name in ${hydra_bss_names}; do
     if test -z "${hydra_default_bss}" ; then
@@ -100,11 +101,36 @@
     hydra_bss_name_array="${hydra_bss_name_array} \"${hydra_bss_name}\", "
     hydra_bss_init_array="${hydra_bss_init_array} HYD_BSCI_${hydra_bss_name}_init, "
+
+    case "$hydra_bss_name" in
+    	ssh)
+		hydra_bss_ssh=true
+		;;		
+	rsh)
+		hydra_bss_rsh=true
+		;;
+	fork)
+		hydra_bss_fork=true
+		;;
+	slurm)
+		hydra_bss_slurm=true
+		;;
+	*)
+		;;
+    esac
+
 done
 hydra_bss_name_array="${hydra_bss_name_array} NULL"
 hydra_bss_init_array="${hydra_bss_init_array} NULL"
 AC_DEFINE_UNQUOTED(HYDRA_DEFAULT_BSS,"$hydra_default_bss",[Default bootstrap server])
+AM_SUBST_NOTMAKE(hydra_bss_init_decl)
+AM_SUBST_NOTMAKE(hydra_bss_name_array)
+AM_SUBST_NOTMAKE(hydra_bss_init_array)
 AC_SUBST(hydra_bss_init_decl)
 AC_SUBST(hydra_bss_name_array)
 AC_SUBST(hydra_bss_init_array)
+AM_CONDITIONAL([hydra_bss_ssh], [$hydra_bss_ssh])
+AM_CONDITIONAL([hydra_bss_rsh], [$hydra_bss_rsh])
+AM_CONDITIONAL([hydra_bss_fork], [$hydra_bss_fork])
+AM_CONDITIONAL([hydra_bss_slurm], [$hydra_bss_slurm])
 
 
@@ -117,6 +143,8 @@
 hydra_css_names="`echo $hydra_css | sed -e 's/:/ /g' -e 's/,/ /g'`"
 AC_DEFINE_UNQUOTED(HYDRA_CSS_NAMES,"$hydra_css_names",[Definition of enabled communication systems])
+AM_SUBST_NOTMAKE(hydra_css_names)
 AC_SUBST(hydra_css_names)
 
+hydra_css_none=false
 for hydra_css_name in ${hydra_css_names}; do
     if test -z "${hydra_default_css}" ; then
@@ -128,11 +156,24 @@
     hydra_css_name_array="${hydra_css_name_array} \"${hydra_css_name}\", "
     hydra_css_init_array="${hydra_css_init_array} HYD_CSSI_${hydra_css_name}_init, "
+
+    case "$hydra_css_name" in
+    	dummy)
+		hydra_css_none=true
+		;;		
+	*)
+		;;
+    esac
+
 done
 hydra_css_name_array="${hydra_css_name_array} NULL"
 hydra_css_init_array="${hydra_css_init_array} NULL"
 AC_DEFINE_UNQUOTED(HYDRA_DEFAULT_CSS,"$hydra_default_css",[Default communication sub-system])
+AM_SUBST_NOTMAKE(hydra_css_init_decl)
+AM_SUBST_NOTMAKE(hydra_css_name_array)
+AM_SUBST_NOTMAKE(hydra_css_init_array)
 AC_SUBST(hydra_css_init_decl)
 AC_SUBST(hydra_css_name_array)
 AC_SUBST(hydra_css_init_array)
+AM_CONDITIONAL([hydra_css_none], [$hydra_css_none])
 
 
@@ -145,6 +186,8 @@
 hydra_rmk_names="`echo $hydra_rmk | sed -e 's/:/ /g' -e 's/,/ /g'`"
 AC_DEFINE_UNQUOTED(HYDRA_RMK_NAMES,"$hydra_rmk_names",[Enabled resource management kernels])
+AM_SUBST_NOTMAKE(hydra_rmk_names)
 AC_SUBST(hydra_rmk_names)
 
+hydra_rmk_dummy=false
 for hydra_rmk_name in ${hydra_rmk_names}; do
     if test -z "${hydra_default_rmk}" ; then
@@ -156,11 +199,24 @@
     hydra_rmk_name_array="${hydra_rmk_name_array} \"${hydra_rmk_name}\", "
     hydra_rmk_init_array="${hydra_rmk_init_array} HYD_RMKI_${hydra_rmk_name}_init, "
+
+    case "$hydra_rmk_name" in
+    	dummy)
+		hydra_rmk_dummy=true
+		;;		
+	*)
+		;;
+    esac
+
 done
 hydra_rmk_name_array="${hydra_rmk_name_array} NULL"
 hydra_rmk_init_array="${hydra_rmk_init_array} NULL"
 AC_DEFINE_UNQUOTED(HYDRA_DEFAULT_RMK,"$hydra_default_rmk",[Default resource management kernel])
+AM_SUBST_NOTMAKE(hydra_rmk_init_decl)
+AM_SUBST_NOTMAKE(hydra_rmk_name_array)
+AM_SUBST_NOTMAKE(hydra_rmk_init_array)
 AC_SUBST(hydra_rmk_init_decl)
 AC_SUBST(hydra_rmk_name_array)
 AC_SUBST(hydra_rmk_init_array)
+AM_CONDITIONAL([hydra_rmk_dummy], [$hydra_rmk_dummy])
 
 
@@ -172,4 +228,6 @@
 AC_MSG_RESULT($hydra_pm)
 AC_SUBST(hydra_pm)
+AM_CONDITIONAL([hydra_pm_pmiserv], [test $hydra_pm = "pmiserv"])
+
 
 dnl Check what UI we should use
@@ -180,4 +238,5 @@
 AC_MSG_RESULT($hydra_ui)
 AC_SUBST(hydra_ui)
+AM_CONDITIONAL([hydra_ui_mpiexec], [test $hydra_ui = "mpiexec"])
 
 dnl Check what communication sub-system we should use
@@ -217,31 +276,31 @@
 dnl Process Binding
 AC_ARG_ENABLE(hydra-procbind, [  --enable-hydra-procbind       Process Binding],
-			      [ PROC_BINDING=$enableval ],
-			      [ PROC_BINDING=no ])
+			      [ procbind=$enableval ],
+			      [ procbind=auto ])
 AC_MSG_CHECKING(process binding)
-AC_MSG_RESULT($PROC_BINDING)
-if test "$PROC_BINDING" = "yes"; then
-   AC_DEFINE(PROC_BINDING,1,[Define if process binding is enabled])
+
+if test "$procbind" = "auto" ; then
+   old_CFLAGS=$CFLAGS
+   CFLAGS="$CFLAGS -I${srcdir}/utils/plpa"
+   AC_TRY_LINK([#include <plpa_internal.h>],[
+PLPA_NAME(api_type_t) p;
+PLPA_NAME(api_probe)(&p);
+],plpa_works=yes,plpa_works=no)
+   CFLAGS=$old_CFLAGS
+   if test "$plpa_works" = "yes" ; then
+      procbind=yes
+   else
+      procbind=no
+   fi
+fi
+
+AC_MSG_RESULT($procbind)
+if test "$procbind" = "yes"; then
+   AC_DEFINE(HAVE_PROC_BINDING,1,[Define if process binding is enabled])
    opt_utils_makefiles="${opt_utils_makefiles} utils/plpa/Makefile utils/bind/Makefile"
    opt_utils="${opt_utils} plpa bind"
 fi
+AM_CONDITIONAL([hydra_procbind], [test "${procbind}" = "yes"])
 AC_SUBST(opt_utils)
-
-dnl Check if __func__ is defined by the compiler
-AC_MSG_CHECKING([whether the compiler allows __func__])
-rm -f conftest.c
-cat > conftest.c <<EOF
-#include <stdio.h>
-int main()
-{
-    printf("%s\n", __func__);
-    return 0;
-}
-EOF
-pac_tmp_compile='$CC $CFLAGS conftest.c -o conftest'
-if AC_TRY_EVAL(pac_tmp_compile) && test -s conftest ; then
-   AC_DEFINE(COMPILER_ACCEPTS_FUNC,1,[Define if compiler supports __func__])
-fi
-rm -f conftest*
 
 dnl Check if __VA_ARGS__ is defined by the compiler
@@ -270,7 +329,5 @@
     PAC_FUNC_NEEDS_DECL([#include <string.h>],strsignal)
 fi
-AC_CHECK_FUNCS(snprintf)
-AC_CHECK_FUNCS(strdup)
-dnl 
+
 dnl Check for signal handlers
 AC_CHECK_FUNCS(sigaction signal sigset)
@@ -319,11 +376,4 @@
 fi
 
-
-dnl Setup non-default variables
-MAKE=${MAKE:-make}
-AC_SUBST(MAKE)
-AR=${AR:-ar}
-AC_SUBST(AR)
-
 dnl Substitute common variables. Some versions of autoconf have
 dnl trouble with this.
@@ -336,24 +386,10 @@
 ENABLE_SHLIB=none
 AC_SUBST(ENABLE_SHLIB)
+AC_SUBST(RANLIB)
+AC_SUBST(MAKE_DEPEND_C)
 
 AC_PROG_INSTALL
-PAC_PROG_MKDIR_P
-PAC_PROG_MAKE
-
-AC_SUBST(RANLIB)
-
-MPILIBNAME=${MPILIBNAME:-"mpich"}
-AC_SUBST(MPILIBNAME)
-
-if test -z "$master_top_srcdir" ; then
-   master_top_srcdir='${srcdir}/../../..'
-fi
-
-AC_SUBST(master_top_srcdir)
-AC_SUBST(master_top_builddir)
-dnl Dependency handling
-AC_SUBST(MAKE_DEPEND_C)
-
-AC_CONFIG_SUBDIRS(../util mpl)
+
+AC_CONFIG_SUBDIRS(mpl)
 
 dnl Place holder macro for finalization
@@ -361,39 +397,10 @@
 
 dnl Final output
-AC_OUTPUT(Makefile \
-	utils/Makefile \
-	utils/args/Makefile \
-	utils/dbg/Makefile \
-	utils/env/Makefile \
-	utils/launch/Makefile \
-	utils/signals/Makefile \
-	utils/sock/Makefile \
-	utils/string/Makefile \
-	utils/timer/Makefile \
-	${opt_utils_makefiles} \
-	ui/Makefile \
-	ui/utils/Makefile \
-	ui/${hydra_ui}/Makefile \
-	pm/Makefile \
-	pm/utils/Makefile \
-	pm/${hydra_pm}/Makefile \
-	demux/Makefile \
-	bootstrap/Makefile \
-	bootstrap/utils/Makefile \
-	bootstrap/src/Makefile \
-	bootstrap/src/bsci_init.c \
-	bootstrap/include/bsci.h \
-	${hydra_bss_makefiles} \
-	rmk/Makefile \
-	rmk/utils/Makefile \
-	rmk/src/Makefile \
-	rmk/src/rmki_init.c \
-	rmk/include/rmki.h \
-	${hydra_rmk_makefiles} \
-	css/Makefile \
-	css/utils/Makefile \
-	css/src/Makefile \
-	css/src/cssi_init.c \
-	css/include/cssi.h \
-	${hydra_css_makefiles}
+AC_OUTPUT(Makefile
+	bootstrap/src/bsci_init.c
+	bootstrap/include/bsci.h
+	rmk/src/rmki_init.c
+	rmk/include/rmki.h
+	css/src/cssi_init.c
+	css/include/cssi.h
 )
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/css/none/Makefile.mk
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/css/none/Makefile.mk (revision 4870)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/css/none/Makefile.mk (revision 4870)
@@ -0,0 +1,9 @@
+# -*- Mode: Makefile; -*-
+#
+# (C) 2008 by Argonne National Laboratory.
+#     See COPYRIGHT in top-level directory.
+#
+
+libhydra_a_SOURCES += $(top_srcdir)/css/none/none_init.c \
+	$(top_srcdir)/css/none/none_finalize.c \
+	$(top_srcdir)/css/none/none_query_string.c
Index: /ich2/branches/dev/kumudb/src/pm/hydra/css/none/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/css/none/Makefile.sm (revision 4726)
+++  (revision )
@@ -1,18 +1,0 @@
-# -*- Mode: Makefile; -*-
-#
-# (C) 2008 by Argonne National Laboratory.
-#     See COPYRIGHT in top-level directory.
-#
-
-HYDRA_LIB_PATH = ../../lib
-
-libhydra_a_DIR = ${HYDRA_LIB_PATH}
-libhydra_a_SOURCES = none_init.c none_query_string.c none_finalize.c
-INCLUDES = -I${abs_srcdir}/../../include \
-	-I../../include \
-	-I${abs_srcdir}/../../mpl/include \
-	-I../../mpl/include \
-	-I${abs_srcdir}/../include \
-	-I../include \
-	-I${abs_srcdir}/../utils \
-	-I${abs_srcdir}/../../demux
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/css/utils/Makefile.mk
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/css/utils/Makefile.mk (revision 4870)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/css/utils/Makefile.mk (revision 4870)
@@ -0,0 +1,7 @@
+# -*- Mode: Makefile; -*-
+#
+# (C) 2008 by Argonne National Laboratory.
+#     See COPYRIGHT in top-level directory.
+#
+
+libhydra_a_SOURCES += $(top_srcdir)/css/utils/cssu_tmp.c
Index: /ich2/branches/dev/kumudb/src/pm/hydra/css/utils/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/css/utils/Makefile.sm (revision 4726)
+++  (revision )
@@ -1,17 +1,0 @@
-# -*- Mode: Makefile; -*-
-#
-# (C) 2008 by Argonne National Laboratory.
-#     See COPYRIGHT in top-level directory.
-#
-
-HYDRA_LIB_PATH = ../../lib
-
-libhydra_a_DIR = ${HYDRA_LIB_PATH}
-libhydra_a_SOURCES = cssu_tmp.c
-INCLUDES = -I${abs_srcdir}/../../include \
-	-I../../include \
-	-I${abs_srcdir}/../../mpl/include \
-	-I../../mpl/include \
-	-I${abs_srcdir}/../include \
-	-I../include \
-	-I${abs_srcdir}/../../demux
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/css/Makefile.mk
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/css/Makefile.mk (revision 4870)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/css/Makefile.mk (revision 4870)
@@ -0,0 +1,12 @@
+# -*- Mode: Makefile; -*-
+#
+# (C) 2008 by Argonne National Laboratory.
+#     See COPYRIGHT in top-level directory.
+#
+
+include css/src/Makefile.mk
+include css/utils/Makefile.mk
+
+if hydra_css_none
+include css/none/Makefile.mk
+endif
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/css/src/Makefile.mk
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/css/src/Makefile.mk (revision 4870)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/css/src/Makefile.mk (revision 4870)
@@ -0,0 +1,9 @@
+# -*- Mode: Makefile; -*-
+#
+# (C) 2008 by Argonne National Laboratory.
+#     See COPYRIGHT in top-level directory.
+#
+
+libhydra_a_SOURCES += $(top_builddir)/css/src/cssi_init.c \
+	$(top_srcdir)/css/src/cssi_finalize.c \
+	$(top_srcdir)/css/src/cssi_query_string.c
Index: /ich2/branches/dev/kumudb/src/pm/hydra/css/src/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/css/src/Makefile.sm (revision 4726)
+++  (revision )
@@ -1,18 +1,0 @@
-# -*- Mode: Makefile; -*-
-#
-# (C) 2008 by Argonne National Laboratory.
-#     See COPYRIGHT in top-level directory.
-#
-
-HYDRA_LIB_PATH = ../../lib
-
-libhydra_a_DIR = ${HYDRA_LIB_PATH}
-libhydra_a_SOURCES = cssi_init.c cssi_finalize.c cssi_query_string.c
-INCLUDES = -I${abs_srcdir}/../../include \
-	-I../../include \
-	-I${abs_srcdir}/../../mpl/include \
-	-I../../mpl/include \
-	-I${abs_srcdir}/../include \
-	-I../include \
-	-I${abs_srcdir}/../utils \
-	-I${abs_srcdir}/../../demux
Index: /ich2/branches/dev/kumudb/src/pm/hydra/css/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/css/Makefile.sm (revision 4224)
+++  (revision )
@@ -1,8 +1,0 @@
-# -*- Mode: Makefile; -*-
-#
-# (C) 2008 by Argonne National Laboratory.
-#     See COPYRIGHT in top-level directory.
-#
-
-SUBDIRS_hydra_css_names = none
-SUBDIRS = utils src @hydra_css_names@ .
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/Makefile.am
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/Makefile.am (revision 4870)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/Makefile.am (revision 4870)
@@ -0,0 +1,43 @@
+# -*- Mode: Makefile; -*-
+#
+# (C) 2008 by Argonne National Laboratory.
+#     See COPYRIGHT in top-level directory.
+#
+
+SUBDIRS = mpl .
+
+ACLOCAL_AMFLAGS = -I mpl/confdb
+AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/mpl/include \
+	-I$(top_builddir)/mpl/include \
+	-I$(top_srcdir)/bootstrap/include -I$(top_builddir)/bootstrap/include \
+	-I$(top_srcdir)/bootstrap/utils \
+	-I$(top_srcdir)/rmk/include -I$(top_builddir)/rmk/include -I$(top_srcdir)/rmk/utils \
+	-I$(top_srcdir)/css/include -I$(top_builddir)/css/include -I$(top_srcdir)/css/utils \
+	-I$(top_srcdir)/demux -I$(top_srcdir)/pm/include -I$(top_srcdir)/utils/plpa
+
+noinst_LIBRARIES = libhydra.a libpm.a libui.a
+bin_PROGRAMS =
+libhydra_a_SOURCES =
+libpm_a_SOURCES =
+libui_a_SOURCES =
+
+# The below directories contribute to libhydra.a
+include utils/Makefile.mk
+include rmk/Makefile.mk
+include bootstrap/Makefile.mk
+include css/Makefile.mk
+include demux/Makefile.mk
+
+# Build the PM
+include pm/Makefile.mk
+
+# Build the UI
+include ui/Makefile.mk
+
+# Use the mpich2-build-install target to include mpiexec in the build bin
+# directory (all pm's require these targets)
+mpich2-build-install: install
+mpich2-build-uninstall: uninstall
+
+# A special alternate installation target when using multiple process managers
+install-alt: install-alt-ui install-alt-pm
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/rmk/utils/Makefile.mk
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/rmk/utils/Makefile.mk (revision 4870)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/rmk/utils/Makefile.mk (revision 4870)
@@ -0,0 +1,7 @@
+# -*- Mode: Makefile; -*-
+#
+# (C) 2008 by Argonne National Laboratory.
+#     See COPYRIGHT in top-level directory.
+#
+
+libhydra_a_SOURCES += $(top_srcdir)/rmk/utils/rmku_query_node_list.c
Index: /ich2/branches/dev/kumudb/src/pm/hydra/rmk/utils/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/rmk/utils/Makefile.sm (revision 4726)
+++  (revision )
@@ -1,18 +1,0 @@
-# -*- Mode: Makefile; -*-
-#
-# (C) 2008 by Argonne National Laboratory.
-#     See COPYRIGHT in top-level directory.
-#
-
-HYDRA_LIB_PATH = ../../lib
-
-libhydra_a_DIR = ${HYDRA_LIB_PATH}
-libhydra_a_SOURCES = rmku_query_node_list.c
-INCLUDES = -I${abs_srcdir}/../../include \
-	-I../../include \
-	-I${abs_srcdir}/../../mpl/include \
-	-I../../mpl/include \
-	-I${abs_srcdir}/../include \
-	-I${abs_srcdir}/../../bootstrap/include \
-	-I../../bootstrap/include \
-	-I${abs_srcdir}/../../demux
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/rmk/Makefile.mk
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/rmk/Makefile.mk (revision 4870)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/rmk/Makefile.mk (revision 4870)
@@ -0,0 +1,12 @@
+# -*- Mode: Makefile; -*-
+#
+# (C) 2008 by Argonne National Laboratory.
+#     See COPYRIGHT in top-level directory.
+#
+
+include rmk/src/Makefile.mk
+include rmk/utils/Makefile.mk
+
+if hydra_rmk_dummy
+include rmk/dummy/Makefile.mk
+endif
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/rmk/src/Makefile.mk
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/rmk/src/Makefile.mk (revision 4870)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/rmk/src/Makefile.mk (revision 4870)
@@ -0,0 +1,8 @@
+# -*- Mode: Makefile; -*-
+#
+# (C) 2008 by Argonne National Laboratory.
+#     See COPYRIGHT in top-level directory.
+#
+
+libhydra_a_SOURCES += $(top_builddir)/rmk/src/rmki_init.c \
+	$(top_srcdir)/rmk/src/rmki_query_node_list.c
Index: /ich2/branches/dev/kumudb/src/pm/hydra/rmk/src/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/rmk/src/Makefile.sm (revision 4726)
+++  (revision )
@@ -1,20 +1,0 @@
-# -*- Mode: Makefile; -*-
-#
-# (C) 2008 by Argonne National Laboratory.
-#     See COPYRIGHT in top-level directory.
-#
-
-HYDRA_LIB_PATH = ../../lib
-
-libhydra_a_DIR = ${HYDRA_LIB_PATH}
-libhydra_a_SOURCES = rmki_init.c rmki_query_node_list.c
-INCLUDES = -I${abs_srcdir}/../../include \
-	-I../../include \
-	-I${abs_srcdir}/../../mpl/include \
-	-I../../mpl/include \
-	-I${abs_srcdir}/../include \
-	-I../include \
-	-I${abs_srcdir}/../utils \
-	-I${abs_srcdir}/../../bootstrap/include \
-	-I../../bootstrap/include \
-	-I${abs_srcdir}/../../demux
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/rmk/dummy/Makefile.mk
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/rmk/dummy/Makefile.mk (revision 4870)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/rmk/dummy/Makefile.mk (revision 4870)
@@ -0,0 +1,7 @@
+# -*- Mode: Makefile; -*-
+#
+# (C) 2008 by Argonne National Laboratory.
+#     See COPYRIGHT in top-level directory.
+#
+
+libhydra_a_SOURCES += $(top_srcdir)/rmk/dummy/rmk_dummy_init.c
Index: /ich2/branches/dev/kumudb/src/pm/hydra/rmk/dummy/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/rmk/dummy/Makefile.sm (revision 4726)
+++  (revision )
@@ -1,18 +1,0 @@
-# -*- Mode: Makefile; -*-
-#
-# (C) 2008 by Argonne National Laboratory.
-#     See COPYRIGHT in top-level directory.
-#
-
-HYDRA_LIB_PATH = ../../lib
-
-libhydra_a_DIR = ${HYDRA_LIB_PATH}
-libhydra_a_SOURCES = rmk_dummy_init.c
-INCLUDES = -I${abs_srcdir}/../../include \
-	-I../../include \
-	-I${abs_srcdir}/../../mpl/include \
-	-I../../mpl/include \
-	-I${abs_srcdir}/../include \
-	-I../include \
-	-I${abs_srcdir}/../utils \
-	-I${abs_srcdir}/../../demux
Index: /ich2/branches/dev/kumudb/src/pm/hydra/rmk/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/rmk/Makefile.sm (revision 4508)
+++  (revision )
@@ -1,8 +1,0 @@
-# -*- Mode: Makefile; -*-
-#
-# (C) 2008 by Argonne National Laboratory.
-#     See COPYRIGHT in top-level directory.
-#
-
-SUBDIRS_hydra_rmk_names = dummy
-SUBDIRS = utils src @hydra_rmk_names@ .
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/pm/utils/Makefile.mk
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/pm/utils/Makefile.mk (revision 4870)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/pm/utils/Makefile.mk (revision 4870)
@@ -0,0 +1,7 @@
+# -*- Mode: Makefile; -*-
+#
+# (C) 2008 by Argonne National Laboratory.
+#     See COPYRIGHT in top-level directory.
+#
+
+libpm_a_SOURCES += $(top_srcdir)/pm/utils/pmi.c
Index: /ich2/branches/dev/kumudb/src/pm/hydra/pm/utils/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/pm/utils/Makefile.sm (revision 4726)
+++  (revision )
@@ -1,18 +1,0 @@
-# -*- Mode: Makefile; -*-
-#
-# (C) 2008 by Argonne National Laboratory.
-#     See COPYRIGHT in top-level directory.
-#
-
-HYDRA_LIB_PATH = ../../lib
-
-libhydra_a_DIR = ${HYDRA_LIB_PATH}
-libhydra_a_SOURCES = pmi.c
-INCLUDES = -I${abs_srcdir}/../../include \
-	-I../../include \
-	-I${abs_srcdir}/../../mpl/include \
-	-I../../mpl/include \
-	-I${abs_srcdir}/../include \
-	-I${abs_srcdir}/../../bootstrap/include \
-	-I../../bootstrap/include \
-	-I${abs_srcdir}/../../demux
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/pm/Makefile.mk
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/pm/Makefile.mk (revision 4870)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/pm/Makefile.mk (revision 4870)
@@ -0,0 +1,11 @@
+# -*- Mode: Makefile; -*-
+#
+# (C) 2008 by Argonne National Laboratory.
+#     See COPYRIGHT in top-level directory.
+#
+
+include pm/utils/Makefile.mk
+
+if hydra_pm_pmiserv
+include pm/pmiserv/Makefile.mk
+endif
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/pm/pmiserv/pmi_handle.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/pm/pmiserv/pmi_handle.c (revision 4625)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/pm/pmiserv/pmi_handle.c (revision 4870)
@@ -323,4 +323,5 @@
             if (j < k - 1)
                 tmp[i++] = HYDU_strdup(",");
+            HYDU_STRLIST_CONSOLIDATE(tmp, i, status);
         }
         tmp[i++] = NULL;
@@ -345,4 +346,5 @@
                 tmp[i++] = HYDU_strdup(",");
             tmp[i++] = HYDU_strdup(")");
+            HYDU_STRLIST_CONSOLIDATE(tmp, i, status);
         }
         tmp[i++] = HYDU_strdup(")");
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/pm/pmiserv/Makefile.mk
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/pm/pmiserv/Makefile.mk (revision 4870)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/pm/pmiserv/Makefile.mk (revision 4870)
@@ -0,0 +1,28 @@
+# -*- Mode: Makefile; -*-
+#
+# (C) 2008 by Argonne National Laboratory.
+#     See COPYRIGHT in top-level directory.
+#
+
+bin_PROGRAMS += pmi_proxy
+
+pmi_proxy_SOURCES = $(top_srcdir)/pm/pmiserv/pmi_proxy.c \
+	$(top_srcdir)/pm/pmiserv/pmi_proxy_cb.c \
+	$(top_srcdir)/pm/pmiserv/pmi_proxy_utils.c
+pmi_proxy_LDADD = libhydra.a
+
+libpm_a_SOURCES += $(top_srcdir)/pm/pmiserv/pmi_handle.c \
+	$(top_srcdir)/pm/pmiserv/pmi_handle_common.c \
+	$(top_srcdir)/pm/pmiserv/pmi_handle_v1.c \
+	$(top_srcdir)/pm/pmiserv/pmi_handle_v2.c \
+	$(top_srcdir)/pm/pmiserv/pmi_serv_cb.c \
+	$(top_srcdir)/pm/pmiserv/pmi_serv_finalize.c \
+	$(top_srcdir)/pm/pmiserv/pmi_serv_launch.c \
+	$(top_srcdir)/pm/pmiserv/pmi_serv_utils.c
+
+install-alt-pm: pmi_proxy
+	@if [ ! -d $(DESTDIR)${bindir} ] ; then \
+	    echo "$(mkdir_p) $(DESTDIR)${bindir} " ;\
+	    $(mkdir_p) $(DESTDIR)${bindir} ;\
+	fi
+	$(INSTALL_PROGRAM) $(INSTALL_STRIP_FLAG) pmi_proxy $(DESTDIR)${bindir}/
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/pm/pmiserv/pmi_proxy_utils.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/pm/pmiserv/pmi_proxy_utils.c (revision 4569)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/pm/pmiserv/pmi_proxy_utils.c (revision 4870)
@@ -30,5 +30,7 @@
     HYD_PMCD_pmi_proxy_params.user_bind_map = NULL;
 
-    HYD_PMCD_pmi_proxy_params.global_env = NULL;
+    HYD_PMCD_pmi_proxy_params.system_env = NULL;
+    HYD_PMCD_pmi_proxy_params.user_env = NULL;
+    HYD_PMCD_pmi_proxy_params.inherited_env = NULL;
 
     HYD_PMCD_pmi_proxy_params.global_core_count = 0;
@@ -65,5 +67,5 @@
 static HYD_Status parse_params(char **t_argv)
 {
-    char **argv = t_argv, *str;
+    char **argv = t_argv, *str, *argtype;
     int arg, i, count;
     HYD_Env_t *env;
@@ -105,5 +107,10 @@
 
         /* Global env */
-        if (!strcmp(*argv, "--global-env")) {
+        if ((!strcmp(*argv, "--inherited-env")) ||
+            (!strcmp(*argv, "--system-env")) ||
+            (!strcmp(*argv, "--user-env"))) {
+
+            argtype = *argv;
+
             argv++;
             count = atoi(*argv);
@@ -120,7 +127,21 @@
                 }
                 env = HYDU_str_to_env(str);
-                HYDU_append_env_to_list(*env, &HYD_PMCD_pmi_proxy_params.global_env);
+
+                if (!strcmp(argtype, "--inherited-env"))
+                    HYDU_append_env_to_list(*env, &HYD_PMCD_pmi_proxy_params.inherited_env);
+                else if (!strcmp(argtype, "--system-env"))
+                    HYDU_append_env_to_list(*env, &HYD_PMCD_pmi_proxy_params.system_env);
+                else if (!strcmp(argtype, "--user-env"))
+                    HYDU_append_env_to_list(*env, &HYD_PMCD_pmi_proxy_params.user_env);
+
                 HYDU_FREE(env);
             }
+            continue;
+        }
+
+        /* Global environment type */
+        if (!strcmp(*argv, "--genv-prop")) {
+            argv++;
+            HYD_PMCD_pmi_proxy_params.genv_prop = atoi(*argv);
             continue;
         }
@@ -205,7 +226,14 @@
                 }
                 env = HYDU_str_to_env(str);
-                HYDU_append_env_to_list(*env, &exec->prop_env);
+                HYDU_append_env_to_list(*env, &exec->user_env);
                 HYDU_FREE(env);
             }
+            continue;
+        }
+
+        /* Global environment type */
+        if (!strcmp(*argv, "--exec-env-prop")) {
+            argv++;
+            exec->prop = atoi(*argv);
             continue;
         }
@@ -341,6 +369,12 @@
         HYDU_FREE(HYD_PMCD_pmi_proxy_params.user_bind_map);
 
-    if (HYD_PMCD_pmi_proxy_params.global_env)
-        HYDU_env_free_list(HYD_PMCD_pmi_proxy_params.global_env);
+    if (HYD_PMCD_pmi_proxy_params.system_env)
+        HYDU_env_free_list(HYD_PMCD_pmi_proxy_params.system_env);
+
+    if (HYD_PMCD_pmi_proxy_params.user_env)
+        HYDU_env_free_list(HYD_PMCD_pmi_proxy_params.user_env);
+
+    if (HYD_PMCD_pmi_proxy_params.inherited_env)
+        HYDU_env_free_list(HYD_PMCD_pmi_proxy_params.inherited_env);
 
     if (HYD_PMCD_pmi_proxy_params.segment_list) {
@@ -362,6 +396,6 @@
             texec = exec->next;
             HYDU_free_strlist(exec->exec);
-            if (exec->prop_env)
-                HYDU_env_free(exec->prop_env);
+            if (exec->user_env)
+                HYDU_env_free(exec->user_env);
             HYDU_FREE(exec);
             exec = texec;
@@ -447,5 +481,5 @@
     char *str;
     char *client_args[HYD_NUM_TMP_STRINGS];
-    HYD_Env_t *env;
+    HYD_Env_t *env, *prop_env = NULL;
     struct HYD_Partition_segment *segment;
     struct HYD_Partition_exec *exec;
@@ -475,27 +509,46 @@
         HYD_PMCD_pmi_proxy_params.exit_status[i] = -1;
 
-    /* For local spawning, set the global environment here itself */
-    status = HYDU_putenv_list(HYD_PMCD_pmi_proxy_params.global_env);
-    HYDU_ERR_POP(status, "putenv returned error\n");
-
+#if defined HAVE_PROC_BINDING
     status = HYDU_bind_init(HYD_PMCD_pmi_proxy_params.user_bind_map);
     HYDU_ERR_POP(status, "unable to initialize process binding\n");
-
-    /* Set the PMI port string to connect to. We currently just use
-     * the global PMI port. */
-    if (HYD_PMCD_pmi_proxy_params.pmi_port_str) {
-        str = HYDU_strdup(HYD_PMCD_pmi_proxy_params.pmi_port_str);
-        status = HYDU_env_create(&env, "PMI_PORT", str);
-        HYDU_ERR_POP(status, "unable to create env\n");
-        HYDU_FREE(str);
-        status = HYDU_putenv(env);
-        HYDU_ERR_POP(status, "putenv failed\n");
-    }
+#endif /* HAVE_PROC_BINDING */
 
     /* Spawn the processes */
     process_id = 0;
     for (exec = HYD_PMCD_pmi_proxy_params.exec_list; exec; exec = exec->next) {
+
+        /* The priority order is: (1) system env, (2) local executable
+         * env, (3) global executable env and (4) inherited env. */
+        if (exec->prop == HYD_ENV_PROP_UNSET || exec->prop == HYD_ENV_PROP_ALL) {
+            for (env = HYD_PMCD_pmi_proxy_params.inherited_env; env; env = env->next) {
+                status = HYDU_append_env_to_list(*env, &prop_env);
+                HYDU_ERR_POP(status, "unable to add env to list\n");
+            }
+            for (env = HYD_PMCD_pmi_proxy_params.user_env; env; env = env->next) {
+                status = HYDU_append_env_to_list(*env, &prop_env);
+                HYDU_ERR_POP(status, "unable to add env to list\n");
+            }
+        }
+        for (env = exec->user_env; env; env = env->next) {
+            status = HYDU_append_env_to_list(*env, &prop_env);
+            HYDU_ERR_POP(status, "unable to add env to list\n");
+        }
+        for (env = HYD_PMCD_pmi_proxy_params.system_env; env; env = env->next) {
+            status = HYDU_append_env_to_list(*env, &prop_env);
+            HYDU_ERR_POP(status, "unable to add env to list\n");
+        }
+
+        /* Set the PMI port string to connect to. We currently just
+         * use the global PMI port. */
+        if (HYD_PMCD_pmi_proxy_params.pmi_port_str) {
+            str = HYDU_strdup(HYD_PMCD_pmi_proxy_params.pmi_port_str);
+            status = HYDU_env_create(&env, "PMI_PORT", str);
+            HYDU_ERR_POP(status, "unable to create env\n");
+            HYDU_FREE(str);
+            status = HYDU_append_env_to_list(*env, &prop_env);
+            HYDU_ERR_POP(status, "unable to add env to list\n");
+        }
+
         for (i = 0; i < exec->proc_count; i++) {
-
             pmi_id = HYDU_local_to_global_id(process_id,
                                              HYD_PMCD_pmi_proxy_params.partition_core_count,
@@ -508,6 +561,6 @@
                 HYDU_ERR_POP(status, "unable to create env\n");
                 HYDU_FREE(str);
-                status = HYDU_putenv(env);
-                HYDU_ERR_POP(status, "putenv failed\n");
+                status = HYDU_append_env_to_list(*env, &prop_env);
+                HYDU_ERR_POP(status, "unable to add env to list\n");
             }
 
@@ -520,7 +573,11 @@
             client_args[arg++] = NULL;
 
+#if defined HAVE_PROC_BINDING
             core = HYDU_bind_get_core_id(process_id, HYD_PMCD_pmi_proxy_params.binding);
+#else
+            core = -1;
+#endif /* HAVE_PROC_BINDING */
             if (pmi_id == 0) {
-                status = HYDU_create_process(client_args, exec->prop_env,
+                status = HYDU_create_process(client_args, prop_env,
                                              &HYD_PMCD_pmi_proxy_params.in,
                                              &HYD_PMCD_pmi_proxy_params.out[process_id],
@@ -537,14 +594,16 @@
             }
             else {
-                status = HYDU_create_process(client_args, exec->prop_env,
-                                             NULL,
+                status = HYDU_create_process(client_args, prop_env, NULL,
                                              &HYD_PMCD_pmi_proxy_params.out[process_id],
                                              &HYD_PMCD_pmi_proxy_params.err[process_id],
                                              &HYD_PMCD_pmi_proxy_params.pid[process_id], core);
             }
-            HYDU_ERR_POP(status, "spawn process returned error\n");
+            HYDU_ERR_POP(status, "create process returned error\n");
 
             process_id++;
         }
+
+        HYDU_env_free_list(prop_env);
+        prop_env = NULL;
     }
 
@@ -567,4 +626,5 @@
   fn_exit:
     return status;
+
   fn_fail:
     goto fn_exit;
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/pm/pmiserv/pmi_handle_common.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/pm/pmiserv/pmi_handle_common.c (revision 4601)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/pm/pmiserv/pmi_handle_common.c (revision 4870)
@@ -14,5 +14,5 @@
 {
     int pmi_version, pmi_subversion;
-    char *tmp[HYD_NUM_TMP_STRINGS];
+    char *tmp;
     HYD_Status status = HYD_SUCCESS;
 
@@ -25,12 +25,12 @@
 
     if (pmi_version == 1 && pmi_subversion <= 1) {
-        tmp[0] = "cmd=response_to_init pmi_version=1 pmi_subversion=1 rc=0\n";
-        status = HYDU_sock_writeline(fd, tmp[0], strlen(tmp[0]));
+        tmp = "cmd=response_to_init pmi_version=1 pmi_subversion=1 rc=0\n";
+        status = HYDU_sock_writeline(fd, tmp, strlen(tmp));
         HYDU_ERR_POP(status, "error writing PMI line\n");
         HYD_PMCD_pmi_handle = HYD_PMCD_pmi_v1;
     }
     else if (pmi_version == 2 && pmi_subversion == 0) {
-        tmp[0] = "cmd=response_to_init pmi_version=2 pmi_subversion=0 rc=0\n";
-        status = HYDU_sock_writeline(fd, tmp[0], strlen(tmp[0]));
+        tmp = "cmd=response_to_init pmi_version=2 pmi_subversion=0 rc=0\n";
+        status = HYDU_sock_writeline(fd, tmp, strlen(tmp));
         HYDU_ERR_POP(status, "error writing PMI line\n");
         HYD_PMCD_pmi_handle = HYD_PMCD_pmi_v2;
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/pm/pmiserv/pmi_serv_launch.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/pm/pmiserv/pmi_serv_launch.c (revision 4631)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/pm/pmiserv/pmi_serv_launch.c (revision 4870)
@@ -146,5 +146,4 @@
     int i, arg;
     char *path_str[HYD_NUM_TMP_STRINGS];
-    struct HYD_Partition *partition;
     HYD_Status status = HYD_SUCCESS;
 
@@ -153,41 +152,39 @@
         goto fn_exit;
 
-    FORALL_ACTIVE_PARTITIONS(partition, HYD_handle.partition_list) {
-        arg = 0;
-        i = 0;
-        path_str[i++] = HYDU_strdup(HYD_handle.base_path);
-        path_str[i++] = HYDU_strdup("pmi_proxy");
-        path_str[i] = NULL;
-        status = HYDU_str_alloc_and_join(path_str, &proxy_args[arg++]);
-        HYDU_ERR_POP(status, "unable to join strings\n");
-        HYDU_free_strlist(path_str);
-
-        proxy_args[arg++] = HYDU_strdup("--launch-mode");
-        proxy_args[arg++] = HYDU_int_to_str(mode);
-
-        proxy_args[arg++] = HYDU_strdup("--proxy-port");
-        if (mode == HYD_LAUNCH_RUNTIME)
-            proxy_args[arg++] = HYDU_strdup(proxy_port_str);
-        else
-            proxy_args[arg++] = HYDU_int_to_str(HYD_handle.proxy_port);
-
-        if (HYD_handle.debug)
-            proxy_args[arg++] = HYDU_strdup("--debug");
-
-        if (HYD_handle.enablex != -1) {
-            proxy_args[arg++] = HYDU_strdup("--enable-x");
-            proxy_args[arg++] = HYDU_int_to_str(HYD_handle.enablex);
-        }
-
-        proxy_args[arg++] = HYDU_strdup("--bootstrap");
-        proxy_args[arg++] = HYDU_strdup(HYD_handle.bootstrap);
-
-        if (HYD_handle.bootstrap_exec) {
-            proxy_args[arg++] = HYDU_strdup("--bootstrap-exec");
-            proxy_args[arg++] = HYDU_strdup(HYD_handle.bootstrap_exec);
-        }
-
-        proxy_args[arg++] = NULL;
-    }
+    arg = 0;
+    i = 0;
+    path_str[i++] = HYDU_strdup(HYD_handle.base_path);
+    path_str[i++] = HYDU_strdup("pmi_proxy");
+    path_str[i] = NULL;
+    status = HYDU_str_alloc_and_join(path_str, &proxy_args[arg++]);
+    HYDU_ERR_POP(status, "unable to join strings\n");
+    HYDU_free_strlist(path_str);
+
+    proxy_args[arg++] = HYDU_strdup("--launch-mode");
+    proxy_args[arg++] = HYDU_int_to_str(mode);
+
+    proxy_args[arg++] = HYDU_strdup("--proxy-port");
+    if (mode == HYD_LAUNCH_RUNTIME)
+        proxy_args[arg++] = HYDU_strdup(proxy_port_str);
+    else
+        proxy_args[arg++] = HYDU_int_to_str(HYD_handle.proxy_port);
+
+    if (HYD_handle.debug)
+        proxy_args[arg++] = HYDU_strdup("--debug");
+
+    if (HYD_handle.enablex != -1) {
+        proxy_args[arg++] = HYDU_strdup("--enable-x");
+        proxy_args[arg++] = HYDU_int_to_str(HYD_handle.enablex);
+    }
+
+    proxy_args[arg++] = HYDU_strdup("--bootstrap");
+    proxy_args[arg++] = HYDU_strdup(HYD_handle.bootstrap);
+
+    if (HYD_handle.bootstrap_exec) {
+        proxy_args[arg++] = HYDU_strdup("--bootstrap-exec");
+        proxy_args[arg++] = HYDU_strdup(HYD_handle.bootstrap_exec);
+    }
+
+    proxy_args[arg++] = NULL;
 
   fn_exit:
@@ -201,4 +198,7 @@
 {
     int i, arg, process_id;
+    int inherited_env_count, user_env_count, system_env_count;
+    int segment_count, exec_count, total_args;
+    static proxy_count = 0;
     HYD_Env_t *env;
     struct HYD_Partition *partition;
@@ -210,4 +210,34 @@
     process_id = 0;
     FORALL_ACTIVE_PARTITIONS(partition, HYD_handle.partition_list) {
+        for (inherited_env_count = 0, env = HYD_handle.inherited_env; env;
+             env = env->next, inherited_env_count++);
+        for (user_env_count = 0, env = HYD_handle.user_env; env;
+             env = env->next, user_env_count++);
+        for (system_env_count = 0, env = HYD_handle.system_env; env;
+             env = env->next, system_env_count++);
+
+        for (segment_count = 0, segment = partition->segment_list; segment;
+             segment = segment->next)
+            segment_count++;
+
+        for (exec_count = 0, exec = partition->exec_list; exec; exec = exec->next)
+            exec_count++;
+
+        total_args = HYD_NUM_TMP_STRINGS; /* For the basic arguments */
+
+        /* Environments */
+        total_args += inherited_env_count;
+        total_args += user_env_count;
+        total_args += system_env_count;
+
+        /* For each segment add a few strings */
+        total_args += (segment_count * HYD_NUM_TMP_STRINGS);
+
+        /* For each exec add a few strings */
+        total_args += (exec_count * HYD_NUM_TMP_STRINGS);
+
+        HYDU_MALLOC(partition->base->exec_args, char **, total_args * sizeof(char *),
+                    status);
+
         arg = 0;
         partition->base->exec_args[arg++] = HYDU_strdup("--global-core-count");
@@ -223,4 +253,5 @@
             partition->base->exec_args[arg++] = HYDU_strdup("HYDRA_NULL");
 
+#if defined HAVE_PROC_BINDING
         partition->base->exec_args[arg++] = HYDU_strdup("--binding");
         partition->base->exec_args[arg++] = HYDU_int_to_str(HYD_handle.binding);
@@ -231,14 +262,34 @@
         else
             partition->base->exec_args[arg++] = HYDU_strdup("HYDRA_NULL");
-
-        /* Pass the global environment separately, instead of for each
-         * executable, as an optimization */
-        partition->base->exec_args[arg++] = HYDU_strdup("--global-env");
+#else
+        if (HYD_handle.binding != HYD_BIND_UNSET && HYD_handle.binding != HYD_BIND_NONE)
+            HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR,
+                                "Hydra not configured with process binding\n");
+#endif /* HAVE_PROC_BINDING */
+
+        partition->base->exec_args[arg++] = HYDU_strdup("--inherited-env");
+        for (i = 0, env = HYD_handle.inherited_env; env; env = env->next, i++);
+        partition->base->exec_args[arg++] = HYDU_int_to_str(i);
+        partition->base->exec_args[arg++] = NULL;
+        HYDU_list_append_env_to_str(HYD_handle.inherited_env, partition->base->exec_args);
+
+        arg = HYDU_strlist_lastidx(partition->base->exec_args);
+        partition->base->exec_args[arg++] = HYDU_strdup("--user-env");
+        for (i = 0, env = HYD_handle.user_env; env; env = env->next, i++);
+        partition->base->exec_args[arg++] = HYDU_int_to_str(i);
+        partition->base->exec_args[arg++] = NULL;
+        HYDU_list_append_env_to_str(HYD_handle.user_env, partition->base->exec_args);
+
+        arg = HYDU_strlist_lastidx(partition->base->exec_args);
+        partition->base->exec_args[arg++] = HYDU_strdup("--system-env");
         for (i = 0, env = HYD_handle.system_env; env; env = env->next, i++);
-        for (env = HYD_handle.prop_env; env; env = env->next, i++);
         partition->base->exec_args[arg++] = HYDU_int_to_str(i);
         partition->base->exec_args[arg++] = NULL;
         HYDU_list_append_env_to_str(HYD_handle.system_env, partition->base->exec_args);
-        HYDU_list_append_env_to_str(HYD_handle.prop_env, partition->base->exec_args);
+
+        arg = HYDU_strlist_lastidx(partition->base->exec_args);
+        partition->base->exec_args[arg++] = HYDU_strdup("--genv-prop");
+        partition->base->exec_args[arg++] = HYDU_int_to_str(HYD_handle.prop);
+        partition->base->exec_args[arg++] = NULL;
 
         /* Pass the segment information */
@@ -262,12 +313,15 @@
             partition->base->exec_args[arg++] = HYDU_strdup("--exec-proc-count");
             partition->base->exec_args[arg++] = HYDU_int_to_str(exec->proc_count);
-            partition->base->exec_args[arg++] = NULL;
-
-            arg = HYDU_strlist_lastidx(partition->base->exec_args);
+
             partition->base->exec_args[arg++] = HYDU_strdup("--exec-local-env");
-            for (i = 0, env = exec->prop_env; env; env = env->next, i++);
+            for (i = 0, env = exec->user_env; env; env = env->next, i++);
             partition->base->exec_args[arg++] = HYDU_int_to_str(i);
             partition->base->exec_args[arg++] = NULL;
-            HYDU_list_append_env_to_str(exec->prop_env, partition->base->exec_args);
+            HYDU_list_append_env_to_str(exec->user_env, partition->base->exec_args);
+
+            arg = HYDU_strlist_lastidx(partition->base->exec_args);
+            partition->base->exec_args[arg++] = HYDU_strdup("--exec-env-prop");
+            partition->base->exec_args[arg++] = HYDU_int_to_str(exec->prop);
+            partition->base->exec_args[arg++] = NULL;
 
             HYDU_list_append_strlist(exec->exec, partition->base->exec_args);
@@ -275,7 +329,17 @@
             process_id += exec->proc_count;
         }
-    }
-
+
+        if (HYD_handle.debug) {
+            printf("Arguments being passed to proxy %d:\n", proxy_count++);
+            HYDU_print_strlist(partition->base->exec_args);
+            printf("\n");
+        }
+    }
+
+  fn_exit:
     return status;
+
+  fn_fail:
+    goto fn_exit;
 }
 
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/pm/pmiserv/pmi_proxy_cb.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/pm/pmiserv/pmi_proxy_cb.c (revision 4488)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/pm/pmiserv/pmi_proxy_cb.c (revision 4870)
@@ -103,6 +103,8 @@
             (HYD_PMCD_pmi_proxy_params.upstream.err != -1))
             if ((HYD_PMCD_pmi_proxy_params.segment_list->start_pid != 0) ||
-                (HYD_PMCD_pmi_proxy_params.upstream.in != -1))
-                HYD_PMCD_pmi_proxy_launch_procs();
+                (HYD_PMCD_pmi_proxy_params.upstream.in != -1)) {
+                status = HYD_PMCD_pmi_proxy_launch_procs();
+                HYDU_ERR_POP(status, "HYD_PMCD_pmi_proxy_launch_procs returned error\n");
+            }
 
   fn_exit:
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/pm/pmiserv/pmi_proxy.h
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/pm/pmiserv/pmi_proxy.h (revision 4569)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/pm/pmiserv/pmi_proxy.h (revision 4870)
@@ -30,5 +30,8 @@
     char *user_bind_map;
 
-    HYD_Env_t *global_env;
+    HYD_Env_t *system_env;
+    HYD_Env_t *user_env;
+    HYD_Env_t *inherited_env;
+    HYD_Env_prop_t genv_prop;
 
     int global_core_count;
Index: /ich2/branches/dev/kumudb/src/pm/hydra/pm/pmiserv/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/pm/pmiserv/Makefile.sm (revision 4811)
+++  (revision )
@@ -1,37 +1,0 @@
-# -*- Mode: Makefile; -*-
-#
-# (C) 2008 by Argonne National Laboratory.
-#     See COPYRIGHT in top-level directory.
-#
-
-#libhydra_a_DIR = ../../lib
-#libhydra_a_SOURCES = pmi_serv_launch.c pmi_serv_finalize.c pmi_serv_cb.c pmi_serv_utils.c \
-#	pmi_handle.c pmi_handle_common.c pmi_handle_v1.c pmi_handle_v2.c
-#INCLUDES = -I${abs_srcdir}/../../include \
-#	-I../../include \
-#	-I${abs_srcdir}/../../mpl/include \
-#	-I../../mpl/include \
-#	-I${abs_srcdir}/../include \
-#	-I${abs_srcdir}/../utils \
-#	-I${abs_srcdir}/../../bootstrap/include \
-#	-I../../bootstrap/include \
-#	-I${abs_srcdir}/../../demux
-
-#pmi_proxy_SOURCES = pmi_proxy.c pmi_proxy_utils.c pmi_proxy_cb.c
-#pmi_proxy_LDADD = -L../../lib -lhydra -L../../mpl -lmpl
-#pmi_proxy_DEPADD = ../../mpl/libmpl.a
-#install_BIN = pmi_proxy
-
-# Use the mpich2-build-install target to include mpiexec in the build bin
-# directory (all pm's require these targets)
-#mpich2-build-install: install
-#mpich2-build-uninstall: uninstall
-
-# Only hydra has a proxy for now; so install it even when multiple PMs are used
-#install-alt: install
-
-# We use a dummy dependency to ensure that we always go to the util
-# directory to see if anything needs to be done
-#../../../util/libmpiexec.a: dummy
-#dummy:
-#	#cd ../../../util && $(MAKE)
Index: /ich2/branches/dev/kumudb/src/pm/hydra/pm/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/pm/Makefile.sm (revision 4154)
+++  (revision )
@@ -1,11 +1,0 @@
-# -*- Mode: Makefile; -*-
-#
-# (C) 2008 by Argonne National Laboratory.
-#     See COPYRIGHT in top-level directory.
-#
-
-SUBDIRS_hydra_pm = pmiserv
-SUBDIRS = utils @hydra_pm@ .
-
-mpich2-build-install mpich2-build-uninstall install install-alt:
-	cd @hydra_pm@ && ${MAKE} $@
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/README
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/README (revision 4615)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/README (revision 4870)
@@ -1,4 +1,3 @@
-General
--------
+
 Hydra is a process management system for starting parallel jobs. Hydra
 is designed to natively work with multiple daemons such as ssh, rsh,
@@ -6,291 +5,4 @@
 fork are supported, with a preliminary version of slurm available.
 
-More detailed documentation of the internal workings of Hydra are
-available here:
-http://wiki.mcs.anl.gov/mpich2/index.php/Hydra_Process_Management_Framework
-
-
-Quick Start
------------
-To use hydra, mpich2 needs to be configured with the configure option
---with-pm=hydra.
-
-Once built, the Hydra executables are in mpich2/bin, or the bin
-subdirectory of the install directory if you have done an install.
-You should put this (bin) directory in your PATH in your .cshrc or
-.bashrc for usage convenience:
-
-Put in .cshrc:  setenv PATH /home/you/mpich2/bin:$PATH
-
-Put in .bashrc: export PATH=/home/you/mpich2/bin:$PATH
-
-To compile your application use mpicc:
-
- $ mpicc app.c -o app
-
-Create a file with the names of the machines that you want to run your
-job on. This file may or may not include the local machine.
-
- $ cat hosts
-
-   donner
-   foo
-   shakey
-   terra
-
-To run your application on these nodes, use mpiexec:
-
- $ mpiexec -f hosts -n 4 ./app
-
-The host file can also be specified as follows:
-
- $ cat hosts
-
-   donner:2
-   foo:3
-   shakey:2
-
-In this case, the first 2 processes are scheduled on "donner", the
-next 3 on "foo" and the last 2 on "shakey". Comments in the
-host file start with a "#" character.
-
- $ cat hosts
-
-   # This is a sample host file
-   donner:2     # The first 2 procs are scheduled to run here
-   foo:3        # The next 3 procs run on this host
-   shakey:2     # The last 2 procs run on this host
-
-
-Environment settings
---------------------
-HYDRA_HOST_FILE: This variable points to the default host file to use,
-when the "-f" option is not provided to mpiexec.
-
-  For bash:
-    export HYDRA_HOST_FILE=<path_to_host_file>/hosts
-
-  For csh/tcsh:
-    setenv HYDRA_HOST_FILE <path_to_host_file>/hosts
-
-
-HYDRA_DEBUG: Setting this to "1" enables debug mode; set it to "0" to
-disable.
-
-HYDRA_ENV: Setting this to "all" will pass all the environment to the
-application processes.
-
-HYDRA_PROXY_PORT: The port to use for the proxies.
-
-
-Bootstrap servers
------------------
-Hydra supports SSH and FORK bootstrap servers to launch processes. You
-can pick these through the mpiexec option -bootstrap:
-
- $ mpiexec -bootstrap ssh -f hosts -n 4 ./app
-
- (or)
-
- $ mpiexec -bootstrap fork -f hosts -n 4 ./app
-
-This can also be controlled by using the HYDRA_BOOTSTRAP environment
-variable.
-
-The default bootstrap server is ssh.
-
-The executable to use as the bootstrap server can be specified using
-the option -bootstrap-exec:
-
- $ mpiexec -bootstrap ssh -bootstrap-exec /usr/bin/ssh -f hosts -n 4 ./app
-
-This can also be specified using the HYDRA_BOOTSTRAP_EXEC environment
-variable. If the bootstrap executable is not specified, the default
-path (specific to each bootstrap server) is chosen.
-
-
-Process-core binding
---------------------
-To configure hydra with process-core binding support, use the
-configure option -enable-hydra-procbind.
-
-We support three models of allocation strategies:
-
-1. Basic allocation strategies: this just allocates processes using
-the OS specified processor IDs. Currently, only round-robin scheme is
-provided here.
-
-2. Topology-aware allocation strategies: these are a bit more
-intelligent in that they try to understand the system topology and
-assign processes in that order. Currently, "buddy" and "pack" schemes
-are provided. The "buddy" scheme loops between all the available
-sockets, allocating one process per socket; this tries to minimize the
-inter-process resource sharing (assuming the closer the processes are
-the more resources that they share). The "pack" scheme packs
-everything as closely as it can; this tries to maximize resource
-sharing hoping that the communication library can take advantage of
-this packing for better performance.
-
-3. User-defined allocation strategies: two schemes are
-provided---command-line and host-file based. The command-line scheme
-lets the user specify a common-mapping for all physical nodes on the
-command line. The host-file scheme is the most general and lets the
-user specify the mapping for each node separately.
-
-The modes of process-core binding are: round-robin ("rr"),
-buddy-allocation ("buddy"), closest packing ("pack") and user-defined
-("user"). These can be selected as follows:
-
- $ mpiexec -binding rr -f hosts -n 8 ./app
-
- ... or ...
-
- $ mpiexec -binding pack -f hosts -n 8 ./app
-
-Consider the following layout of processing elements in the system
-(e.g., two nodes, each with two processors, and each processor with
-two cores). Suppose the Operating System assigned processor IDs for
-each of these processing elements are as shown below:
-
-__________________________________________      __________________________________________
-|  _________________    _________________  |    |  _________________    _________________  | 
-| |  _____   _____  |  |  _____   _____  | |    | |  _____   _____  |  |  _____   _____  | |
-| | |     | |     | |  | |     | |     | | |    | | |     | |     | |  | |     | |     | | |
-| | |     | |     | |  | |     | |     | | |    | | |     | |     | |  | |     | |     | | | 
-| | |  0  | |  2  | |  | |  1  | |  3  | | |    | | |  0  | |  2  | |  | |  1  | |  3  | | |
-| | |     | |     | |  | |     | |     | | |    | | |     | |     | |  | |     | |     | | |
-| | |_____| |_____| |  | |_____| |_____| | |    | | |_____| |_____| |  | |_____| |_____| | |
-| |_________________|  |_________________| |    | |_________________|  |_________________| |
-|__________________________________________|    |__________________________________________|
-
-
-In this case, the binding options are as follows:
-
-RR: 0, 1, 2, 3 (use the order provided by the OS)
-Buddy: 0, 1, 2, 3 (increasing sharing of resources)
-Pack: 0, 2, 1, 3 (closest packing)
-User: as defined by the user
-
-Within the user-defined binding, two modes are supported: command-line
-and host-file based. The command-line based mode can be used as
-follows:
-
- $ mpiexec -binding user:0,3 -f hosts -n 4 ./app
-
-If a machine has 4 processing elements, and only two bindings are
-provided (as in the above example), the rest are padded with (-1),
-which refers to no binding. Also, the mapping is the same for all
-machines; so if the application is run with 8 processes, the first 2
-processes on "each machine" are bound to processing elements as
-specified.
-
-The host-file based mode for user-defined binding can be used by the
-"map=" argument on each host line. E.g.:
-
- $ cat hosts
-
-   donner:4    map=0,-1,-1,3
-   foo:4       map=3,2
-   shakey:2
-
-Using this method, each host can be given a different mapping. Any
-unspecified mappings are treated as (-1), referring to no binding.
-
-Command-line based mappings are given a higher priority than the
-host-file based mappings. So, if a mapping is given at both places,
-the host-file mappings are ignored.
-
-Binding options can also be controlled with the environment variable
-HYDRA_BINDING.
-
-
-X Forwarding
-------------
-X-forwarding is specific to each bootstrap server. Some servers do it
-by default, while some don't. For ssh, this is disabled by default. To
-enable it, you should use the option -enable-x to mpiexec.
-
- $ mpiexec -enable-x -f hosts -n 4 ./app
-
-
-Persistent-mode Proxies
------------------------
-Hydra also supports proxies to be launched in persistent mode on the
-system (e.g., by a system administrator). To launch in persistent
-mode, use:
-
- $ mpiexec -boot-proxies -f hosts
-
- $ mpiexec -use-persistent -f hosts -n 4 ./app1
-
- $ mpiexec -use-persistent -f hosts -n 4 ./app2
-
- $ mpiexec -use-persistent -f hosts -n 4 ./app3
-
- $ mpiexec -shutdown-proxies -f hosts
-
-Persistent mode can also be picked using the environment setting
-HYDRA_LAUNCH_MODE=persistent.
-
-The option "-boot-foreground-proxies" can be used to prevent
-persistent proxies from spawning a child process and exiting.
-This option is useful for debugging. This option can also be
-picked using the environment setting
-HYDRA_BOOT_FOREGROUND_PROXIES=1
-
- $ mpiexec -boot-foreground-proxies -f hosts
-
- $ mpiexec -use-persistent -f hosts -n 4 ./app1
-
- $ mpiexec -shutdown-proxies -f hosts
-
-
-Communication sub-systems
--------------------------
-Hydra supports different communication sub-systems to connect proxies
-in the persistent mode. The default is "none", which means that the
-proxies are not connected. You can pick these through the mpiexec
-option -css:
-
- $ mpiexec -css ib -f hosts -n 4 ./app
-
- (or)
-
- $ mpiexec -css mx -f hosts -n 4 ./app
-
-This can also be controlled by using the HYDRA_CSS environment
-variable.
-
-
-Resource Manager integration
-----------------------------
-Hydra provides capability to integrate with different resource
-managers. The default is "dummy", which means no resource manager. You
-can pick these through the mpiexec option -rmk:
-
- $ mpiexec -rmk lsf -f hosts -n 4 ./app
-
-This can also be controlled by using the HYDRA_RMK environment
-variable.
-
-
-Hydra in hybrid environments
-----------------------------
-Hydra can be used to launch other process managers as well, such as a
-UPC launcher, for example:
-
- $ mpiexec -n 2 -ranks-per-proc=4 upcrun -n 4 ./app
-
-This launches two instances of upcrun, each of which is expected to
-launch 4 application processes (two subgroups of processes). Hydra
-needs the -ranks-per-proc argument to tell it how many MPI ranks it
-needs to allocate to each group of processes.
-
-If the internal nested environment also needs to use Hydra as a
-launcher, but not as a process manager, this can be set using:
-
- $ mpiexec -n 2 -ranks-per-proc=4 mpiexec -n 4 -disable-pm-env ./app
-
- (or)
-
- $ mpiexec -n 2 -ranks-per-proc=4 HYDRA_PM_ENV=0 mpiexec -n 4 ./app
+More information about using Hydra can be found here:
+http://wiki.mcs.anl.gov/mpich2/index.php/Using_the_Hydra_Process_Manager
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/bootstrap/utils/Makefile.mk
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/bootstrap/utils/Makefile.mk (revision 4870)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/bootstrap/utils/Makefile.mk (revision 4870)
@@ -0,0 +1,11 @@
+# -*- Mode: Makefile; -*-
+#
+# (C) 2008 by Argonne National Laboratory.
+#     See COPYRIGHT in top-level directory.
+#
+
+libhydra_a_SOURCES += $(top_srcdir)/bootstrap/utils/bscu_finalize.c \
+	$(top_srcdir)/bootstrap/utils/bscu_query_node_list.c \
+	$(top_srcdir)/bootstrap/utils/bscu_query_partition_id.c \
+	$(top_srcdir)/bootstrap/utils/bscu_usize.c \
+	$(top_srcdir)/bootstrap/utils/bscu_wait.c
Index: /ich2/branches/dev/kumudb/src/pm/hydra/bootstrap/utils/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/bootstrap/utils/Makefile.sm (revision 4726)
+++  (revision )
@@ -1,18 +1,0 @@
-# -*- Mode: Makefile; -*-
-#
-# (C) 2008 by Argonne National Laboratory.
-#     See COPYRIGHT in top-level directory.
-#
-
-HYDRA_LIB_PATH = ../../lib
-
-libhydra_a_DIR = ${HYDRA_LIB_PATH}
-libhydra_a_SOURCES = bscu_wait.c bscu_usize.c bscu_finalize.c bscu_query_node_list.c \
-	bscu_query_partition_id.c
-INCLUDES = -I${abs_srcdir}/../../include \
-	-I../../include \
-	-I${abs_srcdir}/../../mpl/include \
-	-I../../mpl/include \
-	-I${abs_srcdir}/../../pm/utils \
-	-I${abs_srcdir}/../include \
-	-I${abs_srcdir}/../../demux
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/bootstrap/fork/Makefile.mk
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/bootstrap/fork/Makefile.mk (revision 4870)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/bootstrap/fork/Makefile.mk (revision 4870)
@@ -0,0 +1,8 @@
+# -*- Mode: Makefile; -*-
+#
+# (C) 2008 by Argonne National Laboratory.
+#     See COPYRIGHT in top-level directory.
+#
+
+libhydra_a_SOURCES += $(top_srcdir)/bootstrap/fork/fork_init.c \
+	$(top_srcdir)/bootstrap/fork/fork_launch.c
Index: /ich2/branches/dev/kumudb/src/pm/hydra/bootstrap/fork/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/bootstrap/fork/Makefile.sm (revision 4726)
+++  (revision )
@@ -1,19 +1,0 @@
-# -*- Mode: Makefile; -*-
-#
-# (C) 2008 by Argonne National Laboratory.
-#     See COPYRIGHT in top-level directory.
-#
-
-HYDRA_LIB_PATH = ../../lib
-
-libhydra_a_DIR = ${HYDRA_LIB_PATH}
-libhydra_a_SOURCES = fork_init.c fork_launch.c
-INCLUDES = -I${abs_srcdir}/../../include \
-	-I../../include \
-	-I${abs_srcdir}/../../mpl/include \
-	-I../../mpl/include \
-	-I${abs_srcdir}/../../pm/utils \
-	-I${abs_srcdir}/../include \
-	-I../include \
-	-I${abs_srcdir}/../utils \
-	-I${abs_srcdir}/../../demux
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/bootstrap/slurm/Makefile.mk
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/bootstrap/slurm/Makefile.mk (revision 4870)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/bootstrap/slurm/Makefile.mk (revision 4870)
@@ -0,0 +1,10 @@
+# -*- Mode: Makefile; -*-
+#
+# (C) 2008 by Argonne National Laboratory.
+#     See COPYRIGHT in top-level directory.
+#
+
+libhydra_a_SOURCES += $(top_srcdir)/bootstrap/slurm/slurm_init.c \
+	$(top_srcdir)/bootstrap/slurm/slurm_launch.c \
+	$(top_srcdir)/bootstrap/slurm/slurm_query_node_list.c \
+	$(top_srcdir)/bootstrap/slurm/slurm_query_partition_id.c
Index: /ich2/branches/dev/kumudb/src/pm/hydra/bootstrap/slurm/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/bootstrap/slurm/Makefile.sm (revision 4726)
+++  (revision )
@@ -1,20 +1,0 @@
-# -*- Mode: Makefile; -*-
-#
-# (C) 2008 by Argonne National Laboratory.
-#     See COPYRIGHT in top-level directory.
-#
-
-HYDRA_LIB_PATH = ../../lib
-
-libhydra_a_DIR = ${HYDRA_LIB_PATH}
-libhydra_a_SOURCES = slurm_launch.c slurm_init.c slurm_query_partition_id.c \
-	slurm_query_node_list.c
-INCLUDES = -I${abs_srcdir}/../../include \
-	-I../../include \
-	-I${abs_srcdir}/../../mpl/include \
-	-I../../mpl/include \
-	-I${abs_srcdir}/../../pm/utils \
-	-I${abs_srcdir}/../include \
-	-I../include \
-	-I${abs_srcdir}/../utils \
-	-I${abs_srcdir}/../../demux
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/bootstrap/Makefile.mk
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/bootstrap/Makefile.mk (revision 4870)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/bootstrap/Makefile.mk (revision 4870)
@@ -0,0 +1,24 @@
+# -*- Mode: Makefile; -*-
+#
+# (C) 2008 by Argonne National Laboratory.
+#     See COPYRIGHT in top-level directory.
+#
+
+include bootstrap/src/Makefile.mk
+include bootstrap/utils/Makefile.mk
+
+if hydra_bss_ssh
+include bootstrap/ssh/Makefile.mk
+endif
+
+if hydra_bss_rsh
+include bootstrap/rsh/Makefile.mk
+endif
+
+if hydra_bss_fork
+include bootstrap/fork/Makefile.mk
+endif
+
+if hydra_bss_slurm
+include bootstrap/slurm/Makefile.mk
+endif
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/bootstrap/src/Makefile.mk
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/bootstrap/src/Makefile.mk (revision 4870)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/bootstrap/src/Makefile.mk (revision 4870)
@@ -0,0 +1,13 @@
+# -*- Mode: Makefile; -*-
+#
+# (C) 2008 by Argonne National Laboratory.
+#     See COPYRIGHT in top-level directory.
+#
+
+libhydra_a_SOURCES += $(top_builddir)/bootstrap/src/bsci_init.c \
+	$(top_srcdir)/bootstrap/src/bsci_finalize.c \
+	$(top_srcdir)/bootstrap/src/bsci_launch.c \
+	$(top_srcdir)/bootstrap/src/bsci_query_node_list.c \
+	$(top_srcdir)/bootstrap/src/bsci_query_partition_id.c \
+	$(top_srcdir)/bootstrap/src/bsci_usize.c \
+	$(top_srcdir)/bootstrap/src/bsci_wait.c
Index: /ich2/branches/dev/kumudb/src/pm/hydra/bootstrap/src/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/bootstrap/src/Makefile.sm (revision 4726)
+++  (revision )
@@ -1,20 +1,0 @@
-# -*- Mode: Makefile; -*-
-#
-# (C) 2008 by Argonne National Laboratory.
-#     See COPYRIGHT in top-level directory.
-#
-
-HYDRA_LIB_PATH = ../../lib
-
-libhydra_a_DIR = ${HYDRA_LIB_PATH}
-libhydra_a_SOURCES = bsci_init.c bsci_finalize.c bsci_usize.c bsci_wait.c bsci_launch.c \
-	bsci_query_node_list.c bsci_query_partition_id.c
-INCLUDES = -I${abs_srcdir}/../../include \
-	-I../../include \
-	-I${abs_srcdir}/../../mpl/include \
-	-I../../mpl/include \
-	-I${abs_srcdir}/../../pm/utils \
-	-I${abs_srcdir}/../include \
-	-I../include \
-	-I${abs_srcdir}/../utils \
-	-I${abs_srcdir}/../../demux
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/bootstrap/rsh/Makefile.mk
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/bootstrap/rsh/Makefile.mk (revision 4870)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/bootstrap/rsh/Makefile.mk (revision 4870)
@@ -0,0 +1,8 @@
+# -*- Mode: Makefile; -*-
+#
+# (C) 2008 by Argonne National Laboratory.
+#     See COPYRIGHT in top-level directory.
+#
+
+libhydra_a_SOURCES += $(top_srcdir)/bootstrap/rsh/rsh_init.c \
+	$(top_srcdir)/bootstrap/rsh/rsh_launch.c
Index: /ich2/branches/dev/kumudb/src/pm/hydra/bootstrap/rsh/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/bootstrap/rsh/Makefile.sm (revision 4726)
+++  (revision )
@@ -1,19 +1,0 @@
-# -*- Mode: Makefile; -*-
-#
-# (C) 2008 by Argonne National Laboratory.
-#     See COPYRIGHT in top-level directory.
-#
-
-HYDRA_LIB_PATH = ../../lib
-
-libhydra_a_DIR = ${HYDRA_LIB_PATH}
-libhydra_a_SOURCES = rsh_launch.c rsh_init.c
-INCLUDES = -I${abs_srcdir}/../../include \
-	-I../../include \
-	-I${abs_srcdir}/../../mpl/include \
-	-I../../mpl/include \
-	-I${abs_srcdir}/../../pm/utils \
-	-I${abs_srcdir}/../include \
-	-I../include \
-	-I${abs_srcdir}/../utils \
-	-I${abs_srcdir}/../../demux
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/bootstrap/ssh/Makefile.mk
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/bootstrap/ssh/Makefile.mk (revision 4870)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/bootstrap/ssh/Makefile.mk (revision 4870)
@@ -0,0 +1,8 @@
+# -*- Mode: Makefile; -*-
+#
+# (C) 2008 by Argonne National Laboratory.
+#     See COPYRIGHT in top-level directory.
+#
+
+libhydra_a_SOURCES += $(top_srcdir)/bootstrap/ssh/ssh_init.c \
+	$(top_srcdir)/bootstrap/ssh/ssh_launch.c
Index: /ich2/branches/dev/kumudb/src/pm/hydra/bootstrap/ssh/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/bootstrap/ssh/Makefile.sm (revision 4726)
+++  (revision )
@@ -1,19 +1,0 @@
-# -*- Mode: Makefile; -*-
-#
-# (C) 2008 by Argonne National Laboratory.
-#     See COPYRIGHT in top-level directory.
-#
-
-HYDRA_LIB_PATH = ../../lib
-
-libhydra_a_DIR = ${HYDRA_LIB_PATH}
-libhydra_a_SOURCES = ssh_launch.c ssh_init.c
-INCLUDES = -I${abs_srcdir}/../../include \
-	-I../../include \
-	-I${abs_srcdir}/../../mpl/include \
-	-I../../mpl/include \
-	-I${abs_srcdir}/../../pm/utils \
-	-I${abs_srcdir}/../include \
-	-I../include \
-	-I${abs_srcdir}/../utils \
-	-I${abs_srcdir}/../../demux
Index: /ich2/branches/dev/kumudb/src/pm/hydra/bootstrap/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/bootstrap/Makefile.sm (revision 4357)
+++  (revision )
@@ -1,8 +1,0 @@
-# -*- Mode: Makefile; -*-
-#
-# (C) 2008 by Argonne National Laboratory.
-#     See COPYRIGHT in top-level directory.
-#
-
-SUBDIRS_hydra_bss_names = ssh rsh fork slurm
-SUBDIRS = utils src @hydra_bss_names@ .
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/ui/utils/Makefile.mk
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/ui/utils/Makefile.mk (revision 4870)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/ui/utils/Makefile.mk (revision 4870)
@@ -0,0 +1,7 @@
+# -*- Mode: Makefile; -*-
+#
+# (C) 2008 by Argonne National Laboratory.
+#     See COPYRIGHT in top-level directory.
+#
+
+libui_a_SOURCES += $(top_srcdir)/ui/utils/uiu.c
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/ui/utils/uiu.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/ui/utils/uiu.c (revision 4683)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/ui/utils/uiu.c (revision 4870)
@@ -32,9 +32,8 @@
     HYD_handle.bootstrap_exec = NULL;
 
-    HYD_handle.global_env = NULL;
+    HYD_handle.inherited_env = NULL;
     HYD_handle.system_env = NULL;
     HYD_handle.user_env = NULL;
     HYD_handle.prop = HYD_ENV_PROP_UNSET;
-    HYD_handle.prop_env = NULL;
 
     HYD_handle.stdin_cb = NULL;
@@ -77,6 +76,6 @@
         HYDU_FREE(HYD_handle.bootstrap_exec);
 
-    if (HYD_handle.global_env)
-        HYDU_env_free_list(HYD_handle.global_env);
+    if (HYD_handle.inherited_env)
+        HYDU_env_free_list(HYD_handle.inherited_env);
 
     if (HYD_handle.system_env)
@@ -85,7 +84,4 @@
     if (HYD_handle.user_env)
         HYDU_env_free_list(HYD_handle.user_env);
-
-    if (HYD_handle.prop_env)
-        HYDU_env_free_list(HYD_handle.prop_env);
 
     if (HYD_handle.exec_info_list)
@@ -108,63 +104,27 @@
     HYDU_FUNC_ENTER();
 
-    if (HYD_handle.prop == HYD_ENV_PROP_ALL) {
-        HYD_handle.prop_env = HYDU_env_list_dup(HYD_handle.global_env);
+    if (HYD_handle.prop == HYD_ENV_PROP_LIST) {
         for (env = HYD_handle.user_env; env; env = env->next) {
-            status = HYDU_append_env_to_list(*env, &HYD_handle.prop_env);
-            HYDU_ERR_POP(status, "unable to add env to list\n");
-        }
-    }
-    else if (HYD_handle.prop == HYD_ENV_PROP_NONE) {
-        for (env = HYD_handle.user_env; env; env = env->next) {
-            status = HYDU_append_env_to_list(*env, &HYD_handle.prop_env);
-            HYDU_ERR_POP(status, "unable to add env to list\n");
-        }
-    }
-    else if (HYD_handle.prop == HYD_ENV_PROP_LIST) {
-        for (env = HYD_handle.user_env; env; env = env->next) {
-            run = HYDU_env_lookup(*env, HYD_handle.global_env);
+            run = HYDU_env_lookup(*env, HYD_handle.inherited_env);
             if (run) {
-                status = HYDU_append_env_to_list(*run, &HYD_handle.prop_env);
+                /* Dump back the updated environment to the user list */
+                status = HYDU_append_env_to_list(*run, &HYD_handle.user_env);
                 HYDU_ERR_POP(status, "unable to add env to list\n");
             }
         }
     }
-    else if (HYD_handle.prop == HYD_ENV_PROP_UNSET) {
-        for (env = HYD_handle.user_env; env; env = env->next) {
-            status = HYDU_append_env_to_list(*env, &HYD_handle.prop_env);
-            HYDU_ERR_POP(status, "unable to add env to list\n");
-        }
-    }
 
     exec_info = HYD_handle.exec_info_list;
     while (exec_info) {
-        if (exec_info->prop == HYD_ENV_PROP_ALL) {
-            exec_info->prop_env = HYDU_env_list_dup(HYD_handle.global_env);
+        if (exec_info->prop == HYD_ENV_PROP_LIST) {
             for (env = exec_info->user_env; env; env = env->next) {
-                status = HYDU_append_env_to_list(*env, &exec_info->prop_env);
-                HYDU_ERR_POP(status, "unable to add env to list\n");
-            }
-        }
-        else if (exec_info->prop == HYD_ENV_PROP_NONE) {
-            for (env = exec_info->user_env; env; env = env->next) {
-                status = HYDU_append_env_to_list(*env, &exec_info->prop_env);
-                HYDU_ERR_POP(status, "unable to add env to list\n");
-            }
-        }
-        else if (exec_info->prop == HYD_ENV_PROP_LIST) {
-            for (env = exec_info->user_env; env; env = env->next) {
-                run = HYDU_env_lookup(*env, HYD_handle.global_env);
+                run = HYDU_env_lookup(*env, HYD_handle.inherited_env);
                 if (run) {
-                    status = HYDU_append_env_to_list(*run, &exec_info->prop_env);
+                    /* Dump back the updated environment to the user list */
+                    status = HYDU_append_env_to_list(*run, &exec_info->user_env);
                     HYDU_ERR_POP(status, "unable to add env to list\n");
                 }
             }
         }
-        else if (exec_info->prop == HYD_ENV_PROP_UNSET) {
-            for (env = exec_info->user_env; env; env = env->next) {
-                status = HYDU_append_env_to_list(*env, &exec_info->prop_env);
-                HYDU_ERR_POP(status, "unable to add env to list\n");
-            }
-        }
         exec_info = exec_info->next;
     }
@@ -226,5 +186,5 @@
         partition->exec_list->proc_count = num_procs;
         partition->exec_list->prop = exec_info->prop;
-        partition->exec_list->prop_env = HYDU_env_list_dup(exec_info->prop_env);
+        partition->exec_list->user_env = HYDU_env_list_dup(exec_info->user_env);
     }
     else {
@@ -242,5 +202,5 @@
         exec->proc_count = num_procs;
         exec->prop = exec_info->prop;
-        exec->prop_env = HYDU_env_list_dup(exec_info->prop_env);
+        exec->user_env = HYDU_env_list_dup(exec_info->user_env);
     }
 
@@ -268,17 +228,20 @@
     exec_info = HYD_handle.exec_info_list;
     partition_rem_procs = partition->partition_core_count;
-    exec_rem_procs = exec_info->exec_proc_count;
-    while (1) {
+    exec_rem_procs = exec_info ? exec_info->exec_proc_count : 0;
+    while (exec_info) {
         if (exec_rem_procs <= partition_rem_procs) {
             status = add_exec_info_to_partition(exec_info, partition, exec_rem_procs);
             HYDU_ERR_POP(status, "unable to add executable to partition\n");
 
-            partition_rem_procs -= exec_info->exec_proc_count;
-            if (partition_rem_procs == 0)
-                partition = HYD_handle.partition_list;
+            partition_rem_procs -= exec_rem_procs;
+            if (partition_rem_procs == 0) {
+                partition = partition->next;
+                if (partition == NULL)
+                    partition = HYD_handle.partition_list;
+                partition_rem_procs = partition->partition_core_count;
+            }
 
             exec_info = exec_info->next;
-            if (exec_info == NULL)
-                break;
+            exec_rem_procs = exec_info ? exec_info->exec_proc_count : 0;
         }
         else {
@@ -332,5 +295,5 @@
     HYDU_Dump("  Global environment:\n");
     HYDU_Dump("  -------------------\n");
-    for (env = HYD_handle.global_env; env; env = env->next)
+    for (env = HYD_handle.inherited_env; env; env = env->next)
         HYDU_Dump("    %s=%s\n", env->env_name, env->env_value);
 
Index: /ich2/branches/dev/kumudb/src/pm/hydra/ui/utils/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/ui/utils/Makefile.sm (revision 4726)
+++  (revision )
@@ -1,16 +1,0 @@
-# -*- Mode: Makefile; -*-
-#
-# (C) 2008 by Argonne National Laboratory.
-#     See COPYRIGHT in top-level directory.
-#
-
-HYDRA_LIB_PATH = ../../lib
-
-libhydra_a_DIR = ${HYDRA_LIB_PATH}
-libhydra_a_SOURCES = uiu.c
-INCLUDES = -I${abs_srcdir}/../../include \
-	-I../../include \
-	-I${abs_srcdir}/../../mpl/include \
-	-I../../mpl/include \
-	-I${abs_srcdir}/../../rmk/include \
-	-I../../rmk/include
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/ui/Makefile.mk
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/ui/Makefile.mk (revision 4870)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/ui/Makefile.mk (revision 4870)
@@ -0,0 +1,11 @@
+# -*- Mode: Makefile; -*-
+#
+# (C) 2008 by Argonne National Laboratory.
+#     See COPYRIGHT in top-level directory.
+#
+
+include ui/utils/Makefile.mk
+
+if hydra_ui_mpiexec
+include ui/mpiexec/Makefile.mk
+endif
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/ui/mpiexec/utils.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/ui/mpiexec/utils.c (revision 4677)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/ui/mpiexec/utils.c (revision 4870)
@@ -53,6 +53,6 @@
     HYD_UIU_init_params();
 
-    status = HYDU_list_global_env(&HYD_handle.global_env);
-    HYDU_ERR_POP(status, "unable to get the global env list\n");
+    status = HYDU_list_inherited_env(&HYD_handle.inherited_env);
+    HYDU_ERR_POP(status, "unable to get the inherited env list\n");
 
     if (argv[1] == NULL || IS_HELP(argv[1]))
@@ -753,5 +753,5 @@
             HYD_handle.binding = HYD_BIND_NONE;
 
-        /* Check environment for setting the global environment */
+        /* Check environment for setting the inherited environment */
         tmp = getenv("HYDRA_ENV");
         if (HYD_handle.prop == HYD_ENV_PROP_UNSET && tmp)
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/ui/mpiexec/Makefile.mk
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/ui/mpiexec/Makefile.mk (revision 4870)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/ui/mpiexec/Makefile.mk (revision 4870)
@@ -0,0 +1,20 @@
+# -*- Mode: Makefile; -*-
+#
+# (C) 2008 by Argonne National Laboratory.
+#     See COPYRIGHT in top-level directory.
+#
+
+bin_PROGRAMS += mpiexec
+
+mpiexec_SOURCES = $(top_srcdir)/ui/mpiexec/callback.c \
+	$(top_srcdir)/ui/mpiexec/mpiexec.c \
+	$(top_srcdir)/ui/mpiexec/utils.c
+mpiexec_LDADD = libui.a libpm.a libhydra.a
+mpiexec_CFLAGS = -I$(top_srcdir)/ui/utils
+
+install-alt-ui: mpiexec
+	@if [ ! -d $(DESTDIR)${bindir} ] ; then \
+	    echo "$(mkdir_p) $(DESTDIR)${bindir} " ;\
+	    $(mkdir_p) $(DESTDIR)${bindir} ;\
+	fi
+	$(INSTALL_PROGRAM) $(INSTALL_STRIP_FLAG) mpiexec $(DESTDIR)${bindir}/mpiexec.hydra
Index: /ich2/branches/dev/kumudb/src/pm/hydra/ui/mpiexec/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/ui/mpiexec/Makefile.sm (revision 4811)
+++  (revision )
@@ -1,39 +1,0 @@
-# -*- Mode: Makefile; -*-
-#
-# (C) 2008 by Argonne National Laboratory.
-#     See COPYRIGHT in top-level directory.
-#
-
-#mpiexec_SOURCES = mpiexec.c utils.c callback.c
-#mpiexec_LDADD = -L../../lib -lhydra -L../../mpl -lmpl
-#mpiexec_DEPADD = ../../mpl/libmpl.a
-#INCLUDES = -I${abs_srcdir}/../../include \
-#	-I../../include \
-#	-I${abs_srcdir}/../../mpl/include \
-#	-I../../mpl/include \
-#	-I${abs_srcdir}/../utils \
-#	-I${abs_srcdir}/../../rmk/include \
-#	-I../../rmk/include \
-#	-I${abs_srcdir}/../../pm/include \
-#	-I../../pm/include \
-#	-I${abs_srcdir}/../../demux
-#install_BIN = mpiexec
-
-# Use the mpich2-build-install target to include mpiexec in the build bin
-# directory (all pm's require these targets)
-#mpich2-build-install: install
-#mpich2-build-uninstall: uninstall
-
-# A special alternate installation target when using multiple process managers
-#install-alt: mpiexec
-#	@if [ ! -d $(DESTDIR)${bindir} ] ; then \
-#	    echo "mkdir -p $(DESTDIR)${bindir} " ;\
-#	    mkdir -p $(DESTDIR)${bindir} ;\
-#	fi
-#	$(INSTALL_PROGRAM) $(INSTALL_STRIP_FLAG) mpiexec $(DESTDIR)${bindir}/mpiexec.hydra
-
-# We use a dummy dependency to ensure that we always go to the util
-# directory to see if anything needs to be done
-#../../../util/libmpiexec.a: dummy
-#dummy:
-#	cd ../../../util && $(MAKE)
Index: /ich2/branches/dev/kumudb/src/pm/hydra/ui/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/ui/Makefile.sm (revision 4395)
+++  (revision )
@@ -1,11 +1,0 @@
-# -*- Mode: Makefile; -*-
-#
-# (C) 2008 by Argonne National Laboratory.
-#     See COPYRIGHT in top-level directory.
-#
-
-SUBDIRS_hydra_ui = mpiexec
-SUBDIRS = utils @hydra_ui@ .
-
-mpich2-build-install mpich2-build-uninstall install install-alt:
-	cd @hydra_ui@ && ${MAKE} $@
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/examples/binding.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/examples/binding.c (revision 4870)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/examples/binding.c (revision 4870)
@@ -0,0 +1,52 @@
+/* -*- Mode: C; c-basic-offset:4 ; -*- */
+/*
+ *  (C) 2008 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#define _GNU_SOURCE
+#include <sched.h>
+#include <stdio.h>
+#include "mpi.h"
+
+#define NUM_CPUS 4
+
+int main(int argc, char **argv)
+{
+    int rank, size, ret, i, num_cpus = -1;
+    cpu_set_t mask;
+
+    MPI_Init(&argc, &argv);
+    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+    MPI_Comm_size(MPI_COMM_WORLD, &size);
+
+    while (++argv && *argv) {
+        if (!strcmp(argv[0], "--num-cpus")) {
+            num_cpus = atoi(argv[1]);
+            argv += 2;
+        }
+        else if (!strcmp(argv[0], "--help") || !strcmp(argv[0], "-help") ||
+                 !strcmp(argv[0], "-h")) {
+            fprintf(stderr, "Usage: ./binding {--num-cpus [CPUs]}\n");
+            MPI_Abort(MPI_COMM_WORLD, -1);
+        }
+    }
+    if (num_cpus < 0)
+        num_cpus = NUM_CPUS;
+
+    CPU_ZERO(&mask);
+    ret = sched_getaffinity(getpid(), sizeof(cpu_set_t), &mask);
+    if (ret < 0) {
+        fprintf(stderr, "sched_getaffinity failure\n");
+        MPI_Abort(MPI_COMM_WORLD, -1);
+    }
+
+    printf("[%d] ", rank);
+    for (i = 0; i < num_cpus; i++)
+        printf("%d ", CPU_ISSET(i, &mask));
+    printf("\n");
+
+    MPI_Finalize();
+
+    return 0;
+}
Index: /ich2/branches/dev/kumudb/src/pm/hydra/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/Makefile.sm (revision 4734)
+++  (revision )
@@ -1,22 +1,0 @@
-# -*- Mode: Makefile; -*-
-#
-# (C) 2008 by Argonne National Laboratory.
-#     See COPYRIGHT in top-level directory.
-#
-
-SUBDIRS = mpl utils rmk bootstrap css demux pm ui .
-NOTSIMPLEMAKE_SUBDIRS = mpl
-
-all-preamble:
-	@if [ ! -d lib ] ; then mkdir lib ; fi
-
-mpich2-build-install mpich2-build-uninstall install install-alt:
-	cd ui && ${MAKE} $@
-	cd pm && ${MAKE} $@
-
-clean-preamble:
-	${MAKE} cleanlibs
-
-# cleanlibs makes sure that we clean all of the library files
-cleanlibs:
-	rm -f lib/libhydra.a
Index: /mpich2/branches/dev/kumudb/src/pm/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/Makefile.sm (revision 3388)
+++ /mpich2/branches/dev/kumudb/src/pm/Makefile.sm (revision 4870)
@@ -2,5 +2,5 @@
 # (except for util, which is included so that simplemake will process
 # the Makefile.sm in that directory)
-SUBDIRS_pm_name = mpd smpd gforker remshell hydra
+SUBDIRS_pm_name = mpd smpd gforker remshell
 SUBDIRS = @pm_name@ @other_pm_names@ .
 # Remove PMPILIBNAME from the common make variables for the mpid
@@ -8,5 +8,5 @@
 smvarSubdir_commonmake=MPILIBNAME      = @MPILIBNAME@
 OTHER_DIRS = util
-NOTSIMPLEMAKE_SUBDIRS = mpd
+NOTSIMPLEMAKE_SUBDIRS = mpd hydra
 
 # We need to handle the case where the process manager is external to 
Index: /mpich2/branches/dev/kumudb/src/pm/remshell/configure.in
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/remshell/configure.in (revision 604)
+++ /mpich2/branches/dev/kumudb/src/pm/remshell/configure.in (revision 4870)
@@ -83,6 +83,6 @@
 dnl Find a C compiler (choose gcc first)
 AC_PROG_CC
-dnl Set CFLAGS for enable strict if necessary
-PAC_CC_STRICT
+
+PAC_ARG_STRICT
 AC_PROG_INSTALL
 PAC_PROG_MKDIR_P
Index: /mpich2/branches/dev/kumudb/src/pm/util/configure.in
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/util/configure.in (revision 4503)
+++ /mpich2/branches/dev/kumudb/src/pm/util/configure.in (revision 4870)
@@ -88,6 +88,6 @@
 dnl
 dnl     check for compiler characteristics
-dnl Set CFLAGS for enable strict if necessary
-PAC_CC_STRICT
+
+PAC_ARG_STRICT
 AC_C_CONST
 PAC_C_VOLATILE
Index: /mpich2/branches/dev/kumudb/src/util/logging/rlog/rlogutil.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/util/logging/rlog/rlogutil.c (revision 4707)
+++ /mpich2/branches/dev/kumudb/src/util/logging/rlog/rlogutil.c (revision 4870)
@@ -615,5 +615,5 @@
     if (pInput == NULL)
 	return -1;
-    MPIU_Memcpy(pHeader, &pInput->header, sizeof(RLOG_FILE_HEADER));
+    memcpy(pHeader, &pInput->header, sizeof(RLOG_FILE_HEADER));
     return 0;
 }
Index: /mpich2/branches/dev/kumudb/src/util/logging/rlog/irlogutil.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/util/logging/rlog/irlogutil.c (revision 4707)
+++ /mpich2/branches/dev/kumudb/src/util/logging/rlog/irlogutil.c (revision 4870)
@@ -136,5 +136,5 @@
 	num_valid = (int)(pInput->pEnd - pInput->pCurHeader);
 	if (pInput->pCurHeader != pInput->buffer)
-	    MPIU_Memcpy(pInput->buffer, pInput->pCurHeader, num_valid);
+	    memcpy(pInput->buffer, pInput->pCurHeader, num_valid);
 	ReadFileData(pInput->buffer + num_valid, sizeof(RLOG_HEADER) - num_valid, pInput->f);
 	pInput->pCurHeader = pInput->buffer;
@@ -144,5 +144,5 @@
 
     /* copy the current header into a temporary variable so the bytes can be manipulated */
-    MPIU_Memcpy(&pInput->header, pInput->pCurHeader, sizeof(RLOG_HEADER));
+    memcpy(&pInput->header, pInput->pCurHeader, sizeof(RLOG_HEADER));
     /*
     CLOGByteSwapDouble(&(header.timestamp), 1);
@@ -155,5 +155,5 @@
 	num_valid = (int)(pInput->pEnd - pInput->pCurHeader);
 	if (pInput->pCurHeader != pInput->buffer)
-	    MPIU_Memcpy(pInput->buffer, pInput->pCurHeader, num_valid);
+	    memcpy(pInput->buffer, pInput->pCurHeader, num_valid);
 	num_read = (int)fread(pInput->buffer + num_valid, 1, RLOG_BUFFSIZE - num_valid, pInput->f);
 	if (num_read == 0)
@@ -178,14 +178,14 @@
 	break;
     case RLOG_EVENT_TYPE:
-	MPIU_Memcpy(&pInput->record.event, pInput->pCurHeader + sizeof(RLOG_HEADER), sizeof(RLOG_EVENT));
+	memcpy(&pInput->record.event, pInput->pCurHeader + sizeof(RLOG_HEADER), sizeof(RLOG_EVENT));
 	break;
     case RLOG_IARROW_TYPE:
-	MPIU_Memcpy(&pInput->record.iarrow, pInput->pCurHeader + sizeof(RLOG_HEADER), sizeof(RLOG_IARROW));
+	memcpy(&pInput->record.iarrow, pInput->pCurHeader + sizeof(RLOG_HEADER), sizeof(RLOG_IARROW));
 	break;
     case RLOG_STATE_TYPE:
-	MPIU_Memcpy(&pInput->record.state, pInput->pCurHeader + sizeof(RLOG_HEADER), sizeof(RLOG_STATE));
+	memcpy(&pInput->record.state, pInput->pCurHeader + sizeof(RLOG_HEADER), sizeof(RLOG_STATE));
 	break;
     case RLOG_COMM_TYPE:
-	MPIU_Memcpy(&pInput->record.comm, pInput->pCurHeader + sizeof(RLOG_HEADER), sizeof(RLOG_COMM));
+	memcpy(&pInput->record.comm, pInput->pCurHeader + sizeof(RLOG_HEADER), sizeof(RLOG_COMM));
 	break;
     default:
@@ -207,5 +207,5 @@
 
     /* copy the record into the output buffer */
-    MPIU_Memcpy(pOutput->pCurHeader, pRecord, pRecord->length);
+    memcpy(pOutput->pCurHeader, pRecord, pRecord->length);
     /* advance the current position pointer */
     pOutput->pCurHeader = pOutput->pCurHeader + pRecord->length;
Index: /mpich2/branches/dev/kumudb/src/util/logging/rlog/trace_input.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/util/logging/rlog/trace_input.c (revision 4707)
+++ /mpich2/branches/dev/kumudb/src/util/logging/rlog/trace_input.c (revision 4870)
@@ -41,5 +41,5 @@
 	return RLOG_FALSE;
     *length = strlen(str);
-    MPIU_Memcpy(&base[*pos], str, *length);
+    memcpy(&base[*pos], str, *length);
     *pos += *length;
     return RLOG_TRUE;
Index: /mpich2/branches/dev/kumudb/src/util/logging/rlog/irlog2rlog.c
===================================================================
--- /mpich2/branches/dev/kumudb/src/util/logging/rlog/irlog2rlog.c (revision 4707)
+++ /mpich2/branches/dev/kumudb/src/util/logging/rlog/irlog2rlog.c (revision 4870)
@@ -329,5 +329,5 @@
 	{
 	    /* replace old with new */
-	    MPIU_Memcpy(&pIter->state, pState, sizeof(RLOG_STATE));
+	    memcpy(&pIter->state, pState, sizeof(RLOG_STATE));
 	    return;
 	}
@@ -336,5 +336,5 @@
 
     pIter = (RLOG_State_list*)MPIU_Malloc(sizeof(RLOG_State_list));
-    MPIU_Memcpy(&pIter->state, pState, sizeof(RLOG_STATE));
+    memcpy(&pIter->state, pState, sizeof(RLOG_STATE));
     pIter->next = g_pList;
     g_pList = pIter;
@@ -350,5 +350,5 @@
     if (pExt)
     {
-	MPIU_Memcpy(out_filename, filename, pExt-filename);
+	memcpy(out_filename, filename, pExt-filename);
 	strcpy(&out_filename[pExt-filename], ".rlog");
 	MPIU_Msg_printf("out_filename: %s\n", out_filename);
Index: /mpich2/branches/dev/kumudb/src/util/thread/posix_funcs.i
===================================================================
--- /mpich2/branches/dev/kumudb/src/util/thread/posix_funcs.i (revision 4617)
+++ /mpich2/branches/dev/kumudb/src/util/thread/posix_funcs.i (revision 4870)
@@ -61,5 +61,5 @@
 
 /* FIXME: using constant initializer if available */
-#if !defined(MPICH_DEBUG_MUTEX) || !defined(PTHREAD_MUTEX_ERRORCHECK_NP)
+#if !defined(MPICH_DEBUG_MUTEX) || !defined(PTHREAD_MUTEX_ERRORCHECK_VALUE)
 #define MPE_Thread_mutex_create(mutex_ptr_, err_ptr_)                   \
 {                                                                       \
Index: /mpich2/branches/dev/kumudb/README.vin
===================================================================
--- /mpich2/branches/dev/kumudb/README.vin (revision 4669)
+++ /mpich2/branches/dev/kumudb/README.vin (revision 4870)
@@ -381,36 +381,101 @@
 ===================
 
-MPICH2 can be configured with two sets of compiler flags: CFLAGS,
-CXXFLAGS, FFLAGS, F90FLAGS (abbreviated as xFLAGS) and
-MPICH2LIB_CFLAGS, MPICH2LIB_CXXFLAGS, MPICH2LIB_FFLAGS,
-MPICH2LIB_F90FLAGS (abbreviated as MPICH2LIB_xFLAGS) for compilation;
-LDFLAGS and MPICH2LIB_LDFLAGS for linking. All these flags can be set
-as part of configure command or through environment variables.
-(CPPFLAGS stands for C preprocessor flags, which should NOT be set)
-
-Both xFLAGS and MPICH2LIB_xFLAGS affect the compilation of the MPICH2
-libraries. However, only xFLAGS are appended to MPI wrapper scripts,
-mpicc and friends.
-
-MPICH2 libraries are built with default compiler optimization, -O2,
-which can be modified by --enable-fast configure option.  For
-instance, --disable-fast disables the default optimization option.
---enable-fast=O<n> sets default compiler optimization as -O<n>.  For
-more details of --enable-fast, see the output of "configure --help".
-Any other complicated optimization flags for MPICH2 libraries have to
-be set throught MPICH2LIB_xFLAGS.  CFLAGS and friends are empty by
-default.
-
-For example, to build a "production" MPICH2 environment with -O3 for all
-language bindings, one can simply do
+MPICH2 allows several sets of compiler flags to be used. The first
+three sets are configure-time options for MPICH2, while the fourth is
+only relevant when compiling applications with mpicc and friends.
+
+1. CFLAGS, CXXFLAGS, FFLAGS, F90FLAGS and LDFLAGS (abbreviated as
+xFLAGS): Setting these flags would result in the MPICH2 library being
+compiled/linked with these flags and the flags internally being used
+in mpicc and friends.
+
+2. MPICH2LIB_CFLAGS, MPICH2LIB_CXXFLAGS, MPICH2LIB_FFLAGS,
+MPICH2LIB_F90FLAGS and MPICH2LIB_LDFLAGS (abbreviated as
+MPICH2LIB_xFLAGS): Setting these flags would result in the MPICH2
+library being compiled/linked with these flags. However, these flags
+will *not* be used by mpicc and friends.
+
+3. MPICH2_MAKE_CFLAGS: Setting these flags would result in MPICH2's
+configure tests to not use these flags, but the makefile's to use
+them. This is a temporary hack for certain cases that advanced
+developers might be interested in which break existing configure tests
+(e.g., -Werror) and are not recommended for regular users.
+
+4. MPICH2_MPICC_FLAGS, MPICH2_MPICXX_FLAGS, MPICH2_MPIF77_FLAGS,
+MPICH2_MPIF90_FLAGS and MPICH2_LDFLAGS (abbreviated as
+MPICH2_MPIX_FLAGS): These flags do *not* affect the compilation of the
+MPICH2 library itself, but will be internally used by mpicc and
+friends.
+
+
+  +--------------------------------------------------------------------+
+  |                    |                      |                        |
+  |                    |    MPICH2 library    |    mpicc and friends   |
+  |                    |                      |                        |
+  +--------------------+----------------------+------------------------+
+  |                    |                      |                        |
+  |     xFLAGS         |         Yes          |           Yes          |
+  |                    |                      |                        |
+  +--------------------+----------------------+------------------------+
+  |                    |                      |                        |
+  |  MPICH2LIB_xFLAGS  |         Yes          |           No           |
+  |                    |                      |                        |
+  +--------------------+----------------------+------------------------+
+  |                    |                      |                        |
+  | MPICH2_MAKE_xFLAGS |         Yes          |           No           |
+  |                    |                      |                        |
+  +--------------------+----------------------+------------------------+
+  |                    |                      |                        |
+  | MPICH2_MPIX_FLAGS  |         No           |           Yes          |
+  |                    |                      |                        |
+  +--------------------+----------------------+------------------------+
+
+
+All these flags can be set as part of configure command or through
+environment variables. (CPPFLAGS stands for C preprocessor flags,
+which should NOT be set)
+
+
+Default flags
+--------------
+By default, MPICH2 automatically adds certain compiler optimizations
+to MPICH2LIB_CFLAGS. The currently used optimization level is -O2.
+
+** IMPORTANT NOTE: Remember that this only affects the compilation of
+the MPICH2 library and is not used in the wrappers (mpicc and friends)
+that are used to compile your applications or other libraries.
+
+This optimization level can be changed with the --enable-fast option
+passed to configure. For example, to build an MPICH2 environment with
+-O3 for all language bindings, one can simply do:
 
   ./configure --enable-fast=O3
 
-or
+Or to disable all compiler optimizations, one can do:
+
+  ./configure --disable-fast
+
+For more details of --enable-fast, see the output of "configure
+--help".
+
+
+Examples
+--------
+
+Example 1:
 
   ./configure --disable-fast MPICH2LIB_CFLAGS=-O3 MPICH2LIB_FFLAGS=-O3 MPICH2LIB_CXXFLAGS=-O3 MPICH2LIB_F90FLAGS=-O3
 
-This will cause the MPICH2 libraries to be built with -O3, and -O3 will
-not be included in the mpicc and other MPI wrapper script.
+This will cause the MPICH2 libraries to be built with -O3, and -O3
+will *not* be included in the mpicc and other MPI wrapper script.
+
+Example 2:
+
+  ./configure --disable-fast CFLAGS=-O3 FFLAGS=-O3 CXXFLAGS=-O3 F90FLAGS=-O3
+
+This will cause the MPICH2 libraries to be built with -O3, and -O3
+will be included in the mpicc and other MPI wrapper script.
+
+Example 3:
 
 There are certain compiler flags that should not be used with MPICH2's
@@ -421,8 +486,8 @@
 MPICH2_MAKE_CFLAGS as follows:
 
-  make VERBOSE=1 MPICH2_MAKE_CFLAGS="-Wall -Werror"
-
-(assuming CC is set to gcc). The content of MPICH2_MAKE_CFLAGS is
-appended to the CFLAGS in almost all Makefiles.
+  make MPICH2_MAKE_CFLAGS="-Wall -Werror"
+
+The content of MPICH2_MAKE_CFLAGS is appended to the CFLAGS in all
+relevant Makefiles.
 
 -------------------------------------------------------------------------
Index: /mpich2/branches/dev/kumudb/RELEASE_NOTES
===================================================================
--- /mpich2/branches/dev/kumudb/RELEASE_NOTES (revision 4209)
+++ /mpich2/branches/dev/kumudb/RELEASE_NOTES (revision 4870)
@@ -45,10 +45,4 @@
 
 ### Other configure options
-
- * The "--enable-strict" configure option is broken when using
-   sigaction and friends; this causes some of the process managers
-   (e.g., hydra, remshell) to not work
-   correctly. "--enable-strict=posix" is the recommended configure
-   option.
 
  * --enable-sharedlibs=gcc does not work on Solaris because of
Index: /mpich2/branches/dev/kumudb/confdb/aclocal_bugfix.m4
===================================================================
--- /mpich2/branches/dev/kumudb/confdb/aclocal_bugfix.m4 (revision 3619)
+++ /mpich2/branches/dev/kumudb/confdb/aclocal_bugfix.m4 (revision 4870)
@@ -53,5 +53,5 @@
 dnl D*/
 undefine([AC_CONFIG_AUX_DIRS])
-AC_DEFUN(AC_CONFIG_AUX_DIRS,
+AC_DEFUN([AC_CONFIG_AUX_DIRS],
 [if test -f $CONFIG_AUX_DIR/install-sh ; then ac_aux_dir=$CONFIG_AUX_DIR 
 else
@@ -96,5 +96,5 @@
 dnl 
 dnl undefine([AC_CHECK_HEADER])
-AC_DEFUN(PAC_OLD_CHECK_HEADER,
+AC_DEFUN([PAC_OLD_CHECK_HEADER],
 [dnl Do the transliteration at runtime so arg 1 can be a shell variable.
 ac_safe=`echo "$1" | sed 'y%./+-%__p_%'`
Index: /mpich2/branches/dev/kumudb/confdb/aclocal_cc.m4
===================================================================
--- /mpich2/branches/dev/kumudb/confdb/aclocal_cc.m4 (revision 4581)
+++ /mpich2/branches/dev/kumudb/confdb/aclocal_cc.m4 (revision 4870)
@@ -23,5 +23,5 @@
 dnl 2.52 doesn't have AC_PROG_CC_GNU
 ifdef([AC_PROG_CC_GNU],,[AC_DEFUN([AC_PROG_CC_GNU],)])
-AC_DEFUN(PAC_PROG_CC,[
+AC_DEFUN([PAC_PROG_CC],[
 AC_PROVIDE([AC_PROG_CC])
 AC_CHECK_PROGS(CC, cc xlC xlc pgcc icc pathcc gcc )
@@ -57,5 +57,5 @@
 dnl variable containing the option name as the first argument.
 dnl D*/
-AC_DEFUN(PAC_C_CHECK_COMPILER_OPTION,[
+AC_DEFUN([PAC_C_CHECK_COMPILER_OPTION],[
 AC_MSG_CHECKING([whether C compiler accepts option $1])
 save_CFLAGS="$CFLAGS"
@@ -145,5 +145,5 @@
 dnl optimization.  
 dnl D*/
-AC_DEFUN(PAC_C_OPTIMIZATION,[
+AC_DEFUN([PAC_C_OPTIMIZATION],[
     for copt in "-O4 -Ofast" "-Ofast" "-fast" "-O3" "-xO3" "-O" ; do
         PAC_C_CHECK_COMPILER_OPTION($copt,found_opt=yes,found_opt=no)
@@ -221,5 +221,5 @@
 dnl includes, such as /usr/xxxx and /opt/xxxx
 dnl
-AC_DEFUN(PAC_C_DEPENDS,[
+AC_DEFUN([PAC_C_DEPENDS],[
 AC_SUBST(C_DEPEND_OPT)AM_IGNORE(C_DEPEND_OPT)
 AC_SUBST(C_DEPEND_OUT)AM_IGNORE(C_DEPEND_OUT)
@@ -325,5 +325,5 @@
 dnl
 dnl D*/
-AC_DEFUN(PAC_C_PROTOTYPES,[
+AC_DEFUN([PAC_C_PROTOTYPES],[
 AC_CACHE_CHECK([whether $CC supports function prototypes],
 pac_cv_c_prototypes,[
@@ -350,5 +350,5 @@
 dnl D*/ 
 dnl Check for semctl and arguments
-AC_DEFUN(PAC_FUNC_SEMCTL,[
+AC_DEFUN([PAC_FUNC_SEMCTL],[
 AC_CHECK_FUNC(semctl)
 if test "$ac_cv_func_semctl" = "yes" ; then
@@ -389,5 +389,5 @@
 dnl
 dnl D*/
-AC_DEFUN(PAC_C_VOLATILE,[
+AC_DEFUN([PAC_C_VOLATILE],[
 AC_CACHE_CHECK([for volatile],
 pac_cv_c_volatile,[
@@ -409,5 +409,5 @@
 dnl
 dnl D*/
-AC_DEFUN(PAC_C_INLINE,[
+AC_DEFUN([PAC_C_INLINE],[
 AC_CACHE_CHECK([for inline],
 pac_cv_c_inline,[
@@ -511,5 +511,5 @@
 dnl
 dnl D*/
-AC_DEFUN(PAC_C_CPP_CONCAT,[
+AC_DEFUN([PAC_C_CPP_CONCAT],[
 pac_pound="#"
 AC_CACHE_CHECK([whether the compiler $CC accepts $ac_pound$ac_pound for concatenation in cpp],
@@ -535,5 +535,5 @@
 dnl
 dnl D*/
-AC_DEFUN(PAC_FUNC_GETTIMEOFDAY,[
+AC_DEFUN([PAC_FUNC_GETTIMEOFDAY],[
 AC_CACHE_CHECK([whether gettimeofday takes 2 arguments],
 pac_cv_func_gettimeofday,[
@@ -565,5 +565,5 @@
 dnl
 dnl D*/
-AC_DEFUN(PAC_C_RESTRICT,[
+AC_DEFUN([PAC_C_RESTRICT],[
 AC_CACHE_CHECK([for restrict],
 pac_cv_c_restrict,[
@@ -613,5 +613,5 @@
 dnl
 dnl D*/
-AC_DEFUN(PAC_HEADER_STDARG,[
+AC_DEFUN([PAC_HEADER_STDARG],[
 AC_CHECK_HEADER(stdarg.h)
 dnl Sets ac_cv_header_stdarg_h
@@ -692,5 +692,5 @@
 dnl
 dnl D*/
-AC_DEFUN(PAC_C_TRY_COMPILE_CLEAN,[
+AC_DEFUN([PAC_C_TRY_COMPILE_CLEAN],[
 $3=2
 dnl Get the compiler output to test against
@@ -753,5 +753,5 @@
 dnl 'action-if-unknown' is used in the case of cross-compilation.
 dnl D*/
-AC_DEFUN(PAC_PROG_C_UNALIGNED_DOUBLES,[
+AC_DEFUN([PAC_PROG_C_UNALIGNED_DOUBLES],[
 AC_CACHE_CHECK([whether C compiler allows unaligned doubles],
 pac_cv_prog_c_unaligned_doubles,[
@@ -813,5 +813,5 @@
 dnl 
 dnl D*/
-AC_DEFUN(PAC_PROG_C_WEAK_SYMBOLS,[
+AC_DEFUN([PAC_PROG_C_WEAK_SYMBOLS],[
 pragma_extra_message=""
 AC_CACHE_CHECK([for type of weak symbol alias support],
@@ -953,5 +953,5 @@
 ifdef([AC_PROG_CC_WORKS],,[AC_DEFUN([AC_PROG_CC_WORKS],)])
 dnl
-AC_DEFUN(PAC_PROG_CC_WORKS,
+AC_DEFUN([PAC_PROG_CC_WORKS],
 [AC_PROG_CC_WORKS
 AC_MSG_CHECKING([whether the C compiler sets its return status correctly])
@@ -975,5 +975,5 @@
 dnl 
 dnl D*/
-AC_DEFUN(PAC_PROG_C_MULTIPLE_WEAK_SYMBOLS,[
+AC_DEFUN([PAC_PROG_C_MULTIPLE_WEAK_SYMBOLS],[
 AC_CACHE_CHECK([for multiple weak symbol support],
 pac_cv_prog_c_multiple_weak_symbols,[
@@ -1034,5 +1034,5 @@
 dnl Defines NEED_CRYPT_PROTOTYPE if no prototype is found.
 dnl D*/
-AC_DEFUN(PAC_FUNC_CRYPT,[
+AC_DEFUN([PAC_FUNC_CRYPT],[
 AC_CACHE_CHECK([whether crypt defined in unistd.h],
 pac_cv_func_crypt_defined,[
@@ -1057,4 +1057,79 @@
 fi
 ])dnl
+
+dnl Use the value of enable-strict to update CFLAGS
+dnl pac_cc_strict_flags contains the strict flags.
+dnl
+dnl -std=c89 is used to select the C89 version of the ANSI/ISO C standard.
+dnl As of this writing, many C compilers still accepted only this version,
+dnl not the later C99 version. When all compilers accept C99, this 
+dnl should be changed to the appropriate standard level.  Note that we've
+dnl had trouble with gcc 2.95.3 accepting -std=c89 but then trying to 
+dnl compile program with a invalid set of options 
+dnl (-D __STRICT_ANSI__-trigraphs)
+AC_DEFUN([PAC_CC_STRICT],[
+export enable_strict_done
+if test "$enable_strict_done" != "yes" ; then
+
+    # Some comments on strict warning options.
+    # These were added to reduce warnings:
+    #   -Wno-missing-field-initializers  -- We want to allow a struct to be 
+    #       initialized to zero using "struct x y = {0};" and not require 
+    #       each field to be initialized individually.
+    #   -Wno-type-limits -- There are places where we compare an unsigned to 
+    #	    a constant that happens to be zero e.g., if x is unsigned and 
+    #	    MIN_VAL is zero, we'd like to do "MPIU_Assert(x >= MIN_VAL);".
+    #       Note this option is not supported by gcc 4.2.
+    #   -Wno-unused-parameter -- For portability, some parameters go unused
+    #	    when we have different implementations of functions for 
+    #	    different platforms
+    #   -Wno-unused-label -- We add fn_exit: and fn_fail: on all functions, 
+    #	    but fn_fail may not be used if the function doesn't return an 
+    #	    error.
+    # These were removed to reduce warnings:
+    #   -Wcast-qual -- Sometimes we need to cast "volatile char*" to 
+    #	    "char*", e.g., for memcpy.
+    #   -Wpadded -- We catch struct padding with asserts when we need to
+    #   -Wredundant-decls -- Having redundant declarations is benign and the 
+    #	    code already has some.
+
+    pac_common_strict_flags="-O2 -Wall -Wextra -Wno-missing-field-initializers -Wno-type-limits -Wstrict-prototypes -Wmissing-prototypes -DGCC_WALL -Wno-unused-parameter -Wno-unused-label -Wshadow -Wmissing-declarations -Wno-long-long -Wfloat-equal -Wdeclaration-after-statement -Wundef -Wno-endif-labels -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Wsign-compare -Waggregate-return -Wold-style-definition -Wmissing-noreturn -Wmissing-format-attribute -Wno-multichar -Wno-deprecated-declarations -Wpacked -Wnested-externs -Winline -Winvalid-pch -Wno-pointer-sign -Wvariadic-macros -std=c89"
+    pac_cc_strict_flags=""
+    case "$1" in 
+        yes|all|posix)
+		enable_strict_done="yes"
+		pac_cc_strict_flags="$pac_common_strict_flags -D_POSIX_C_SOURCE=199506L"
+        ;;
+
+        noposix)
+		enable_strict_done="yes"
+		pac_cc_strict_flags="$pac_common_strict_flags"
+        ;;
+        
+        no)
+		# Accept and ignore this value
+		:
+        ;;
+
+        *)
+		if test -n "$1" ; then
+		   AC_MSG_WARN([Unrecognized value for enable-strict:$1])
+		fi
+        ;;
+
+    esac
+
+    # See if the above options work with the compiler
+    accepted_flags=""
+    for flag in $pac_cc_strict_flags ; do
+    	old_CFLAGS=$CFLAGS
+	CFLAGS="$CFLAGS $accepted_flags $flag"
+	AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[int a;])],accepted_flags="$accepted_flags $flag",)
+	CFLAGS="$old_CFLAGS"
+    done
+    pac_cc_strict_flags=$accepted_flags
+fi
+])
+
 dnl/*D
 dnl PAC_ARG_STRICT - Add --enable-strict to configure.  
@@ -1064,327 +1139,15 @@
 dnl 
 dnl Output effects:
-dnl Adds '--enable-strict' to the command line.  If this is enabled, then
-dnl if no compiler has been set, set 'CC' to 'gcc'.
-dnl If the compiler is 'gcc', 'COPTIONS' is set to include
-dnl.vb
-dnl	-O -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Werror=pointer-arith -DGCC_WALL -std=c89
-dnl.ve
-dnl This makes using a void * with pointer arithmetic an error, not a warning.
-dnl We do this because pointer arithmetic with void * is not valid C but
-dnl gcc accepts this unless these particular optiones are used.
-dnl Grr. -Werror=name is a recent addition to gcc, so we can't require it yet.
-dnl
-dnl -std=c89 is used to select the C89 version of the ANSI/ISO C standard.
-dnl As of this writing, many C compilers still accepted only this version,
-dnl not the later C99 version.  When all compilers accept C99, this 
-dnl should be changed to the appropriate standard level.  Note that we've
-dnl had trouble with gcc 2.95.3 accepting -std=c89 but then trying to 
-dnl compile program with a invalid set of options 
-dnl (-D __STRICT_ANSI__-trigraphs)
-dnl
-dnl If the value 'all' is given to '--enable-strict', additional warning
-dnl options are included.  These are
-dnl.vb
-dnl -Wunused -Wshadow -Wmissing-declarations -Wno-long-long
-dnl.ve
-dnl 
-dnl If the value 'noopt' is given to '--enable-strict', no optimization
-dnl options are set.  For some compilers (including gcc), this may 
-dnl cause some strict complication tests to be skipped (typically, these are
-dnl tests for unused variables or variables used before they are defined).
-dnl
-dnl If the value 'posix' is given to '--enable-strict', POSIX is selected
-dnl as the C dialect (including the definition for the POSIX level)
-dnl
-dnl If the value 'all' is given to '--enable-strict', use the "GNU" Unix
-dnl dialect.  This permits the use of stricter checking for declarations of
-dnl system functions (note that fsync is not defined in strict, non-real-time
-dnl POSIX).  This level includes
-dnl .vb
-dnl -Werror-implicit-function-declaration
-dnl .ve
-dnl 
-dnl This only works where 'gcc' is available.
-dnl In addition, it exports the variable 'enable_strict_done'. This
-dnl ensures that subsidiary 'configure's do not add the above flags to
-dnl 'COPTIONS' once the top level 'configure' sees '--enable-strict'.  To ensure
-dnl this, 'COPTIONS' is also exported.
-dnl
-dnl Not yet available: options when using other compilers.  However, 
-dnl here are some possible choices
-dnl Solaris cc
-dnl  -fd -v -Xc
-dnl -Xc is strict ANSI (some version) and does not allow "long long", for 
-dnl example
-dnl IRIX
-dnl  -ansi -DEBUG:trap_uninitialized=ON:varargs_interface_check=ON:verbose_runtime=ON
+dnl Adds '--enable-strict' to the command line.
 dnl
 dnl D*/
-AC_DEFUN(PAC_ARG_STRICT,[
+AC_DEFUN([PAC_ARG_STRICT],[
 AC_ARG_ENABLE(strict,
 [--enable-strict  - Turn on strict compilation testing when using gcc])
-saveCFLAGS="$CFLAGS"
-if test "$enable_strict_done" != "yes" ; then
-    if test -z "$GCC_OPTFLAG" ; then GCC_OPTFLAG="-O2" ; fi
-    if test -z "CC" ; then
-        AC_CHECK_PROGS(CC,gcc)
-    fi
-    case "$enable_strict" in 
-	yes)
-        enable_strict_done="yes"
-        if test "$CC" = "gcc" ; then 
-            COPTIONS="${COPTIONS} -Wall $GCC_OPTFLAG -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -DGCC_WALL -std=c89"
-        fi
-	;;
-	all)
-        enable_strict_done="yes"
-        if test "$CC" = "gcc" ; then 
-	    # Note that -Wall does not include all of the warnings that
-	    # the gcc documentation claims that it does; in particular,
-	    # the -Wunused-parameter option is *not* part of -Wall
-	    # -Wextra (if available) adds some to -Wall (!)
-	    # -Wsystem-headers removed because of too many warning messages
-	    # that are unfixable by the user of this option (the warnings
-	    # often show benign but real problems)
-	    # -Wunreachable-code has a serious bug and falsely reports 
-	    # labels as unreachable code.  This makes that option useless
-	    # for the MPICH2 code, for example
-            COPTIONS="${COPTIONS} -Wall -Wextra $GCC_OPTFLAG -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -DGCC_WALL -Wunused -Wshadow -Wmissing-declarations -Werror-implicit-function-declaration -Wno-long-long -Wunused-parameter -Wunused-value -Wfloat-equal -Wdeclaration-after-statement -Wundef -Wno-endif-labels -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wsign-compare -Waggregate-return -Wold-style-definition -Wmissing-field-initializers -Wmissing-noreturn -Wmissing-format-attribute -Wno-multichar -Wno-deprecated-declarations -Wpacked -Wpadded -Wredundant-decls -Wnested-externs -Winline -Winvalid-pch -Wno-pointer-sign -Wvariadic-macros -std=c89"
-        fi
-	;;
-
-	# The MPICH2 code has several modules that have duplicate 
-	# function declarations.  The resulting list of warnings is
-	# swamped by those duplicates, rendering the output nearly
-	# useless.  This temporary option choice is the same as
-	# --enable-strict=all, but without that one option
-	allbutdupdefs)
-        enable_strict_done="yes"
-        if test "$CC" = "gcc" ; then 
-	    # Note that -Wall does not include all of the warnings that
-	    # the gcc documentation claims that it does; in particular,
-	    # the -Wunused-parameter option is *not* part of -Wall
-	    # -Wextra (if available) adds some to -Wall (!)
-	    # -Wsystem-headers removed because of too many warning messages
-	    # that are unfixable by the user of this option (the warnings
-	    # often show benign but real problems)
-	    # -Wunreachable-code has a serious bug and falsely reports 
-	    # labels as unreachable code.  This makes that option useless
-	    # for the MPICH2 code, for example
-            COPTIONS="${COPTIONS} -Wall -Wextra $GCC_OPTFLAG -Wstrict-prototypes -Wmissing-prototypes -DGCC_WALL -Wunused -Wshadow -Wmissing-declarations -Werror-implicit-function-declaration -Wno-long-long -Wunused-parameter -Wunused-value -Wfloat-equal -Wdeclaration-after-statement -Wundef -Wno-endif-labels -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wsign-compare -Waggregate-return -Wold-style-definition -Wmissing-field-initializers -Wmissing-noreturn -Wmissing-format-attribute -Wno-multichar -Wno-deprecated-declarations -Wpacked -Wpadded -Wnested-externs -Winline -Winvalid-pch -Wno-pointer-sign -Wvariadic-macros -std=c89"
-        fi
-	;;
-
-	posix)
-	# fsync is a part of POSIX only in the real-time extensions, 
-	# apparently, so code that used include <unistd.h> and POSIX
-	# and expects fsync to be defined is in trouble.  Because of that
-	# we're not including the -W option to error if a function is
-	# not prototyped.
-	enable_strict_done="yes"
-        if test "$CC" = "gcc" ; then
-            COPTIONS="${COPTIONS} -Wall $GCC_OPTFLAG -Wstrict-prototypes -Wmissing-prototypes -Wundef -Wpointer-arith -Wbad-function-cast -ansi -DGCC_WALL -D_POSIX_C_SOURCE=199506L -std=c89"
-    	fi
- 	;;	
-	
-	noopt)
-        enable_strict_done="yes"
-        if test "$CC" = "gcc" ; then 
-            COPTIONS="${COPTIONS} -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -DGCC_WALL -std=c89"
-        fi
-	;;
-	no)
-	# Accept and ignore this value
-	:
-	;;
-	*)
-	# Silently accept blank values for enable strict
-	if test -n "$enable_strict" ; then
-  	    AC_MSG_WARN([Unrecognized value for enable-strict:$enable_strict])
-	fi
-	;;
-    esac
-fi
-export enable_strict_done
-])
-dnl
-dnl Use the value of enable-strict to update CFLAGS
-dnl pac_cc_strict_flags contains the strict flags.
-dnl
-dnl -std=c89 is used to select the C89 version of the ANSI/ISO C standard.
-dnl As of this writing, many C compilers still accepted only this version,
-dnl not the later C99 version.  When all compilers accept C99, this 
-dnl should be changed to the appropriate standard level.  Note that we've
-dnl had trouble with gcc 2.95.3 accepting -std=c89 but then trying to 
-dnl compile program with a invalid set of options 
-dnl (-D __STRICT_ANSI__-trigraphs)
-dnl
-dnl 
-AC_DEFUN(PAC_CC_STRICT,[
-export enable_strict_done
-if test "$enable_strict_done" != "yes" ; then
-    # We must know the compiler type
-    if test -z "$GCC_OPTFLAG" ; then GCC_OPTFLAG="-O2" ; fi
-    if test -z "CC" ; then
-        AC_CHECK_PROGS(CC,gcc)
-    fi
-    pac_cc_strict_flags=""
-    case "$enable_strict" in 
-        yes)
-        enable_strict_done="yes"
-        if test "$ac_cv_prog_gcc" = "yes" ; then 
-            pac_cc_strict_flags="-Wall $GCC_OPTFLAG -Wstrict-prototypes -Wmissing-prototypes -Wundef -Wpointer-arith -Wbad-function-cast -ansi -DGCC_WALL"
-            CFLAGS="$CFLAGS $pac_cc_strict_flags"
-            AC_MSG_RESULT([Adding strict check arguments to CFLAGS])
-            AC_MSG_CHECKING([whether we can add -std=c89])
-            # See if we can add -std=c89
-            savCFLAGS=$CFLAGS
-            CFLAGS="$CFLAGS -std=c89"
-            AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[int a;])],
-                  stdc_ok=yes,
-                  stdc_ok=no)
-            AC_MSG_RESULT($stdc_ok)
-            if test "$stdc_ok" != yes ; then
-                CFLAGS="$savCFLAGS"
-            else
-                pac_cc_strict_flags="$pac_cc_strict_flags -std=c89"
-            fi
-        else 
-            AC_MSG_WARN([enable strict supported only for gcc])
-        fi
-        ;;
-
-        all)
-        enable_strict_done="yes"
-        if test "$ac_cv_prog_gcc" = "yes" ; then 
-	    # -Wsystem-headers removed because of too many warning messages
-	    # that are unfixable by the user of this option (the warnings
-	    # often show benign but real problems)
-	    # -Wunreachable-code has a serious bug and falsely reports 
-	    # labels as unreachable code.  This makes that option useless
-	    # for the MPICH2 code, for example
-	    # The next line was the original set of options; this 
-	    # worked with gcc version 2.x
-#            pac_cc_strict_flags="-Wall -Wextra $GCC_OPTFLAG -Wstrict-prototypes -Wmissing-prototypes -Wundef -Wpointer-arith -Wbad-function-cast -ansi -DGCC_WALL -Wunused -Wshadow -Wmissing-declarations -Wunused-parameter -Wunused-value -Wno-long-long -Werror-implicit-function-declaration"
-            pac_cc_strict_flags="-Wall -Wextra $GCC_OPTFLAG -Wstrict-prototypes -Wmissing-prototypes -DGCC_WALL -Wunused -Wshadow -Wmissing-declarations -Werror-implicit-function-declaration -Wno-long-long -Wunused-parameter -Wunused-value  -Wfloat-equal -Wdeclaration-after-statement -Wundef -Wno-endif-labels -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wsign-compare -Waggregate-return -Wold-style-definition -Wmissing-field-initializers -Wmissing-noreturn -Wmissing-format-attribute -Wno-multichar -Wno-deprecated-declarations -Wpacked -Wpadded -Wredundant-decls -Wnested-externs -Winline -Winvalid-pch -Wno-pointer-sign -Wvariadic-macros"
-            CFLAGS="$CFLAGS $pac_cc_strict_flags"
-            AC_MSG_CHECKING([whether we can add -std=c89])
-            # See if we can add -std=c89
-            savCFLAGS=$CFLAGS
-            CFLAGS="$CFLAGS -std=c89"
-            AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[int a;])],
-                  stdc_ok=yes,
-                  stdc_ok=no)
-            AC_MSG_RESULT($stdc_ok)
-            if test "$stdc_ok" != yes ; then
-                CFLAGS="$savCFLAGS"
-            else
-                pac_cc_strict_flags="$pac_cc_strict_flags -std=c89"
-            fi
-        else 
-            AC_MSG_WARN([enable strict supported only for gcc])
-        fi
-        ;;
-
-	# The MPICH2 code has several modules that have duplicate 
-	# function declarations.  The resulting list of warnings is
-	# swamped by those duplicates, rendering the output nearly
-	# useless.  This temporary option choice is the same as
-	# --enable-strict=all, but without that one option
-	allbutdupdefs)
-        enable_strict_done="yes"
-        if test "$ac_cv_prog_gcc" = "yes" ; then 
-	    # -Wsystem-headers removed because of too many warning messages
-	    # that are unfixable by the user of this option (the warnings
-	    # often show benign but real problems)
-	    # -Wunreachable-code has a serious bug and falsely reports 
-	    # labels as unreachable code.  This makes that option useless
-	    # for the MPICH2 code, for example
-	    # This next line contains the options used with gcc version 2.x
-#            pac_cc_strict_flags="-Wall -Wextra $GCC_OPTFLAG -Wstrict-prototypes -Wmissing-prototypes -Wundef -Wpointer-arith -Wbad-function-cast -ansi -DGCC_WALL -Wunused -Wshadow -Wmissing-declarations -Wunused-parameter -Wunused-value -Wno-long-long -Werror-implicit-function-declaration"
-            pac_cc_strict_flags="-Wall -Wextra $GCC_OPTFLAG -Wstrict-prototypes -Wmissing-prototypes -DGCC_WALL -Wunused -Wshadow -Wmissing-declarations -Werror-implicit-function-declaration -Wno-long-long -Wunused-parameter -Wunused-value  -Wfloat-equal -Wdeclaration-after-statement -Wundef -Wno-endif-labels -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wsign-compare -Waggregate-return -Wold-style-definition -Wmissing-field-initializers -Wmissing-noreturn -Wmissing-format-attribute -Wno-multichar -Wno-deprecated-declarations -Wpacked -Wpadded -Wnested-externs -Winline -Winvalid-pch -Wno-pointer-sign -Wvariadic-macros -std=c89"
-            CFLAGS="$CFLAGS $pac_cc_strict_flags"
-            AC_MSG_CHECKING([whether we can add -std=c89])
-            # See if we can add -std=c89
-            savCFLAGS=$CFLAGS
-            CFLAGS="$CFLAGS -std=c89"
-            AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[int a;])],
-                  stdc_ok=yes,
-                  stdc_ok=no)
-            AC_MSG_RESULT($stdc_ok)
-            if test "$stdc_ok" != yes ; then
-                CFLAGS="$savCFLAGS"
-            else
-                pac_cc_strict_flags="$pac_cc_strict_flags -std=c89"
-            fi
-        else 
-            AC_MSG_WARN([enable strict supported only for gcc])
-        fi
-        ;;
-
-        posix)
-	# fsync is a part of POSIX only in the real-time extensions, 
-	# apparently, so code that used include <unistd.h> and POSIX
-	# and expects fsync to be defined is in trouble.  Because of that
-	# we're not including the -W option to error if a function is
-	# not prototyped.
-        enable_strict_done="yes"
-        if test "$ac_cv_prog_gcc" = "yes" ; then 
-            pac_cc_strict_flags="-Wall $GCC_OPTFLAG -Wstrict-prototypes -Wmissing-prototypes -Wundef -Wpointer-arith -Wbad-function-cast -ansi -DGCC_WALL -D_POSIX_C_SOURCE=199506L"
-            CFLAGS="$CFLAGS $pac_cc_strict_flags"
-            AC_MSG_RESULT([Adding strict check arguments (POSIX flavor) to CFLAGS])
-            AC_MSG_CHECKING([whether we can add -std=c89])
-            # See if we can add -std=c89
-            savCFLAGS=$CFLAGS
-            CFLAGS="$CFLAGS -std=c89"
-            AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[int a;])],
-                  stdc_ok=yes,
-                  stdc_ok=no)
-            AC_MSG_RESULT($stdc_ok)
-            if test "$stdc_ok" != yes ; then
-                CFLAGS="$savCFLAGS"
-            else
-                pac_cc_strict_flags="$pac_cc_strict_flags -std=c89"
-            fi
-        else 
-            AC_MSG_WARN([enable strict supported only for gcc])
-        fi
-        ;;
-        
-        noopt)
-        enable_strict_done="yes"
-        if test "$ac_cv_prog_gcc" = "yes" ; then 
-            pac_cc_strict_flags="-Wall -Wstrict-prototypes -Wmissing-prototypes -Wundef -Wpointer-arith -Wbad-function-cast -ansi -DGCC_WALL"
-            CFLAGS="$CFLAGS $pac_cc_strict_flags"
-            AC_MSG_RESULT([Adding strict check arguments to CFLAGS])
-            AC_MSG_CHECKING([whether we can add -std=c89])
-            # See if we can add -std=c89
-            savCFLAGS=$CFLAGS
-            CFLAGS="$CFLAGS -std=c89"
-            AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[int a;])],
-                  stdc_ok=yes,
-                  stdc_ok=no)
-            AC_MSG_RESULT($stdc_ok)
-            if test "$stdc_ok" != yes ; then
-                CFLAGS="$savCFLAGS"
-            else
-                pac_cc_strict_flags="$pac_cc_strict_flags -std=c89"
-            fi
-        else 
-            AC_MSG_WARN([enable strict supported only for gcc])
-        fi
-        ;;
-        no)
-        # Accept and ignore this value
-        :
-        ;;
-        *)
-        if test -n "$enable_strict" ; then
-            AC_MSG_WARN([Unrecognized value for enable-strict:$enable_strict])
-        fi
-        ;;
-    esac
-fi
-])
+PAC_CC_STRICT($enable_strict)
+CFLAGS="$CFLAGS $pac_cc_strict_flags"
+export CFLAGS
+])
+
 dnl/*D
 dnl PAC_ARG_CC_G - Add debugging flags for the C compiler
@@ -1421,5 +1184,5 @@
 dnl
 dnl D*/
-AC_DEFUN(PAC_ARG_CC_G,[
+AC_DEFUN([PAC_ARG_CC_G],[
 AC_ARG_ENABLE(g,
 [--enable-g  - Turn on debugging of the package (typically adds -g to COPTIONS)])
@@ -1437,5 +1200,5 @@
 dnl Simple version for both options
 dnl
-AC_DEFUN(PAC_ARG_CC_COMMON,[
+AC_DEFUN([PAC_ARG_CC_COMMON],[
 PAC_ARG_CC_G
 PAC_ARG_STRICT
@@ -1476,5 +1239,5 @@
 dnl the system to find common symbols.
 dnl
-AC_DEFUN(PAC_PROG_C_BROKEN_COMMON,[
+AC_DEFUN([PAC_PROG_C_BROKEN_COMMON],[
 AC_CACHE_CHECK([whether global variables handled properly],
 ac_cv_prog_cc_globals_work,[
@@ -1557,5 +1320,5 @@
 dnl "Multiple cases:" return is possible.  
 dnl
-AC_DEFUN(PAC_C_STRUCT_ALIGNMENT,[
+AC_DEFUN([PAC_C_STRUCT_ALIGNMENT],[
 AC_CACHE_CHECK([for C struct alignment],pac_cv_c_struct_align,[
 AC_TRY_RUN([
@@ -1758,5 +1521,5 @@
 dnl In addition, a "Could not determine alignment" and a "error!"
 dnl return is possible.  
-AC_DEFUN(PAC_C_MAX_INTEGER_ALIGN,[
+AC_DEFUN([PAC_C_MAX_INTEGER_ALIGN],[
 AC_CACHE_CHECK([for max C struct integer alignment],
 pac_cv_c_max_integer_align,[
@@ -1890,5 +1653,5 @@
 dnl In addition, a "Could not determine alignment" and a "error!"
 dnl return is possible.  
-AC_DEFUN(PAC_C_MAX_FP_ALIGN,[
+AC_DEFUN([PAC_C_MAX_FP_ALIGN],[
 AC_CACHE_CHECK([for max C struct floating point alignment],
 pac_cv_c_max_fp_align,[
@@ -2005,5 +1768,5 @@
 dnl In addition, a "Could not determine alignment" and a "error!"
 dnl return is possible.  
-AC_DEFUN(PAC_C_MAX_DOUBLE_FP_ALIGN,[
+AC_DEFUN([PAC_C_MAX_DOUBLE_FP_ALIGN],[
 AC_CACHE_CHECK([for max C struct alignment of structs with doubles],
 pac_cv_c_max_double_fp_align,[
@@ -2076,5 +1839,5 @@
 fi
 ])
-AC_DEFUN(PAC_C_MAX_LONGDOUBLE_FP_ALIGN,[
+AC_DEFUN([PAC_C_MAX_LONGDOUBLE_FP_ALIGN],[
 AC_CACHE_CHECK([for max C struct floating point alignment with long doubles],
 pac_cv_c_max_longdouble_fp_align,[
@@ -2163,5 +1926,5 @@
 dnl Possible values currently include no and four.
 dnl
-AC_DEFUN(PAC_C_DOUBLE_ALIGNMENT_EXCEPTION,[
+AC_DEFUN([PAC_C_DOUBLE_ALIGNMENT_EXCEPTION],[
 AC_CACHE_CHECK([if double alignment breaks rules, find actual alignment],
 pac_cv_c_double_alignment_exception,[
@@ -2220,5 +1983,5 @@
 dnl Possible values include yes, no, and unknown.
 dnl
-AC_DEFUN(PAC_C_DOUBLE_POS_ALIGN,[
+AC_DEFUN([PAC_C_DOUBLE_POS_ALIGN],[
 AC_CACHE_CHECK([if alignment of structs with doubles is based on position],
 pac_cv_c_double_pos_align,[
@@ -2264,5 +2027,5 @@
 dnl Possible values include yes, no, and unknown.
 dnl
-AC_DEFUN(PAC_C_LLINT_POS_ALIGN,[
+AC_DEFUN([PAC_C_LLINT_POS_ALIGN],[
 AC_CACHE_CHECK([if alignment of structs with long long ints is based on position],
 pac_cv_c_llint_pos_align,[
@@ -2327,5 +2090,5 @@
 dnl 
 dnl D*/
-AC_DEFUN(PAC_FUNC_NEEDS_DECL,[
+AC_DEFUN([PAC_FUNC_NEEDS_DECL],[
 AC_CACHE_CHECK([whether $2 needs a declaration],
 pac_cv_func_decl_$2,[
@@ -2351,5 +2114,5 @@
 dnl autoheader can''t handle this case)
 dnl D*/
-AC_DEFUN(PAC_CHECK_SIZEOF_DERIVED,[
+AC_DEFUN([PAC_CHECK_SIZEOF_DERIVED],[
 changequote(<<,>>)dnl
 define(<<AC_TYPE_NAME>>,translit(sizeof_$1,[a-z *], [A-Z_P]))dnl
@@ -2381,5 +2144,5 @@
 dnl autoheader can''t handle this case)
 dnl D*/
-AC_DEFUN(PAC_CHECK_SIZEOF_2TYPES,[
+AC_DEFUN([PAC_CHECK_SIZEOF_2TYPES],[
 changequote(<<,>>)dnl
 define(<<AC_TYPE_NAME>>,translit(sizeof_$1,[a-z *], [A-Z_P]))dnl
Index: /mpich2/branches/dev/kumudb/confdb/aclocal_shl.m4
===================================================================
--- /mpich2/branches/dev/kumudb/confdb/aclocal_shl.m4 (revision 2977)
+++ /mpich2/branches/dev/kumudb/confdb/aclocal_shl.m4 (revision 4870)
@@ -52,5 +52,5 @@
 dnl search paths are specified and how shared library names are set.
 dnl D*/
-AC_DEFUN(PAC_ARG_SHAREDLIBS,[
+AC_DEFUN([PAC_ARG_SHAREDLIBS],[
 AC_ARG_ENABLE(sharedlibs,
 [--enable-sharedlibs=kind - Enable shared libraries.  kind may be
@@ -218,5 +218,5 @@
 dnl PAC_CC_SHAREDLIBS(type,CCvar,CLINKvar)
 dnl D*/
-AC_DEFUN(PAC_CC_SHAREDLIBS,
+AC_DEFUN([PAC_CC_SHAREDLIBS],
 [
 pac_kinds=$1
@@ -283,5 +283,5 @@
 dnl This is a more robust (and, in the case of libtool, only 
 dnl managable) method.
-AC_DEFUN(PAC_CC_SUBDIR_SHLIBS,[
+AC_DEFUN([PAC_CC_SUBDIR_SHLIBS],[
 	AC_SUBST(CC_SHL)
         AC_SUBST(C_LINK_SHL)
Index: /mpich2/branches/dev/kumudb/confdb/aclangf90.m4
===================================================================
--- /mpich2/branches/dev/kumudb/confdb/aclangf90.m4 (revision 974)
+++ /mpich2/branches/dev/kumudb/confdb/aclangf90.m4 (revision 4870)
@@ -985,5 +985,5 @@
 dnl
 dnl D*/
-AC_DEFUN(PAC_PROG_F90_INT_KIND,[
+AC_DEFUN([PAC_PROG_F90_INT_KIND],[
 # Set the default
 $1=-1
@@ -1104,5 +1104,5 @@
 dnl Internal routine for testing F90
 dnl PAC_PROG_F90_WORKS()
-AC_DEFUN(PAC_PROG_F90_WORKS,
+AC_DEFUN([PAC_PROG_F90_WORKS],
 [AC_MSG_CHECKING([for extension for Fortran 90 programs])
 pac_cv_f90_ext="f90"
@@ -1234,5 +1234,5 @@
 dnl   PAC_PROG_F90_HAS_POINTER(action-if-true,action-if-false)
 dnl D*/
-AC_DEFUN(PAC_PROG_F90_HAS_POINTER,[
+AC_DEFUN([PAC_PROG_F90_HAS_POINTER],[
 AC_CACHE_CHECK([whether Fortran 90 has Cray-style pointer declaration],
 pac_cv_prog_f90_has_pointer,[
Index: /mpich2/branches/dev/kumudb/confdb/aclocal_cxx.m4
===================================================================
--- /mpich2/branches/dev/kumudb/confdb/aclocal_cxx.m4 (revision 556)
+++ /mpich2/branches/dev/kumudb/confdb/aclocal_cxx.m4 (revision 4870)
@@ -11,5 +11,5 @@
 dnl sets dirname to the name of the template directory, or to empty
 dnl if it can not be determined.
-AC_DEFUN(PAC_PROG_CXX_TEMPLATE_DIR,[
+AC_DEFUN([PAC_PROG_CXX_TEMPLATE_DIR],[
 AC_CACHE_CHECK([for C++ template repository directory name],
 pac_cv_cxx_template_dir,[
@@ -97,5 +97,5 @@
 # compiler, but they should not HAVE to
 #
-AC_DEFUN(PAC_PROG_CXX_WORKS,
+AC_DEFUN([PAC_PROG_CXX_WORKS],
 [AC_PROG_CXX_WORKS
 AC_MSG_CHECKING([whether the C++ compiler sets its return status correctly])
@@ -232,5 +232,5 @@
 dnl variable containing the option name as the first argument.
 dnl D*/
-AC_DEFUN(PAC_CXX_CHECK_COMPILER_OPTION,[
+AC_DEFUN([PAC_CXX_CHECK_COMPILER_OPTION],[
 AC_MSG_CHECKING([whether C++ compiler accepts option $1])
 save_CXXFLAGS="$CXXFLAGS"
Index: /mpich2/branches/dev/kumudb/confdb/aclocal_f77.m4
===================================================================
--- /mpich2/branches/dev/kumudb/confdb/aclocal_f77.m4 (revision 4384)
+++ /mpich2/branches/dev/kumudb/confdb/aclocal_f77.m4 (revision 4870)
@@ -39,5 +39,5 @@
 dnl D*/
 dnl
-AC_DEFUN(PAC_PROG_F77_NAME_MANGLE,[
+AC_DEFUN([PAC_PROG_F77_NAME_MANGLE],[
 AC_CACHE_CHECK([for Fortran 77 name mangling],
 pac_cv_prog_f77_name_mangle,
@@ -300,5 +300,5 @@
 dnl
 dnl D*/
-AC_DEFUN(PAC_PROG_F77_CHECK_SIZEOF,[
+AC_DEFUN([PAC_PROG_F77_CHECK_SIZEOF],[
 changequote(<<, >>)dnl
 dnl The name to #define.
@@ -377,5 +377,5 @@
 dnl of the Portland Group compilers)
 dnl
-AC_DEFUN(PAC_PROG_F77_CHECK_SIZEOF_EXT,[
+AC_DEFUN([PAC_PROG_F77_CHECK_SIZEOF_EXT],[
 changequote(<<,>>)dnl
 dnl The name to #define.
@@ -480,5 +480,5 @@
 dnl
 dnl D*/
-AC_DEFUN(PAC_PROG_F77_EXCLAIM_COMMENTS,[
+AC_DEFUN([PAC_PROG_F77_EXCLAIM_COMMENTS],[
 AC_CACHE_CHECK([whether Fortran accepts ! for comments],
 pac_cv_prog_f77_exclaim_comments,[
@@ -518,5 +518,5 @@
 dnl variable containing the option name as the first argument.
 dnl D*/
-AC_DEFUN(PAC_F77_CHECK_COMPILER_OPTION,[
+AC_DEFUN([PAC_F77_CHECK_COMPILER_OPTION],[
 AC_MSG_CHECKING([whether Fortran 77 compiler accepts option $1])
 ac_result="no"
@@ -641,5 +641,5 @@
 dnl    f_setarg( __libc_argc, __libc_argv );
 dnl
-AC_DEFUN(PAC_PROG_F77_CMDARGS,[
+AC_DEFUN([PAC_PROG_F77_CMDARGS],[
 found_cached="yes"
 AC_MSG_CHECKING([for routines to access the command line from Fortran 77])
@@ -994,5 +994,5 @@
 dnl a library.  This failed when the HP compiler complained about the
 dnl arguments, but produced an executable anyway.  
-AC_DEFUN(PAC_PROG_F77_LIBRARY_DIR_FLAG,[
+AC_DEFUN([PAC_PROG_F77_LIBRARY_DIR_FLAG],[
 if test "X$F77_LIBDIR_LEADER" = "X" ; then
 AC_CACHE_CHECK([for Fortran 77 flag for library directories],
@@ -1058,5 +1058,5 @@
 dnl
 dnl D*/ 
-AC_DEFUN(PAC_PROG_F77_HAS_INCDIR,[
+AC_DEFUN([PAC_PROG_F77_HAS_INCDIR],[
 checkdir=$1
 AC_CACHE_CHECK([for include directory flag for Fortran],
@@ -1101,5 +1101,5 @@
 dnl
 dnl D*/
-AC_DEFUN(PAC_PROG_F77_ALLOWS_UNUSED_EXTERNALS,[
+AC_DEFUN([PAC_PROG_F77_ALLOWS_UNUSED_EXTERNALS],[
 AC_CACHE_CHECK([whether Fortran allows unused externals],
 pac_cv_prog_f77_allows_unused_externals,[
@@ -1145,5 +1145,5 @@
 dnl   PAC_PROG_F77_HAS_POINTER(action-if-true,action-if-false)
 dnl D*/
-AC_DEFUN(PAC_PROG_F77_HAS_POINTER,[
+AC_DEFUN([PAC_PROG_F77_HAS_POINTER],[
 AC_CACHE_CHECK([whether Fortran has pointer declaration],
 pac_cv_prog_f77_has_pointer,[
@@ -1172,5 +1172,5 @@
 dnl to select the appropriate Fortran name.
 dnl 
-AC_DEFUN(PAC_PROG_F77_RUN_PROC_FROM_C,[
+AC_DEFUN([PAC_PROG_F77_RUN_PROC_FROM_C],[
 # This is needed for Mac OSX 10.5
 rm -rf conftest.dSYM
@@ -1223,5 +1223,5 @@
 dnl 
 dnl
-AC_DEFUN(PAC_PROG_F77_IN_C_LIBS,[
+AC_DEFUN([PAC_PROG_F77_IN_C_LIBS],[
 AC_MSG_CHECKING([for which Fortran libraries are needed to link C with Fortran])
 F77_IN_C_LIBS="$FLIBS"
@@ -1370,5 +1370,5 @@
 dnl needed by C programs
 dnl
-AC_DEFUN(PAC_PROG_F77_CHECK_FLIBS,
+AC_DEFUN([PAC_PROG_F77_CHECK_FLIBS],
 [AC_MSG_CHECKING([whether C can link with $FLIBS])
 # Try to link a C program with all of these libraries
@@ -1407,5 +1407,5 @@
 dnl use the new form if it is available.
 dnl
-AC_DEFUN(PAC_PROG_F77_NEW_CHAR_DECL,[
+AC_DEFUN([PAC_PROG_F77_NEW_CHAR_DECL],[
 AC_CACHE_CHECK([whether Fortran supports new-style character declarations],
 pac_cv_prog_f77_new_char_decl,[
@@ -1593,5 +1593,5 @@
 dnl
 dnl
-AC_DEFUN(PAC_PROG_F77_OBJ_LINKS_WITH_C,[
+AC_DEFUN([PAC_PROG_F77_OBJ_LINKS_WITH_C],[
 AC_MSG_CHECKING([whether Fortran 77 and C objects are compatible])
 dnl
Index: /mpich2/branches/dev/kumudb/confdb/aclocal_util.m4
===================================================================
--- /mpich2/branches/dev/kumudb/confdb/aclocal_util.m4 (revision 670)
+++ /mpich2/branches/dev/kumudb/confdb/aclocal_util.m4 (revision 4870)
@@ -3,5 +3,5 @@
 dnl token is defined as string without any blank space in it.
 dnl
-AC_DEFUN(PAC_APPEND_UNIQ_TOKEN,[
+AC_DEFUN([PAC_APPEND_UNIQ_TOKEN],[
 dnl Since PAC_APPEND_UNIQ_TOKEN may be called by PAC_MAKE_UNIQ_STRING
 dnl saved IFS should be in a different variable than MAKE_UNIQ_STRING's.
@@ -50,5 +50,5 @@
 dnl                 duplicated substings.
 dnl
-AC_DEFUN(PAC_MAKE_UNIQ_STRING, [
+AC_DEFUN([PAC_MAKE_UNIQ_STRING], [
 saveIFS="$IFS"
 dnl eval inflags=\$$1
Index: /mpich2/branches/dev/kumudb/confdb/aclocal_csharp.m4
===================================================================
--- /mpich2/branches/dev/kumudb/confdb/aclocal_csharp.m4 (revision 100)
+++ /mpich2/branches/dev/kumudb/confdb/aclocal_csharp.m4 (revision 4870)
@@ -18,5 +18,5 @@
 dnl   /optimize
 dnl   /unsafe   (allow unsafe code)
-AC_DEFUN(PAC_LANG_CSHARP,
+AC_DEFUN([PAC_LANG_CSHARP],
 [AC_REQUIRE([PAC_PROG_CSHARP])
 define([AC_LANG], [CSHARP])dnl
@@ -30,5 +30,5 @@
 dnl cross_compiling=$pac_cv_prog_csharp_cross
 ])
-AC_DEFUN(PAC_PROG_CSHARP,[
+AC_DEFUN([PAC_PROG_CSHARP],[
 if test -z "$CSHARP" ; then
     AC_CHECK_PROGS(CSHARP,csc)
Index: /mpich2/branches/dev/kumudb/confdb/aclocal_mpi.m4
===================================================================
--- /mpich2/branches/dev/kumudb/confdb/aclocal_mpi.m4 (revision 3623)
+++ /mpich2/branches/dev/kumudb/confdb/aclocal_mpi.m4 (revision 4870)
@@ -24,5 +24,5 @@
 dnl MPI-2 RMA?
 dnl PAC_LIB_MPI([found text],[not found text])
-AC_DEFUN(PAC_LIB_MPI,[
+AC_DEFUN([PAC_LIB_MPI],[
 dnl Set the prereq to 2.50 to avoid having 
 AC_PREREQ(2.50)
@@ -72,5 +72,5 @@
 dnl PAC_LIB_MPI
 dnl D*/
-AC_DEFUN(PAC_ARG_MPICH_BUILDING,[
+AC_DEFUN([PAC_ARG_MPICH_BUILDING],[
 AC_ARG_WITH(mpichbuilding,
 [--with-mpichbuilding - Assume that MPICH is being built],
@@ -115,5 +115,5 @@
 dnl PAC_LANG_PUSH_COMPILERS, PAC_LIB_MPI
 dnl D*/
-AC_DEFUN(PAC_ARG_MPI_TYPES,[
+AC_DEFUN([PAC_ARG_MPI_TYPES],[
 AC_PROVIDE([AC_PROG_CC])
 AC_SUBST(CC)
@@ -375,5 +375,5 @@
 dnl Looks only for 'MPI_Request_c2f'.
 dnl D*/
-AC_DEFUN(PAC_MPI_F2C,[
+AC_DEFUN([PAC_MPI_F2C],[
 AC_CACHE_CHECK([for MPI F2C and C2F routines],
 pac_cv_mpi_f2c,
@@ -394,5 +394,5 @@
 dnl expands @HAVE_ROMIO@ in mpi.h into #include "mpio.h"
 dnl D*/
-AC_DEFUN(PAC_HAVE_ROMIO,[
+AC_DEFUN([PAC_HAVE_ROMIO],[
 if test "$enable_romio" = "yes" ; then HAVE_ROMIO='#include "mpio.h"'; fi
 AC_SUBST(HAVE_ROMIO)
Index: /mpich2/branches/dev/kumudb/confdb/aclocal_enable.m4
===================================================================
--- /mpich2/branches/dev/kumudb/confdb/aclocal_enable.m4 (revision 100)
+++ /mpich2/branches/dev/kumudb/confdb/aclocal_enable.m4 (revision 4870)
@@ -20,5 +20,5 @@
 dnl HAVE_ENABLE_G_MEM=trace
 dnl
-AC_DEFUN(PAC_ARG_ENABLE_PARSE,[
+AC_DEFUN([PAC_ARG_ENABLE_PARSE],[
     eval ac_e_parse=${enable}_$1
     save_IFS="$IFS"
Index: /mpich2/branches/dev/kumudb/confdb/aclocal_cross.m4
===================================================================
--- /mpich2/branches/dev/kumudb/confdb/aclocal_cross.m4 (revision 3050)
+++ /mpich2/branches/dev/kumudb/confdb/aclocal_cross.m4 (revision 4870)
@@ -62,5 +62,5 @@
 dnl platform
 dnl 
-AC_DEFUN(PAC_LANG_PUSH_COMPILERS,[
+AC_DEFUN([PAC_LANG_PUSH_COMPILERS],[
 if test "X$pac_save_level" = "X" ; then
     pac_save_CC="$CC"
@@ -178,5 +178,5 @@
 dnl PAC_LANG_PUSH_COMPILERS
 dnl D*/
-AC_DEFUN(PAC_LANG_POP_COMPILERS,[
+AC_DEFUN([PAC_LANG_POP_COMPILERS],[
 pac_save_level=`expr $pac_save_level - 1`
 if test "X$pac_save_level" = "X0" ; then
@@ -193,5 +193,5 @@
 fi
 ])
-AC_DEFUN(PAC_PROG_TESTCPP,[
+AC_DEFUN([PAC_PROG_TESTCPP],[
 if test -z "$TESTCPP"; then
   AC_CACHE_VAL(pac_cv_prog_TESTCPP,[
Index: /mpich2/branches/dev/kumudb/confdb/aclocal_f90.m4
===================================================================
--- /mpich2/branches/dev/kumudb/confdb/aclocal_f90.m4 (revision 974)
+++ /mpich2/branches/dev/kumudb/confdb/aclocal_f90.m4 (revision 4870)
@@ -5,5 +5,5 @@
 dnl that would require too many changes to autoconf macros.
 dnl
-AC_DEFUN(PAC_LANG_FORTRAN90,
+AC_DEFUN([PAC_LANG_FORTRAN90],
 [AC_REQUIRE([PAC_PROG_F90])
 define([AC_LANG], [FORTRAN90])dnl
@@ -20,5 +20,5 @@
 dnl This is an addition for AC_TRY_COMPILE, but for f90.  If the current 
 dnl language is not f90, it does a save/restore
-AC_DEFUN(PAC_TRY_F90_COMPILE,
+AC_DEFUN([PAC_TRY_F90_COMPILE],
 [AC_REQUIRE([PAC_LANG_FORTRAN90])
 ifelse(AC_LANG, FORTRAN90,,[AC_LANG_SAVE
@@ -59,5 +59,5 @@
 dnl      of unknown, lower, upper
 dnl D*/
-AC_DEFUN(PAC_F90_MODULE_EXT,
+AC_DEFUN([PAC_F90_MODULE_EXT],
 [AC_CACHE_CHECK([for Fortran 90 module extension],
 pac_cv_f90_module_ext,[
@@ -134,5 +134,5 @@
 dnl directories that contain compiled Fortran 90 modules
 dnl
-AC_DEFUN(PAC_F90_MODULE_INCFLAG,[
+AC_DEFUN([PAC_F90_MODULE_INCFLAG],[
 AC_CACHE_CHECK([for Fortran 90 module include flag],
 pac_cv_f90_module_incflag,[
@@ -227,9 +227,9 @@
 F90MODINCFLAG=$pac_cv_f90_module_incflag
 ])
-AC_DEFUN(PAC_F90_MODULE,[
+AC_DEFUN([PAC_F90_MODULE],[
 PAC_F90_MODULE_EXT
 PAC_F90_MODULE_INCFLAG
 ])
-AC_DEFUN(PAC_F90_EXT,[
+AC_DEFUN([PAC_F90_EXT],[
 AC_CACHE_CHECK([whether Fortran 90 accepts f90 suffix],
 pac_cv_f90_ext_f90,[
@@ -249,5 +249,5 @@
 dnl
 dnl D*/
-AC_DEFUN(PAC_PROG_F90_INT_KIND,[
+AC_DEFUN([PAC_PROG_F90_INT_KIND],[
 # Set the default
 $1=-1
@@ -325,5 +325,5 @@
 # efc - An older Intel compiler (?)
 # ifc - An older Intel compiler
-AC_DEFUN(PAC_PROG_F90,[
+AC_DEFUN([PAC_PROG_F90],[
 if test -z "$F90" ; then
     AC_CHECK_PROGS(F90,f90 xlf90 pgf90 ifort epcf90 f95 fort xlf95 lf95 pathf95 pathf90 g95 gfortran ifc efc)
@@ -353,5 +353,5 @@
 dnl Internal routine for testing F90
 dnl PAC_PROG_F90_WORKS()
-AC_DEFUN(PAC_PROG_F90_WORKS,
+AC_DEFUN([PAC_PROG_F90_WORKS],
 [AC_MSG_CHECKING([for extension for Fortran 90 programs])
 pac_cv_f90_ext="f90"
@@ -434,5 +434,5 @@
 dnl We assume a naming convention consistent with the Fortran 77 one.
 dnl
-AC_DEFUN(PAC_PROG_F90_CHECK_SIZEOF,[
+AC_DEFUN([PAC_PROG_F90_CHECK_SIZEOF],[
 changequote(<<,>>)dnl
 dnl The name to #define.
@@ -588,5 +588,5 @@
 dnl   PAC_PROG_F90_HAS_POINTER(action-if-true,action-if-false)
 dnl D*/
-AC_DEFUN(PAC_PROG_F90_HAS_POINTER,[
+AC_DEFUN([PAC_PROG_F90_HAS_POINTER],[
 AC_CACHE_CHECK([whether Fortran 90 has Cray-style pointer declaration],
 pac_cv_prog_f90_has_pointer,[
@@ -629,5 +629,5 @@
 dnl variable containing the option name as the first argument.
 dnl D*/
-AC_DEFUN(PAC_F90_CHECK_COMPILER_OPTION,[
+AC_DEFUN([PAC_F90_CHECK_COMPILER_OPTION],[
 AC_MSG_CHECKING([whether Fortran 90 compiler accepts option $1])
 ac_result="no"
Index: /mpich2/branches/dev/kumudb/confdb/aclocal_perl.m4
===================================================================
--- /mpich2/branches/dev/kumudb/confdb/aclocal_perl.m4 (revision 100)
+++ /mpich2/branches/dev/kumudb/confdb/aclocal_perl.m4 (revision 4870)
@@ -2,5 +2,5 @@
 dnl
 dnl Find perl5
-AC_DEFUN(PAC_PROG_PERL5,[
+AC_DEFUN([PAC_PROG_PERL5],[
 AC_CACHE_VAL(pac_cv_prog_perl,
 [
Index: /mpich2/branches/dev/kumudb/confdb/aclocal_cache.m4
===================================================================
--- /mpich2/branches/dev/kumudb/confdb/aclocal_cache.m4 (revision 100)
+++ /mpich2/branches/dev/kumudb/confdb/aclocal_cache.m4 (revision 4870)
@@ -174,5 +174,5 @@
 dnl set here are redundant; the LOAD_CACHE call relies on the way autoconf
 dnl initially processes ARG_ENABLE commands.
-AC_DEFUN(PAC_ARG_CACHING,[
+AC_DEFUN([PAC_ARG_CACHING],[
 AC_ARG_ENABLE(cache,
 [--enable-cache  - Turn on configure caching],
@@ -227,6 +227,6 @@
 dnl
 dnl D*/
-AC_DEFUN(PAC_SUBDIR_CACHE,[])
-AC_DEFUN(PAC_SUBDIR_CACHE_OLD,[
+AC_DEFUN([PAC_SUBDIR_CACHE],[])
+AC_DEFUN([PAC_SUBDIR_CACHE_OLD],[
 if test "x$1" = "xalways" -o \( "$cache_file" = "/dev/null" -a "X$real_enable_cache" = "Xnotgiven" \) ; then
     # Use an absolute directory to help keep the subdir configures from getting
@@ -313,6 +313,6 @@
 export CCFLAGS
 ])
-AC_DEFUN(PAC_SUBDIR_CACHE_CLEANUP,[])
-AC_DEFUN(PAC_SUBDIR_CACHE_CLEANUP_OLD,[
+AC_DEFUN([PAC_SUBDIR_CACHE_CLEANUP],[])
+AC_DEFUN([PAC_SUBDIR_CACHE_CLEANUP_OLD],[
 if test "$cache_file" != "/dev/null" -a "X$real_enable_cache" = "Xnotgiven" ; then
    rm -f $cache_file
Index: /mpich2/branches/dev/kumudb/confdb/aclocal_subcfg.m4
===================================================================
--- /mpich2/branches/dev/kumudb/confdb/aclocal_subcfg.m4 (revision 1000)
+++ /mpich2/branches/dev/kumudb/confdb/aclocal_subcfg.m4 (revision 4870)
@@ -3,5 +3,5 @@
 dnl                   Call before invocation of mpich2's subpackage configure
 dnl
-AC_DEFUN(PAC_MPICH2_INIT,[
+AC_DEFUN([PAC_MPICH2_INIT],[
 # Exporting the MPICH2_INTERNAL_xFLAGS with modified xFLAGS
 # before calling subconfigure.
@@ -32,16 +32,18 @@
 dnl                      Called after AC_INIT before any of xFLAGS is accessed.
 dnl
-AC_DEFUN(PAC_SUBCONFIG_INIT,[
+AC_DEFUN([PAC_SUBCONFIG_INIT],[
 # Initialize xFLAGS with MPICH2_INTERNAL_xFLAGS.
+  if test "$FROM_MPICH2" = "yes" ; then
     CFLAGS="$MPICH2_INTERNAL_CFLAGS"
     CXXFLAGS="$MPICH2_INTERNAL_CXXFLAGS"
     FFLAGS="$MPICH2_INTERNAL_FFLAGS"
     F90FLAGS="$MPICH2_INTERNAL_F90FLAGS"
+  fi
 ])dnl
 dnl
 dnl Do we need PAC_SUBCONFIG_FINALIZE or PAC_MPICH2_FINALIZE ?
 dnl 
-AC_DEFUN(PAC_SUBCONFIG_FINALIZE,[
+AC_DEFUN([PAC_SUBCONFIG_FINALIZE],[
 ])dnl
-AC_DEFUN(PAC_MPICH2_FINALIZE,[
+AC_DEFUN([PAC_MPICH2_FINALIZE],[
 ])dnl
Index: /mpich2/branches/dev/kumudb/confdb/aclocal_make.m4
===================================================================
--- /mpich2/branches/dev/kumudb/confdb/aclocal_make.m4 (revision 3050)
+++ /mpich2/branches/dev/kumudb/confdb/aclocal_make.m4 (revision 4870)
@@ -18,5 +18,5 @@
 dnl
 dnl Find a make program if none is defined.
-AC_DEFUN(PAC_PROG_MAKE_PROGRAM,[true
+AC_DEFUN([PAC_PROG_MAKE_PROGRAM],[true
 if test "X$MAKE" = "X" ; then
    AC_CHECK_PROGS(MAKE,make gnumake nmake pmake smake)
@@ -41,5 +41,5 @@
 dnl D*/
 dnl
-AC_DEFUN(PAC_PROG_MAKE_ECHOS_DIR,[
+AC_DEFUN([PAC_PROG_MAKE_ECHOS_DIR],[
 if test "$MAKE_MAY_PRINT_DIR" != "yes" ; then
     AC_CACHE_CHECK([whether make echos directory changes],
@@ -47,4 +47,6 @@
 [
 AC_REQUIRE([PAC_PROG_MAKE_PROGRAM])
+# This is needed for Mac OSX 10.5
+rm -rf conftest.dSYM
 rm -f conftest
 cat > conftest <<.
@@ -69,4 +71,6 @@
     pac_cv_prog_make_echos_dir="no"
 fi
+# This is needed for Mac OSX 10.5
+rm -rf conftest.dSYM
 rm -f conftest
 str=""
@@ -97,7 +101,9 @@
 dnl D*/
 dnl
-AC_DEFUN(PAC_PROG_MAKE_INCLUDE,[
+AC_DEFUN([PAC_PROG_MAKE_INCLUDE],[
 AC_CACHE_CHECK([whether make supports include],pac_cv_prog_make_include,[
 AC_REQUIRE([PAC_PROG_MAKE_PROGRAM])
+# This is needed for Mac OSX 10.5
+rm -rf conftest.dSYM
 rm -f conftest
 cat > conftest <<.
@@ -109,4 +115,6 @@
 .
 pac_str=`$MAKE -f conftest1 2>&1`
+# This is needed for Mac OSX 10.5
+rm -rf conftest.dSYM
 rm -f conftest conftest1
 if test "$pac_str" != "success" ; then
@@ -141,8 +149,10 @@
 dnl D*/
 dnl
-AC_DEFUN(PAC_PROG_MAKE_ALLOWS_COMMENTS,[
+AC_DEFUN([PAC_PROG_MAKE_ALLOWS_COMMENTS],[
 AC_CACHE_CHECK([whether make allows comments in actions],
 pac_cv_prog_make_allows_comments,[
 AC_REQUIRE([PAC_PROG_MAKE_PROGRAM])
+# This is needed for Mac OSX 10.5
+rm -rf conftest.dSYM
 rm -f conftest
 cat > conftest <<.
@@ -153,4 +163,6 @@
 .
 pac_str=`$MAKE -f conftest 2>&1`
+# This is needed for Mac OSX 10.5
+rm -rf conftest.dSYM
 rm -f conftest 
 if test "$pac_str" != "success" ; then
@@ -195,5 +207,5 @@
 dnl D*/
 dnl
-AC_DEFUN(PAC_PROG_MAKE_VPATH,[
+AC_DEFUN([PAC_PROG_MAKE_VPATH],[
 AC_SUBST(VPATH)AM_IGNORE(VPATH)
 AC_CACHE_CHECK([for virtual path format],
@@ -259,8 +271,10 @@
 dnl PAC_PROG_MAKE
 dnl D*/
-AC_DEFUN(PAC_PROG_MAKE_SET_CFLAGS,[
+AC_DEFUN([PAC_PROG_MAKE_SET_CFLAGS],[
 AC_CACHE_CHECK([whether make sets CFLAGS],
 pac_cv_prog_make_set_cflags,[
 AC_REQUIRE([PAC_PROG_MAKE_PROGRAM])
+# This is needed for Mac OSX 10.5
+rm -rf conftest.dSYM
 rm -f conftest
 cat > conftest <<EOF
@@ -270,4 +284,6 @@
 EOF
 pac_str=`$MAKE -f conftest 2>&1`
+# This is needed for Mac OSX 10.5
+rm -rf conftest.dSYM
 rm -f conftest 
 if test "$pac_str" = "XX" ; then
@@ -290,5 +306,5 @@
 dnl Sets the cache variable 'pac_cv_prog_make_found_clock_skew' to yes or no
 dnl D*/
-AC_DEFUN(PAC_PROG_MAKE_CLOCK_SKEW,[
+AC_DEFUN([PAC_PROG_MAKE_CLOCK_SKEW],[
 AC_CACHE_CHECK([whether clock skew breaks make],
 pac_cv_prog_make_found_clock_skew,[
@@ -339,5 +355,5 @@
 dnl 
 dnl D*/
-AC_DEFUN(PAC_PROG_MAKE_HAS_PATTERN_RULES,[
+AC_DEFUN([PAC_PROG_MAKE_HAS_PATTERN_RULES],[
 AC_CACHE_CHECK([whether make has pattern rules],
 pac_cv_prog_make_has_patterns,[
@@ -397,5 +413,5 @@
 dnl D*/
 dnl
-AC_DEFUN(PAC_PROG_MAKE,[
+AC_DEFUN([PAC_PROG_MAKE],[
 PAC_PROG_MAKE_PROGRAM
 PAC_PROG_MAKE_CLOCK_SKEW
Index: /mpich2/branches/dev/kumudb/confdb/aclocal_web.m4
===================================================================
--- /mpich2/branches/dev/kumudb/confdb/aclocal_web.m4 (revision 100)
+++ /mpich2/branches/dev/kumudb/confdb/aclocal_web.m4 (revision 4870)
@@ -10,5 +10,5 @@
 dnl D*/
 dnl 
-AC_DEFUN(PAC_ARG_WWWDIR,[
+AC_DEFUN([PAC_ARG_WWWDIR],[
 AC_ARG_WITH([wwwdir],[
 --with-wwwdir=directory - Specify the root directory for HTML documentation],
Index: /mpich2/branches/dev/kumudb/confdb/aclocal.m4
===================================================================
--- /mpich2/branches/dev/kumudb/confdb/aclocal.m4 (revision 4146)
+++ /mpich2/branches/dev/kumudb/confdb/aclocal.m4 (revision 4870)
@@ -38,10 +38,10 @@
 dnl If these are not available, just set them as empty
 ifdef([AC_EXEEXT],,[
-AC_DEFUN(AC_EXEEXT,[
+AC_DEFUN([AC_EXEEXT],[
 EXEEXT=
 AC_SUBST(EXEEXT)
 ])])
 ifdef([AC_OBJEXT],,[
-AC_DEFUN(AC_OBJEXT,[
+AC_DEFUN([AC_OBJEXT],[
 OBJEXT=
 AC_SUBST(OBJEXT)
@@ -74,5 +74,5 @@
 dnl directories in the case that this is a vpath build.  
 dnl
-AC_DEFUN(PAC_CONFIG_SUBDIRS_IMMEDIATE,
+AC_DEFUN([PAC_CONFIG_SUBDIRS_IMMEDIATE],
 [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
 SAVE_subdirs="$subdirs"
@@ -105,5 +105,5 @@
 dnl Find something to use for mkdir -p.  Eventually, this will 
 dnl have a script for backup
-AC_DEFUN(PAC_PROG_MKDIR_P,[
+AC_DEFUN([PAC_PROG_MKDIR_P],[
 AC_CACHE_CHECK([whether mkdir -p works],
 pac_cv_mkdir_p,[
Index: /mpich2/branches/dev/kumudb/confdb/install-sh
===================================================================
--- /mpich2/branches/dev/kumudb/confdb/install-sh (revision 4136)
+++ /mpich2/branches/dev/kumudb/confdb/install-sh (revision 4870)
@@ -2,5 +2,5 @@
 # install - install a program, script, or datafile
 
-scriptversion=2006-12-25.00
+scriptversion=2009-04-28.21; # UTC
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
@@ -516,4 +516,5 @@
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
 # End:
Index: /mpich2/branches/dev/kumudb/winconfigure.wsf
===================================================================
--- /mpich2/branches/dev/kumudb/winconfigure.wsf (revision 4652)
+++ /mpich2/branches/dev/kumudb/winconfigure.wsf (revision 4870)
@@ -220,7 +220,7 @@
 bf77_name_lower_uscore = False
 bf77_name_lower_2uscore = False
-bf77_name_upper = True
+bf77_name_upper = False
 bf77_name_mixed = False
-b77_name_mixed_uscore = False
+bf77_name_mixed_uscore = False
 unhandled_definitions = ""
 unhandled_definitions_count = 0
@@ -320,5 +320,5 @@
 	bf77_name_mixed = True
   ElseIf argValue = "--f77_name_mixed_uscore" Then
-	b77_name_mixed_uscore = True
+	bf77_name_mixed_uscore = True
   ElseIf argValue = "--defmsg" Then
     GenerateDefmsg()
@@ -2241,4 +2241,6 @@
 				Case "HAVE_PTHREAD_MUTEXATTR_SETPSHARED"
 					fout.WriteLine("/*#define HAVE_PTHREAD_MUTEXATTR_SETPSHARED 1*/")
+                                Case "PTHREAD_MUTEX_ERRORCHECK_VALUE"
+                                        fout.WriteLine("/* #undef PTHREAD_MUTEX_ERRORCHECK_VALUE */")
 				Case "HAVE_SCHED_YIELD"
 					fout.WriteLine("/*#define HAVE_SCHED_YIELD 1*/")
@@ -2539,5 +2541,5 @@
 					End If
 				Case "F77_NAME_LOWER_USCORE"
-					If b77_name_lower_uscore Then
+					If bf77_name_lower_uscore Then
 						fout.WriteLine("#define F77_NAME_LOWER_USCORE")
 					Else
@@ -2551,5 +2553,5 @@
 					End If
 				Case "F77_NAME_UPPER"
-					if b77_name_upper Then
+					if bf77_name_upper Then
 						fout.WriteLine("#define F77_NAME_UPPER")
 					Else
@@ -2557,5 +2559,5 @@
 					End If
 				Case "F77_NAME_MIXED"
-					if b77_name_mixed Then
+					if bf77_name_mixed Then
 						fout.WriteLine("#define F77_NAME_MIXED 1")
 					Else
@@ -2563,5 +2565,5 @@
 					End If
 				Case "F77_NAME_MIXED_USCORE"
-					if b77_name_mixed_uscore Then
+					if bf77_name_mixed_uscore Then
 						fout.WriteLine("#define F77_NAME_MIXED_USCORE 1")
 					Else
@@ -2758,4 +2760,6 @@
 				Case "HAVE_MPI_TYPE_F2C"
 					fout.WriteLine("#define HAVE_MPI_TYPE_F2C 1")
+                                Case "HAVE_MPI_F_INIT_WORKS_WITH_C"
+                                        fout.WriteLine("/* #undef HAVE_MPI_F_INIT_WORKS_WITH_C */")
 				Case "HAVE_NO_MPIO_REQUEST"
 					fout.WriteLine("/* #undef HAVE_NO_MPIO_REQUEST */")
@@ -6777,6 +6781,6 @@
 	mfile.WriteLine
 	mfile.WriteLine("mpe_wrap_objs = \")
-	mfile.WriteLine("	$(MPE_WRAP_OUTDIR)\log_mpi_core.obj \")
-	mfile.WriteLine("	$(MPE_WRAP_OUTDIR)\mpe_proff.obj")
+	mfile.WriteLine("	$(MPE_WRAP_OUTDIR)\log_mpi_util.obj \")
+	mfile.WriteLine("	$(MPE_WRAP_OUTDIR)\log_mpi_core.obj")
 	mfile.WriteLine
 	mfile.WriteLine("$(MPE_WRAP_OUTDIR)\mpich2mpe$(D).dll: $(mpe_wrap_objs)")
@@ -6880,6 +6884,6 @@
 	mfile.WriteLine("# impgen")
 	mfile.WriteLine
-	mfile.WriteLine("$(GCC_OUTDIR)\gccimpgen.obj: ..\maint\gccimpgen.c")
-	mfile.WriteLine("	$(cc) $(cflags) /Fo""$(GCC_OUTDIR)\\"" /Fd""$(GCC_OUTDIR)\\"" ..\maint\gccimpgen.c")
+	mfile.WriteLine("$(GCC_OUTDIR)\gccimpgen.obj: ..\maint\gccimpgen.cpp")
+	mfile.WriteLine("	$(cc) $(cflags) /Fo""$(GCC_OUTDIR)\\"" /Fd""$(GCC_OUTDIR)\\"" ..\maint\gccimpgen.cpp")
 	mfile.WriteLine
 	mfile.WriteLine("$(GCC_OUTDIR)\impgen.exe: $(GCC_OUTDIR)\gccimpgen.obj")
Index: /mpich2/branches/dev/kumudb/doc/logging/logging.tex
===================================================================
--- /mpich2/branches/dev/kumudb/doc/logging/logging.tex (revision 100)
+++ /mpich2/branches/dev/kumudb/doc/logging/logging.tex (revision 4870)
@@ -62,10 +62,15 @@
 Most Unix systems
 \item \texttt{linux86\_cycle} -
-Linux x86; uses cycle counts to approximate time in seconds
+Linux x86 cycle counter*
 \item \texttt{linuxalpha\_cycle} -
-Like linux86\_cycle, but for Linux Alpha
+Like linux86\_cycle, but for Linux Alpha*
 \item \texttt{gcc\_ia64\_cycle} -
-IPF ar.itc timer
+IA64 cycle counter*
 \end{itemize}
+* Note that CPU cycle counters count cycles, not elapsed time.
+Because processor frequencies are variable, especially with modern
+power-aware hardware, these are not always reliable for timing and so
+should only be used if you're sure you know what you're doing.
+
 \end{description}
 
@@ -75,5 +80,5 @@
     --enable-timing=log
     --with-logging=rlog
-    --enable-timer-type=linux86_cycle
+    --enable-timer-type=gettimeofday
     ...
 \end{verbatim}
Index: /mpich2/branches/dev/kumudb/doc/windev/windev.tex.vin
===================================================================
--- /mpich2/branches/dev/kumudb/doc/windev/windev.tex.vin (revision 4568)
+++ /mpich2/branches/dev/kumudb/doc/windev/windev.tex.vin (revision 4870)
@@ -521,4 +521,10 @@
 host.  The current user must match the user specifed by the \texttt{-add\_job job\_name username}
 command.
+
+\item \texttt{-binding process\_binding\_scheme}
+Specify a process binding scheme for the MPI processes. Currently only \texttt{auto}
+is the supported binding scheme. Using \texttt{auto} as the process binding scheme
+the process manager will choose the process binding scheme automatically taking into 
+account the load on system resources like caches.
 
 \item \texttt{-channel channel\_name}
Index: /mpich2/branches/dev/kumudb/maint/Version
===================================================================
--- /mpich2/branches/dev/kumudb/maint/Version (revision 4642)
+++ /mpich2/branches/dev/kumudb/maint/Version (revision 4870)
@@ -1,1 +1,1 @@
-1.1
+1.1.1
Index: /mpich2/branches/dev/kumudb/maint/simplemake.in
===================================================================
--- /mpich2/branches/dev/kumudb/maint/simplemake.in (revision 4869)
+++ /mpich2/branches/dev/kumudb/maint/simplemake.in (revision 4870)
@@ -1755,4 +1755,5 @@
     # is applied.
     &RecursiveOp( "apply" );
+    &TargetPostamble( "apply" );
     
     # Clean targets
@@ -2769,4 +2770,5 @@
     # Finally, execute make clean in any subdirs
     &RecursiveOp( "clean" );
+    &TargetPostamble( "clean" );
 
     # --------------------------------------------
@@ -2778,4 +2780,6 @@
     }
     print FD " distclean-xxx remove-makefile";
+    &TargetPostamble( "distclean" );
+
     print FD "$newline";
     
@@ -2851,4 +2855,5 @@
 	}
 	print FD " distclean-xxx remove-genmakefiles";
+	&TargetPostamble( "maintainer-clean" );
 	print FD "$newline";
 
@@ -4046,4 +4051,5 @@
 	}
     }
+    &TargetPostamble( "install" );
     print FD "$newline";
 
@@ -4103,4 +4109,5 @@
 	&RecursiveOp( "uninstall", "install_subdirs" );
     }
+    &TargetPostamble( "uninstall" );
 
     # also add the recursive installcheck target
@@ -4896,4 +4903,5 @@
     }
     &RecursiveOp( "coverage" );
+    &TargetPostamble( "coverage" );
 }
 # 
Index: /mpich2/branches/dev/kumudb/maint/clmake.in
===================================================================
--- /mpich2/branches/dev/kumudb/maint/clmake.in (revision 4500)
+++ /mpich2/branches/dev/kumudb/maint/clmake.in (revision 4870)
@@ -17,5 +17,9 @@
               "rm", "mv", "cp", "ar", "ranlib", "perl", "for", 
 	      "/bin/rm", "/bin/mv", "/bin/cp",
-	      "if", "make", "gnumake", "[A-Za-z0-9_\/\.-]*\/mpicc",
+	      "if", "make", "gnumake", 
+	      "[A-Za-z0-9_\/\.-]*\/mpicc",
+	      "[A-Za-z0-9_\/\.-]*\/mpif77",
+	      "[A-Za-z0-9_\/\.-]*\/mpif90",
+	      "[A-Za-z0-9_\/\.-]*\/mpicxx",
 	      "cleaning", "sleep", "date", "g77", "f77", "f90", "f95", "pgCC",
 	      "pgf77", "pgf90", "CC", "g95", "g\\+\\+", "c\\+\\+",
@@ -27,4 +31,8 @@
 	      "/bin/sh\\s+[A-Za-z0-9_\/\.-]*libtool\\s+--finish",
 	      "/bin/bash\\s+[A-Za-z0-9_\/\.-]*libtool\\s+--finish",
+	      "libtool:\\s+compile:",
+	      "libtool:\\s+link:",
+	      "libtool:\\s+install:",
+	      "libtool:\\s+finish:",
 	      "[A-Za-z0-9_\/-]*\/icc",
 	      "[A-Za-z0-9_\/-]*\/install-sh",
Index: /mpich2/branches/dev/kumudb/maint/updatefiles
===================================================================
--- /mpich2/branches/dev/kumudb/maint/updatefiles (revision 4713)
+++ /mpich2/branches/dev/kumudb/maint/updatefiles (revision 4870)
@@ -40,5 +40,5 @@
 
 openpa_dir="src/openpa"
-mpl_dir="src/pm/hydra/mpl"
+hydra_dir="src/pm/hydra"
 
 # List of steps that we will consider
@@ -51,4 +51,14 @@
 automakedir=""
 autotoolsdir=""
+# Extract defaults from the environment
+if [ "x$MPICH2_AUTOCONF_DIR" != "x" ] ; then 
+    autoconfdir=$MPICH2_AUTOCONF_DIR
+fi
+if [ "x$MPICH2_AUTOMAKE_DIR" != "x" ] ; then 
+    automakedir=$MPICH2_AUTOMAKE_DIR
+fi
+if [ "x$MPICH2_AUTOTOOLS_DIR" != "x" ] ; then 
+    autotoolsdir=$MPICH2_AUTOTOOLS_DIR
+fi
 #
 # Extract the arguments intended for updatefiles.  Any others are
@@ -628,7 +638,7 @@
 	        continue
             fi
-	    qmpl=`echo $dir | sed -e 's%.*'"$mpl_dir"'.*%FOUNDMPL%'`
-	    if [ "$qmpl" = "FOUNDMPL" ] ; then
-	        # mpl is updated using autoreconf later in this script
+	    qhydra=`echo $dir | sed -e 's%.*'"$hydra_dir"'.*%FOUNDHYDRA%'`
+	    if [ "$qhydra" = "FOUNDHYDRA" ] ; then
+	        # hydra is updated using autoreconf later in this script
 	        continue
             fi
@@ -864,7 +874,7 @@
     (cd $openpa_dir && $autoreconf -vif) || exit 1
 fi
-if [ -d "$mpl_dir" -o -L "$mpl_dir" ] ; then
-    echo "running autoreconf in $mpl_dir"
-    (cd $mpl_dir && $autoreconf -vif) || exit 1
+if [ -d "$hydra_dir" -o -L "$hydra_dir" ] ; then
+    echo "running autoreconf in $hydra_dir"
+    (cd $hydra_dir && $autoreconf -vif) || exit 1
 fi
 
Index: /mpich2/branches/dev/kumudb/maint/impgen.vcproj
===================================================================
--- /mpich2/branches/dev/kumudb/maint/impgen.vcproj (revision 3902)
+++ /mpich2/branches/dev/kumudb/maint/impgen.vcproj (revision 4870)
@@ -258,5 +258,5 @@
 			>
 			<File
-				RelativePath=".\gccimpgen.c"
+				RelativePath=".\gccimpgen.cpp"
 				>
 			</File>
Index: /mpich2/branches/dev/kumudb/maint/release.pl
===================================================================
--- /mpich2/branches/dev/kumudb/maint/release.pl (revision 4585)
+++ /mpich2/branches/dev/kumudb/maint/release.pl (revision 4870)
@@ -14,6 +14,8 @@
 
 # This path is the default for the MCS home directory mounts.  Pass
-# --with-autoconf='' to this script to use whatever is in your path.
-my $with_autoconf = "/homes/goodell/autoconf/ac-2.62_am-1.10.2/bin";
+# --with-autoconf='' and --with-automake='' options to this script to
+# use whatever is in your path.
+my $with_autoconf = "/homes/balaji/projects/autotools/install/bin";
+my $with_automake = "/homes/balaji/projects/autotools/install/bin";
 
 my $logfile = "release.log";
@@ -30,7 +32,14 @@
 
     print "===> Checking for package $pack... ";
-    if ($with_autoconf and ($pack eq "autoconf" or $pack eq "automake")) {
-        # the user specified a dir where autoconf/automake can be found
+    if ($with_autoconf and ($pack eq "autoconf")) {
+        # the user specified a dir where autoconf can be found
         if (not -x "$with_autoconf/$pack") {
+            print "not found\n";
+            exit;
+        }
+    }
+    if ($with_automake and ($pack eq "automake")) {
+        # the user specified a dir where automake can be found
+        if (not -x "$with_automake/$pack") {
             print "not found\n";
             exit;
@@ -107,4 +116,5 @@
         my $cmd = "./maint/updatefiles";
         $cmd .= " --with-autoconf=$with_autoconf" if $with_autoconf;
+        $cmd .= " --with-automake=$with_automake" if $with_automake;
         run_cmd($cmd);
     }
@@ -128,4 +138,5 @@
         my $cmd = "./maint/updatefiles";
         $cmd .= " --with-autoconf=$with_autoconf" if $with_autoconf;
+        $cmd .= " --with-automake=$with_automake" if $with_automake;
         run_cmd($cmd);
     }
@@ -202,5 +213,10 @@
     debug("===> Creating configure... ");
     chdir("${root}/mpe2");
-    run_cmd("./maint/updatefiles --with-autoconf=/homes/chan/autoconf/2.62/bin");
+    {
+        my $cmd = "./maint/updatefiles";
+        $cmd .= " --with-autoconf=$with_autoconf" if $with_autoconf;
+        $cmd .= " --with-automake=$with_automake" if $with_automake;
+        run_cmd($cmd);
+    }
     debug("done\n");
 
@@ -223,4 +239,5 @@
     "package:s"  => \$pack,
     "with-autoconf" => \$with_autoconf,
+    "with-automake" => \$with_automake,
     "help"     => \&usage,
 ) or die "unable to parse options, stopped";
Index: /mpich2/branches/dev/kumudb/maint/gccimpgen.cpp
===================================================================
--- /mpich2/branches/dev/kumudb/maint/gccimpgen.cpp (revision 4870)
+++ /mpich2/branches/dev/kumudb/maint/gccimpgen.cpp (revision 4870)
@@ -0,0 +1,132 @@
+/* -*- Mode: C++; c-basic-offset:4 ; -*- */
+/*  
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#include <windows.h>
+#include <stdio.h>
+#include <time.h>
+
+/* This function returns a pointer to the section header containing the RVA. Return NULL on error */
+template <typename NTHeaderType> static inline PIMAGE_SECTION_HEADER GetSecHeader(DWORD rva, NTHeaderType* pNTHeader)
+{
+    PIMAGE_SECTION_HEADER section;
+    section = IMAGE_FIRST_SECTION(pNTHeader);
+    for (int i=0; i < pNTHeader->FileHeader.NumberOfSections; i++, section++){
+		DWORD size = section->Misc.VirtualSize;
+        DWORD secRVA = section->VirtualAddress;
+        if((secRVA <= rva)  && (rva < (secRVA+size))){
+            return section;
+        }
+    }
+    return NULL;
+}
+
+/* This function returns the real address from the RVA. Returns NULL on error */
+template <typename NTHeaderType> static inline LPVOID GetRealAddrFromRVA(DWORD rva, NTHeaderType* pNTHeader, PBYTE imageBase )
+{
+	PIMAGE_SECTION_HEADER pSectionHdr = GetSecHeader(rva, pNTHeader);
+	if (!pSectionHdr){
+		return NULL;
+    }
+    /* Since we map the DLL manually we need to calculate mapShift to get the real addr */
+	INT mapShift = (INT)(pSectionHdr->VirtualAddress - pSectionHdr->PointerToRawData);
+
+	return (PVOID)(imageBase + rva - mapShift);
+}
+
+/* This function reads the exported symbols from a dll/exe and prints a DLL definition file, compatible with gcc,
+   with those symbols.
+    INPUT:
+        pImageBase  : Pointer to the base of the dll image, offset = 0
+        pNTHeader   : Pointer to the NT header (32-bit/64-bit) section of image.
+*/
+template <typename NTHeaderType> void PrintDefFileWithExpSymbols(PBYTE pImageBase, NTHeaderType *pNTHeader)
+{
+    /* Export Section RVA */
+    DWORD expSecRVA = pNTHeader->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress;
+
+    /* From RVA get the real addrs for the various components of the exports section */
+    PIMAGE_EXPORT_DIRECTORY pExportDir = (PIMAGE_EXPORT_DIRECTORY )GetRealAddrFromRVA(expSecRVA, pNTHeader, pImageBase);
+    PDWORD pszFuncNames =	(PDWORD ) GetRealAddrFromRVA( pExportDir->AddressOfNames, pNTHeader, pImageBase );
+
+    printf("EXPORTS\n");
+
+    for (unsigned int i=0; i < pExportDir->NumberOfFunctions; i++){
+        /* FIXME: Assumes that the current DLL does not have ordinal nums */
+        if(i < pExportDir->NumberOfNames){
+            /* Ordinal numbers start at 1 - not 0*/
+            printf("\t%s @ %d ;\n", GetRealAddrFromRVA(pszFuncNames[i], pNTHeader, pImageBase), i+1);
+        }
+        else{
+            break;
+        }
+    }
+}
+
+static void HelpUsage(char *exe_name)
+{
+    printf("Usage: %s <DLLNAME>\n", exe_name);
+    printf("\t\t The tool reads the export section from <DLLNAME> and prints the definition file for gcc to stdout\n");
+}
+
+int main(int argc, char *argv[])
+{
+    HANDLE hFile, hFileMapping;
+    LPVOID lpFileBase;
+    PIMAGE_DOS_HEADER   pImgHeader;
+    PIMAGE_NT_HEADERS   pImgNTHeader;
+    PIMAGE_NT_HEADERS64 pImgNTHeader64;
+
+    if((argc < 2) || (strcmp(argv[1], "/?") == 0) || (strcmp(argv[1], "--help") == 0)){
+        HelpUsage(argv[0]);
+        exit(1);
+    }
+    
+    /* Open the DLL and map it to memory */
+    hFile = CreateFile(argv[1], GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
+    if(hFile == INVALID_HANDLE_VALUE){
+        printf("Unable to open dll, %s\n", argv[1]);
+        exit(-1);
+    }
+    
+    hFileMapping = CreateFileMapping(hFile, NULL, PAGE_READONLY, 0, 0, NULL);
+    if(hFileMapping == 0){
+        CloseHandle(hFile);
+        printf("Cannot open file mapping for dll, %s\n", argv[1]);
+        exit(-1);
+    }
+
+    lpFileBase = MapViewOfFile(hFileMapping, FILE_MAP_READ, 0, 0, 0);
+    if(lpFileBase == 0){
+        CloseHandle(hFileMapping);
+        CloseHandle(hFile);
+        printf("Cannot map view of dll, %s\n", argv[1]);
+        exit(-1);
+    }
+
+    /* pImgHeader points to the MS-DOS HEADER section, offset=0, of dll */
+    pImgHeader = (PIMAGE_DOS_HEADER )lpFileBase;
+    
+    /* pImgNTHeader points to the NT HEADER section of the dll, pImgHeader + <File address of new exe header> */
+    pImgNTHeader = (PIMAGE_NT_HEADERS )((DWORD_PTR )pImgHeader + (DWORD_PTR )pImgHeader->e_lfanew);
+
+    /* In the case of the 64-bit dlls, the Optional header section within NT header has 64-bit fields */
+    pImgNTHeader64 = (PIMAGE_NT_HEADERS64) pImgNTHeader;
+
+    /* The Magic number is always a WORD. This number is used to determine if the dll is 32-bit or 64-bit */
+    if(pImgNTHeader->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC){
+        /* 64-bit dll */
+        PrintDefFileWithExpSymbols((PBYTE )pImgHeader, pImgNTHeader64);
+    }
+    else{
+        /* 32-bit dll */
+        PrintDefFileWithExpSymbols((PBYTE )pImgHeader, pImgNTHeader);
+    }
+
+    UnmapViewOfFile(lpFileBase);
+    CloseHandle(hFileMapping);
+    CloseHandle(hFile);
+}
+
Index: /ich2/branches/dev/kumudb/maint/gccimpgen.c
===================================================================
--- /mpich2/branches/dev/kumudb/maint/gccimpgen.c (revision 100)
+++  (revision )
@@ -1,127 +1,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; -*- */
-/*  
- *  (C) 2001 by Argonne National Laboratory.
- *      See COPYRIGHT in top-level directory.
- */
-#include <stdio.h>
-#include <windows.h>
-
-unsigned int read16(HANDLE fd, int offset)
-{
-    DWORD num_read;
-    unsigned char b[2];
-
-    SetFilePointer(fd, offset, NULL, FILE_BEGIN);
-    if (!ReadFile(fd, b, 2, &num_read, NULL))
-    {
-	ExitProcess(-1);
-    }
-    return b[0] + (b[1] << 8);
-}
-
-unsigned int read32(HANDLE fd, int offset)
-{
-    DWORD num_read;
-    unsigned char b[4];
-
-    SetFilePointer(fd, offset, NULL, FILE_BEGIN);
-    if (!ReadFile(fd, b, 4, &num_read, NULL))
-    {
-	ExitProcess(-1);
-    }
-    return b[0] + (b[1] << 8) + (b[2] << 16) + (b[3] << 24);
-}
-
-unsigned int to32(void *p)
-{
-    unsigned char *b = p;
-    return b[0] + (b[1] << 8) + (b[2] << 16) + (b[3] << 24);
-}
-
-int main(int argc, char *argv[])
-{
-    DWORD num_read;
-    HANDLE fd;
-    unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
-    unsigned long export_rva, export_size, nsections, secptr, expptr;
-    unsigned long name_rvas, nexp;
-    unsigned char *expdata, *erva;
-    unsigned long name_rva;
-    unsigned long secptr1;
-    unsigned long vaddr;
-    unsigned long vsize;
-    unsigned long fptr;
-    char sname[8];
-
-    if (argc < 2)
-    {
-	printf("usage: %s <filename>.dll\n", argv[0]);
-	return 0;
-    }
-
-    fd = CreateFile(argv[1], GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_READONLY | FILE_FLAG_RANDOM_ACCESS, NULL);
-    if (fd == INVALID_HANDLE_VALUE)
-    {
-	return 1;
-    }
-
-    pe_header_offset = read32(fd, 0x3c);
-    opthdr_ofs = pe_header_offset + 4 + 20;
-    num_entries = read32(fd, opthdr_ofs + 92);
-
-    if (num_entries < 1)
-    {
-	/* no exports */
-	CloseHandle(fd);
-	return 1;
-    }
-
-    export_rva = read32(fd, opthdr_ofs + 96);
-    export_size = read32(fd, opthdr_ofs + 100);
-    nsections = read16(fd, pe_header_offset + 4 + 2);
-    secptr = (pe_header_offset + 4 + 20 + read16(fd, pe_header_offset + 4 + 16));
-
-    expptr = 0;
-    for (i = 0; i < nsections; i++)
-    {
-	secptr1 = secptr + 40 * i;
-	vaddr = read32(fd, secptr1 + 12);
-	vsize = read32(fd, secptr1 + 16);
-	fptr = read32(fd, secptr1 + 20);
-	SetFilePointer(fd, secptr1, NULL, FILE_BEGIN);
-	if (!ReadFile(fd, sname, 8, &num_read, NULL))
-	{
-	    ExitProcess(-1);
-	}
-	if (vaddr <= export_rva && vaddr+vsize > export_rva)
-	{
-	    expptr = fptr + (export_rva - vaddr);
-	    if (export_rva + export_size > vaddr + vsize)
-	    {
-		export_size = vsize - (export_rva - vaddr);
-	    }
-	    break;
-	}
-    }
-
-    expdata = (unsigned char*)malloc(export_size);
-    SetFilePointer(fd, expptr, NULL, FILE_BEGIN);
-    if (!ReadFile(fd, expdata, export_size, &num_read, NULL))
-    {
-	ExitProcess(-1);
-    }
-    erva = expdata - export_rva;
-
-    nexp = to32(expdata + 24);
-    name_rvas = to32(expdata + 32);
-
-    printf ("EXPORTS\n");
-    for (i = 0; i<nexp; i++)
-    {
-	name_rva = to32(erva + name_rvas + i * 4);
-	printf ("\t%s @ %ld ;\n", erva + name_rva, 1 + i);
-    }
-
-    CloseHandle(fd);
-    return 0;
-}
Index: /mpich2/branches/dev/kumudb/CHANGES
===================================================================
--- /mpich2/branches/dev/kumudb/CHANGES (revision 4647)
+++ /mpich2/branches/dev/kumudb/CHANGES (revision 4870)
@@ -1,2 +1,28 @@
+===============================================================================
+                               Changes in 1.1.1
+===============================================================================
+
+ # OVERALL: Improved support for Boost MPI.
+
+ # PM/PMI: Improved startup time with MPD.
+
+ # PM/PMI: Improved support for hybrid MPI-UPC program launching with
+   Hydra.
+
+ # PM/PMI: Improved support for process-core binding with Hydra.
+
+ # PM/PMI: Preliminary support for PMI-2. Currently supported only
+   with Hydra.
+
+ # Many other bug fixes, memory leak fixes and code cleanup. A full
+   list of changes is available using:
+
+  svn log -r4655:HEAD https://svn.mcs.anl.gov/repos/mpi/mpich2/tags/release/mpich2-1.1.1
+
+  ... or at the following link:
+
+  https://trac.mcs.anl.gov/projects/mpich2/log/mpich2/tags/release/mpich2-1.1.1?action=follow_copy&rev=HEAD&stop_rev=4655&mode=follow_copy
+
+
 ===============================================================================
                                Changes in 1.1
