[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.1-248-g6732f00

Service Account noreply at mpich.org
Mon May 19 13:30:47 CDT 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".

The branch, master has been updated
       via  6732f002a80fe3aa5c96d514bcd321e4d808def3 (commit)
       via  7f8f982ba41856d218e05053f1c3fe91d02a863f (commit)
      from  3e57215ed2d5e40ba97805a24fa1ab4112b114e9 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/6732f002a80fe3aa5c96d514bcd321e4d808def3

commit 6732f002a80fe3aa5c96d514bcd321e4d808def3
Author: Pavan Balaji <balaji at anl.gov>
Date:   Sat Apr 26 06:43:42 2014 -0500

    Added a CHANGES note about mpd's death.
    
    Signed-off-by: Antonio J. Pena <apenya at mcs.anl.gov>

diff --git a/CHANGES b/CHANGES
index 990437d..407a1a6 100644
--- a/CHANGES
+++ b/CHANGES
@@ -27,6 +27,10 @@
  # Fortran 2008 bindings (experimental). Build with --enable-fortran=all. Must have
    a Fortran 2008 + TS 29113 capable compiler.
 
+ # The mpd process manager, which was deprecated and unsupported for
+   the past four major release series (1.3.x till 3.1), has now been
+   deleted.  RIP.
+
  # Several other minor bug fixes, memory leak fixes, and code cleanup.
 
    A full list of changes is available at the following link:

http://git.mpich.org/mpich.git/commitdiff/7f8f982ba41856d218e05053f1c3fe91d02a863f

commit 7f8f982ba41856d218e05053f1c3fe91d02a863f
Author: Pavan Balaji <balaji at anl.gov>
Date:   Sat Apr 26 06:32:45 2014 -0500

    Remove mpd.
    
    MPD has been deprecated for several major releases.  Now we are having
    to deal with bugs in it that are not worth spending time fixing.  It's
    time to let go of it.
    
    Signed-off-by: Antonio J. Pena <apenya at mcs.anl.gov>

diff --git a/README.vin b/README.vin
index a7859ff..f5ca5fb 100644
--- a/README.vin
+++ b/README.vin
@@ -562,13 +562,6 @@ daemons on nodes (e.g., ssh, pbs, slurm, sge) to start MPI
 processes. More information on Hydra can be found at
 http://wiki.mpich.org/mpich/index.php/Using_the_Hydra_Process_Manager
 
-mpd
----
-MPD was the traditional process manager in MPICH. The file
-mpich-%VERSION%/src/pm/mpd/README has more information about
-interactive commands for managing the ring of MPDs. The MPD process
-manager is now deprecated.
-
 gforker
 -------
 gforker is a process manager that creates processes on a single
diff --git a/autogen.sh b/autogen.sh
index e61ee97..cf16272 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -158,7 +158,7 @@ export do_build_configure
 MAKE=${MAKE-make}
 
 # external packages that require autogen.sh to be run for each of them
-externals="src/pm/hydra src/mpi/romio src/pm/mpd src/openpa"
+externals="src/pm/hydra src/mpi/romio src/openpa"
 # amdirs are the directories that make use of autoreconf
 amdirs=". src/mpl src/util/logging/rlog"
 
diff --git a/configure.ac b/configure.ac
index 1c45bcc..936f6ce 100644
--- a/configure.ac
+++ b/configure.ac
@@ -25,7 +25,7 @@ dnl Each of these is described in more detail below.
 dnl
 dnl 1. Identify the modules (most are specified by 
 dnl --with-<modulename>=instance,
-dnl for example, --with-pm=mpd or --with-device=ch3:nemesis).
+dnl for example, --with-pm=hydra or --with-device=ch3:nemesis).
 dnl For each module, source the file mpichprereq if present (in the
 dnl module's top-level directory).  This
 dnl must be a bourne (sh) shell script; it can access any of the variables
@@ -474,8 +474,8 @@ AC_ARG_WITH(pm,
                  valid values.  Multiple process managers may be specified as
                  long as they all use the same pmi interface by separating them
                  with colons.  The mpiexec for the first named process manager
-                 will be installed.  Example: "--with-pm=hydra:mpd:gforker"
-                 builds the three process managers hydra, mpd and gforker;
+                 will be installed.  Example: "--with-pm=hydra:gforker"
+                 builds the two process managers hydra, and gforker;
                  only the mpiexec from hydra is installed into the bin
                  directory.]),,with_pm=default)
 
@@ -593,7 +593,6 @@ AC_ARG_WITH(namepublisher,
                               include
                                    pmi (default)
 			           file[:directory] (optional directory)
-                                   mpd
                                    no (no service available)],,with_namepublisher=default)
 AC_ARG_WITH(name-publisher,
     [],
@@ -2683,21 +2682,6 @@ if test "$with_namepublisher" != no -a "$with_namepublisher" != "none" ; then
     AC_DEFINE(USE_FILE_FOR_NAMEPUB,1,[Define if file should be used for name publisher])
     ;;
 
-    mpd)
-    nameserv_name="mpd"
-    # The mpd nameserver is specific to the mpd process manager
-    foundMPD=no
-    for pm_name in $pm_names ; do
-        if test "$pm_name" = "mpd" ; then 
-	    foundMPD=yes
-	    break
-	fi
-    done
-    if test "$foundMPD" = no ; then
-        AC_MSG_ERROR([The mpd nameserver requires the mpd process manager])
-    fi
-    ;;
-
     *)
     # Check for a new namepublisher
     dir=$with_namepublisher
@@ -2719,7 +2703,6 @@ if test -n "$nameserv_name" ; then
    AC_DEFINE(HAVE_NAMEPUB_SERVICE,1,[Define if a name publishing service is available])
 fi
 AM_CONDITIONAL([BUILD_NAMEPUB_FILE],[test "X$nameserv_name" = "Xfile"])
-AM_CONDITIONAL([BUILD_NAMEPUB_MPD],[test "X$nameserv_name" = "Xmpd"])
 AM_CONDITIONAL([BUILD_NAMEPUB_PMI],[test "X$nameserv_name" = "Xpmi"])
 
 # In case the documentation targets are used, find doctext and attempt to 
diff --git a/doc/design/design.tex b/doc/design/design.tex
index 50e4926..26d3aaa 100644
--- a/doc/design/design.tex
+++ b/doc/design/design.tex
@@ -39,7 +39,7 @@
 \part{MPICH organization for users}
 
 \chapter{Overview}
-     <<up here, explain that MPICH is a framework for MPI implementation with many possible choices, including specialized communication devices and interfaces to process managers, not ch3+mpd.  Duplicate this discussion in the top-level entry for developers>>
+     <<up here, explain that MPICH is a framework for MPI implementation with many possible choices, including specialized communication devices and interfaces to process managers, not ch3+hydra.  Duplicate this discussion in the top-level entry for developers>>
 
 \chapter{Communication Devices}
 
diff --git a/doc/installguide/install.tex.vin b/doc/installguide/install.tex.vin
index c07f4ee..610496a 100644
--- a/doc/installguide/install.tex.vin
+++ b/doc/installguide/install.tex.vin
@@ -709,16 +709,14 @@ Other tests are run on an occasional basis.
 
 % 3) cd into that testing directory
 
-% 4) make sure the process manager (e.g., mpd) is running
-
-% 5) run "<ITS_SRC_DIR>/configure --with-mpich=<MPICH_INSTALL_DIR>", where
+% 4) run "<ITS_SRC_DIR>/configure --with-mpich=<MPICH_INSTALL_DIR>", where
 % <ITS_SRC_DIR> is the path to the directory Intel test suite source (e.g.,
 % /home/toonen/Projects/MPI-Tests/IntelMPITEST) and <MPICH_INSTALL_DIR> is
 % the directory containing your MPICH installation
 
-% 6) mkdir Test; cd Test
+% 5) mkdir Test; cd Test
 
-% 7) find tests in <ITS_SRC_DIR>/{c,fortran} that you are interested in
+% 6) find tests in <ITS_SRC_DIR>/{c,fortran} that you are interested in
 % running and place the test names in a file.  For example:
 
 % % ( cd /home/toonen/Projects/MPI-Tests/IntelMPITEST/Test ; \
@@ -744,14 +742,14 @@ Other tests are run on an occasional basis.
 % Test/fortran/probe_cancel/functional/MPI_Test_cancelled_false
 % %
 
-% 8) run the tests using ../bin/mtest:
+% 7) run the tests using ../bin/mtest:
 
 % % ../bin/mtest -testlist testlist -np 6 |& tee mtest.log
 % %
 
 % NOTE: some programs hang if less they are run with less than 6 processes.
 
-% 9) examine the summary.xml file.  look for '<STATUS>fail</STATUS>' to see if
+% 8) examine the summary.xml file.  look for '<STATUS>fail</STATUS>' to see if
 % any failures occurred.  (search for '>fail<' works as well)
 
 % \end{verbatim}
diff --git a/doc/namepub/namepub.tex b/doc/namepub/namepub.tex
index 498736c..f62f38a 100644
--- a/doc/namepub/namepub.tex
+++ b/doc/namepub/namepub.tex
@@ -56,7 +56,7 @@ To see why another interface is needed, consider the situation in
 Figure~\ref{fig:multiple-pm}.  In this Figure, two MPI programs, each
 started by a different process manager, wish to connect.  For example,
 one MPI job may be run on a batch system (the PBS job in this example)
-and one on an interactive visualization cluster (the MPD job).  
+and one on an interactive visualization cluster.
 
 \begin{figure}
 \centerline{\includegraphics{twopm.eps}}
@@ -153,41 +153,6 @@ from OpenLDAP that can be used to implement the name interface.
 \item[\code{MPID\_NS\_Free}]Use \code{ldap_unbind_s} and \code{ldap_memfree}
 \end{description}
 
-\subsection{MPD Process Manager}
-\label{sec:namepub-mpd}
-
-This name service works only for MPI jobs using the same MPD process
-manager.  However, within this restriction, an MPD name manager can
-exploit the internal communication used by other MPD services.
-Because of the non-collective semantics required by the name
-publishing operations, additional MPD routines must
-be defined.  For example, considering the following additional MPD
-routines:
-\begin{description}
-\item[\code{PMI\_PutIndep}]Put a key/value pair into the MPD system.
-  Associate a user id with the names so that keys are really
-  identified by a user,key pair.
-\item[\code{PMI\_GetIndep}]Get a key/value pair from the MPD system.
-\item[\code{PMI\_RmIndep}]Remove a key/value pair.
-\end{description}
-Values put into the system are removed when the job that inserted them
-exits.  Thus, there is no need for the expiration or reference count
-info values.  
-
-The implementation of the MPI name service calls in terms of these new
-\code{PMI} routines is straightforward:
-
-\begin{description}
-\item[\code{MPID\_NS\_Create}]No operation
-\item[\code{MPID\_NS\_Publish}]Call \code{PMI\_PutIndep}
-\item[\code{MPID\_NS\_Lookup}]Call \code{PMI\_GetIndep}
-\item[\code{MPID\_NS\_Unpublish}]Call \code{PMI\_RmIndep}
-\item[\code{MPID\_NS\_Free}]No operation
-\end{description}
-
-Note that these new PMI routines must be optional; we do not require
-that any process manager provides this service.
-
 \subsection{File}
 \label{sec:namepub-file}
 If all MPI processes share a single filesystem, a simple
diff --git a/doc/pmi/paper.tex b/doc/pmi/paper.tex
index e4e9f58..c8eabf5 100644
--- a/doc/pmi/paper.tex
+++ b/doc/pmi/paper.tex
@@ -407,7 +407,6 @@ We currently are using three separate implementations of the client side of PMI.
   assumes that a socket (the PMI socket) has been created that can be
   used to exchange commands with the server side of the implementation.
   It is used by multiple server implementations, as described below.
-\item[winmpd] is similar to simple, but used in the Windows environment.
 \end{description}
 
 
@@ -424,23 +423,6 @@ are in use or under development.
   also be used in production on SMP's.  It consists of an {\tt mpiexec}
   script that simply forks the parallel processes after setting up the
   PMI socket.  Thus all processes must be on the same machine.
-\item[MPD-2] is a process management system that consists of a ring of
-  daemons, one on each node.  It also supports the ``simple'' client
-  side PMI implementation.  It supplies multiple services for the
-  parallel processes, including scalable startup and stdio management.
-  The ring can be either permanent, run by root, or can be deployed
-  separately for each job.  The MPD daemons fork a ring of ``manager''
-  processes for a single job, and these managers set up the PMI socket
-  before forking the application processes.  The managers hold the KVS's
-  in a distributed way, so that {\tt put} operations are local but {\tt get}
-  requests may have to circulate in the manager ring.  The {\tt barrier}
-  operation is implemented by circulating a token around the manager
-  ring.  Other topologies (e.g. ring of rings) for the MPD's and
-  managers are possible, but have not yet been implemented.
-\item[WinMPD] is the Windows version of MPD-2.  It does not employ
-  intermediate manager processes.  The KVS's are held in a single
-  separate server process, which provides less scalability but is
-  simple and is adequate for small clusters.
 \item[Remshell] uses {\tt rsh} or {\tt ssh} to start the processes from
   the {\tt mpiexec} process, then they connect back to exchange the
   keyval information.  This illustrates the combination of an old ({\tt
@@ -608,23 +590,15 @@ MPICH or MPICH-derived MPI implementations.
 
 MPI and other library implementors are recommended to use the PMI
 functions to exchange data with other processes related to the setting
-up of the primary communication mechanism.  MPICH does this already for
-setting up TCP connections in the CH3 implementation of the Abstract
-Device Interface (ADI-3).  If one links with the ``simple''
+up of the primary communication mechanism.  MPICH does this already
+for setting up TCP connections in the CH3 implementation of the
+Abstract Device Interface (ADI-3).  If one links with the ``simple''
 implementation of the client side of the PMI implementation in MPICH,
-then MPI jobs can be started by any process management environment,
-including MPD2, that implements the server side.
+then MPI jobs can be started by any process management environment
+that implements the server side.
 
 Process management systems, such as PBS, YOD, or SLURM, have two options
-in the short run.  They can deploy the MPD-2 system separately for each
-job, using the {\tt mpdboot} command, before starting a user job with
-{\tt mpirun} or {\tt mpiexec}.  This is similar to the way PBS currently
-starts MPICH and LAM jobs.  A more scalable solution is to directly
-implement the PMI interface itself, by implementing the server side of
-the ``simple'' implementation.  Currently there is little
-documentation on the format of messages that traverse the PMI socket;
-one has to read the code.  We intend to document it in a further short paper
-like this one.
+in the short run.
 
 In the long run implementations may prefer to implement both sides
 themselves, meaning that one would link one's application with a PBS- or
@@ -632,13 +606,13 @@ SLURM- or Myricom-specific object file implementing the client side.
 
 The PMI-related code described here is available in the current MPICH
 distribution~\cite{mpich-web-page}, in the {\tt
-  src/pmi/\{simple,uni,winmpd\}} (client side) and {\tt
-  src/pm/\{forker,mpd,winmpd\}} (server side) subdirectories.
+  src/pmi/\{simple,uni\}} (client side) and {\tt
+  src/pm/forker} (server side) subdirectories.
 Different process managers (the server side) and different PMI
 implementations can be chosen when MPICH is configured.  The default is
 as if one had specified
 \begin{verbatim}
-     configure --with-pmi=simple --with-pm=mpd
+     configure --with-pmi=simple
 \end{verbatim}
 Please send questions and comments to mpich-discuss at mcs.anl.gov.
 
diff --git a/maint/checkbuilds.in b/maint/checkbuilds.in
index d2b0ce9..132388b 100644
--- a/maint/checkbuilds.in
+++ b/maint/checkbuilds.in
@@ -81,8 +81,8 @@ $hasDemon   = 0;
 @with_array = (
 	       'logging;none;rlog',
 	       'pmi;simple',    #; uni no longer supported
-	       'pm;gforker;mpd', #;remshell
-	       'namepublisher;no;file;mpd', #;ldap:ldapserver',
+	       'pm;gforker', #;remshell
+	       'namepublisher;no;file', #;ldap:ldapserver',
 	       'device;ch3;ch3:sock',
 );
 %chosenWith = ();
@@ -289,7 +289,7 @@ sub RunTest {
 	system "rm -f $instdir/lib/libmpe*.a";
     }
     if (-d "$instdir/bin") {
-	system "rm -f $instdir/bin/mpi* $instdir/bin/mpd*";
+	system "rm -f $instdir/bin/mpi*";
     }
     if (-d "$builddir/lib") {
 	system "rm -f $builddir/lib/libmpi*.* $builddir/lib/libmpifort*.*";
@@ -410,8 +410,6 @@ sub RunTest {
 	# print "rc = $rc\n";
 	if ($rc == 0) {
 	    print $OUTFD $MakeStart;
-	    # Remove mpd just in case (see below)
-	    unlink "bin/mpd";
 	    $rc = &RunProgram( "$makepgm $parallelBuild" );
 	    print $OUTFD $MakeEnd;
 	    $make_status = $rc;
@@ -438,12 +436,6 @@ sub RunTest {
 		}
 		print $OUTFD $MakeInstEnd;
 		if ($install_status == 0) {
-		    # FIXME: Get mpd status from the with args ...
-		    if (-x "$instdir/bin/mpd") {
-			$hasDemon   = 1;
-			$StartDemon = "RunMPD";
-			$StopDemon  = "StopMPD";
-		    }
 		    # Try the install check target
 		    print $OUTFD $MakeInstcheckStart;
 		    $installcheck_status = &RunProgram( "$makepgm installcheck" );
@@ -1069,46 +1061,6 @@ sub RunProgram {
     }
     return $rc;
 }
-# ---------------------------------------------------------------------------
-#
-# We need a variation of this that will start MPDs on mulitple hosts.
-# 
-sub RunMPD {
-    # We need to background the mpd.
-    # If there is already an mpd running (for us), we want to stop it
-    my $mpdlocalsock = "/tmp/mpd2.console_". $ENV{"LOGNAME"};
-    my $rc = 0;
-    if (-S $mpdlocalsock) {
-	system "$instdir/bin/mpdallexit";
-        $rc = $? >> 8;
-        if ($rc != 0) {
-            print $OUTFD "Error running $instdir/bin/mpdallexit before starting MPD ($mpdlocalsock exists)\n";
-        }
-    }
-    #system "$instdir/bin/mpd -d";
-    # Try to background mpd
-    system "$instdir/bin/mpd &";
-    $rc = $? >> 8;
-    if ($rc != 0) {
-	print $OUTFD "Error running $instdir/bin/mpd -d\n";
-    }
-    else {
-	print $OUTFD "Started mpd in demon mode\n";
-    }
-    # Wait for the mpd to start
-    sleep 1;
-    return;
-}
-sub StopMPD {
-    my $mpdlocalsock = "/tmp/mpd2.console_". $ENV{"LOGNAME"};
-    if (-S $mpdlocalsock) {
-	system "$instdir/bin/mpdallexit";
-        my $rc = $? >> 8;
-        if ($rc != 0) {
-            print $OUTFD "Error running $instdir/bin/mpdallexit in StopMPD ($mpdlocalsock exists)\n";
-        }
-    }
-}
 #
 # Change output style
 sub XMLStyle {
diff --git a/maint/createcoverage.in b/maint/createcoverage.in
index 91b904c..847f328 100644
--- a/maint/createcoverage.in
+++ b/maint/createcoverage.in
@@ -14,9 +14,8 @@ blddir=/tmp/$LOGNAME/mpich-cov
 mpiinstalldir=/tmp/$LOGNAME/mpich-cinst
 
 logfile=""
-# set pm=mpd if mpd is available
 #pm=gforker
-pm=mpd
+pm=hydra
 # device and channel
 # (we'll also want this to be in the path)
 device="ch3:sock"
@@ -144,14 +143,6 @@ EOF
     esac
 done
 
-if [ "$pm" = "mpd" ] ; then
-    # Make sure that we have a .mpd.conf file
-    if [ ! -s $HOME/.mpd.conf ] ; then
-        echo "mpd requires a .mpd.conf file"
-        exit 1
-    fi
-fi
-
 # Move everthing into a device-specific directory
 webloc="$weblocbase/$device"
 if [ "$update_web" = yes ] ; then
@@ -270,16 +261,8 @@ fi
 if [ $test_mpich = yes ] ; then
     # The mpich tests are easy
     echo "------ Run MPICH Tests ------" >&6
-    if [ "$pm" = mpd ] ; then
-        # Start by running the mpd demon
-        ($mpiinstalldir/bin/mpd -d & ) >&6 2>&6
-    fi
     cd $blddir
     make testing >&6 2>&6
-    if [ "$pm" = mpd ] ; then
-        # Stop the mpd demon
-        ($mpiinstalldir/bin/mpdallexit) >&6 2>&6
-    fi
     echo "------ End Run MPICH Tests ------" >&6
 fi
 
@@ -296,28 +279,16 @@ if [ $test_intel = yes ] ; then
     echo "------ Run Intel Tests ------" >&6
     # The intel tests aren't hard
 
-    if [ "$pm" = mpd ] ; then
-        # Start by running the mpd demon
-        ($mpiinstalldir/bin/mpd -d & ) >&6 2>&6
-    fi
     cd $blddir/othertest/intel
     $intelsrcdir/configure --enable-coverage \
 	--with-mpich=$mpiinstalldir >&6 2>&6
     make clean >&6 2>&6
     make testing >&6 2>&6
-    if [ "$pm" = mpd ] ; then
-        # Stop the mpd demon
-        ($mpiinstalldir/bin/mpdallexit) >&6 2>&6
-    fi
     echo "------ End Run Intel Tests ------" >&6
 fi
 
 if [ $test_cxx = yes ] ; then
     echo "------ Run C++ Tests ------" >&6
-    if [ "$pm" = mpd ] ; then
-        # Start by running the mpd demon
-        ($mpiinstalldir/bin/mpd -d & ) >&6 2>&6
-    fi
     # Neither are the cxx test
     # Build mpicxxtest --enable-coverage (still need to implement)
     cd $blddir/othertest/cxx
@@ -325,19 +296,11 @@ if [ $test_cxx = yes ] ; then
 	--enable-xml  >&6 2>&6
     make clean >&6 2>&6
     make testing >&6 2>&6
-    if [ "$pm" = mpd ] ; then
-        # Stop the mpd demon
-        ($mpiinstalldir/bin/mpdallexit) >&6 2>&6
-    fi
     echo "------ End Run C++ Tests ------" >&6
 fi
 
 if [ $test_io = yes ] ; then
     echo "------ Run MPI-IO Tests ------" >&6
-    if [ "$pm" = mpd ] ; then
-        # Start by running the mpd demon
-        ($mpiinstalldir/bin/mpd -d & ) >&6 2>&6
-    fi
     # These tests do not even have a configure or make!
     cd $blddir/othertest/Testmpio
     $mpiinstalldir/bin/mpicc -o testmpio $iosrcdir/testmpio.c >&6 2>&6
@@ -349,19 +312,11 @@ if [ $test_io = yes ] ; then
         export MPIO_USER_PATH
         $mpiinstalldir/bin/mpiexec -n 4 ./testmpio 1 >&6 2>&6
     fi
-    if [ "$pm" = mpd ] ; then
-        # Stop the mpd demon
-        ($mpiinstalldir/bin/mpdallexit) >&6 2>&6
-    fi
     echo "------ End Run MPI-IO Tests ------" >&6
 fi
 
 if [ $test_mpich1 = yes ] ; then
     echo "------ Run MPICH-1 Tests ------" >&6
-    if [ "$pm" = mpd ] ; then
-        # Start by running the mpd demon
-        ($mpiinstalldir/bin/mpd -d & ) >&6 2>&6
-    fi
     # Nor are the mpich1 tests
     # Build mpich tests --enable-coverage
     #   Need to provide a target that does not do the "runtest -check" step,
@@ -377,10 +332,6 @@ if [ $test_mpich1 = yes ] ; then
 			-prefix=$mpiinstalldir >&6 2>&6
     make clean  >&6 2>&6
     make testing >&6 2>&6
-    if [ "$pm" = mpd ] ; then
-        # Stop the mpd demon
-        ($mpiinstalldir/bin/mpdallexit) >&6 2>&6
-    fi
     echo "------ End Run MPICH-1 Tests ------" >&6
 fi
 
diff --git a/maint/release.pl b/maint/release.pl
index 889d063..8dddd65 100755
--- a/maint/release.pl
+++ b/maint/release.pl
@@ -246,7 +246,6 @@ print("done\n");
 # Remove content that is not being released
 print("===> Removing content that is not being released... ");
 chdir($expdir);
-run_cmd("rm -rf doc/notes src/pm/mpd/Zeroconf.py");
 
 chdir("${expdir}/src/mpid/ch3/channels/nemesis/netmod");
 my @nem_modules = qw(elan);
diff --git a/maint/samplebuilds b/maint/samplebuilds
index e5db277..861db69 100755
--- a/maint/samplebuilds
+++ b/maint/samplebuilds
@@ -62,8 +62,6 @@ fi
 #    config_args - arguments to pass to configure
 #    do_tests    - yes or no; controls tests
 #    srcdir,instdir - directories for source, installation
-#    use_mpd     - yes if mpd demon needs to be started.  The demon
-#                  will be terminated at the end of the tests
 # This uses XML-style tags to mark the various segments, but does not
 # filter the output from the individual steps for XML/SGML characters (e.g.,
 # the <,>,& characters aren't handled).
@@ -87,26 +85,12 @@ if $srcdir/configure --prefix=$instdir $config_args ; then
 	    echo "</MAKEINST>"
 	    if [ "$do_tests" = "yes" ] ; then
 	        echo "<RUNTEST>"
-		if [ "$use_mpd" = "yes" ] ; then
-		    if [ -x $instdir/bin/mpd ] ; then
-			$instdir/bin/mpd -d
-		    else
-		        echo "Cannot find $instdir/bin/mpd!"
-		    fi
-		fi
 	        if make testing ; then
 		    echo "Tests completed in test/mpi/summary.xml"
 		    # Really should copy failures if any
 	        else
 		    echo "Tests failed ($testname)"
 	        fi
-		if [ "$use_mpd" = "yes" ] ; then
-		    if [ -x $instdir/bin/mpdallexit ] ; then
-		        $instdir/bin/mpdallexit
-		    else
-		        echo "Cannot file $instdir/bin/mpdallexit!"
-		    fi
-		fi
 	        echo "</RUNTEST>"
 	    fi
 	else
@@ -136,56 +120,48 @@ echo "</DATE>"
 # Basic test
 testname="basic"
 config_args=""
-use_mpd=yes
 BuildMPICH2
 
 #
 # No Fortran or C++
 testname="no f77/c++"
 config_args="--disable-f77 --disable-cxx"
-use_mpd=yes
 BuildMPICH2
 
 #
 # No Weak symbols
 testname="no weak symbols"
 config_args="--disable-weak-symbols"
-use_mpd=yes
 BuildMPICH2
 
 #
 # --enable-fast
 testname="fast"
 config_args="--enable-fast"
-use_mpd=yes
 BuildMPICH2
 
 #
 # forker pm, strict
 testname="strict and forker"
 config_args="--enable-strict --with-pm=forker"
-use_mpd=no
 BuildMPICH2
 
 #
 # Build and link with a logging library
 testname="logging with lwlog"
 config_args="--with-logging=lwlog --with-pm=forker"
-use_mpd=no
 BuildMPICH2
 
 #
 # Build with memory checking
 testname="memory tests"
 config_args="--enable-g=all --enable-strict"
-use_mpd=yes
 BuildMPICH2
 
 #
 # Build with shared libraries
 testname="sharedlibs"
 config_args="--enable-sharedlibs=gcc"
-use_mpd=yes
 BuildMPICH2
 
 #
@@ -195,7 +171,6 @@ BuildMPICH2
 if [ -d /pvfs ] ; then
     testname="pvfs"
     config_args="--with-romio=--with-file-system=ufs+nfs+testfs+pvfs"
-    use_mpd=yes
     BuildMPICH2
 fi
 # ---------------------------------------------------------------------------
diff --git a/src/nameserv/Makefile.mk b/src/nameserv/Makefile.mk
index d704c17..8cd739e 100644
--- a/src/nameserv/Makefile.mk
+++ b/src/nameserv/Makefile.mk
@@ -6,6 +6,5 @@
 ##
 
 include $(top_srcdir)/src/nameserv/file/Makefile.mk
-include $(top_srcdir)/src/nameserv/mpd/Makefile.mk
 include $(top_srcdir)/src/nameserv/pmi/Makefile.mk
 
diff --git a/src/nameserv/mpd/Makefile.mk b/src/nameserv/mpd/Makefile.mk
deleted file mode 100644
index 18a3ade..0000000
--- a/src/nameserv/mpd/Makefile.mk
+++ /dev/null
@@ -1,14 +0,0 @@
-## -*- Mode: Makefile; -*-
-## vim: set ft=automake :
-##
-## (C) 2011 by Argonne National Laboratory.
-##     See COPYRIGHT in top-level directory.
-##
-
-if BUILD_NAMEPUB_MPD
-
-mpi_core_sources +=   \
-    src/nameserv/mpd/mpd_nameserv.c
-
-endif BUILD_NAMEPUB_MPD
-
diff --git a/src/nameserv/mpd/mpd_nameserv.c b/src/nameserv/mpd/mpd_nameserv.c
deleted file mode 100644
index 751ca07..0000000
--- a/src/nameserv/mpd/mpd_nameserv.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *  (C) 2001 by Argonne National Laboratory.
- *      See COPYRIGHT in top-level directory.
- */
-
-/*
- * This file contains a simple mpd-based implementation of the name server 
- * routines, using the mpd daemons to hold the data, but accessing it through 
- * the PMI interface. 
- * Publishing will go to the local mpd; lookup will search the ring, looking 
- * for the data.
- */
-
-#include "mpiimpl.h"
-#include "namepub.h"
-#include "pmi.h"
-
-/* Define the name service handle.
-   Note that the interface requires that we return a non-null handle to an 
-   object of this type, even though we don't use it. We use a single,
-   statically allocated instance for simplicity. */
-#define MPID_MAX_NAMEPUB 64
-struct MPID_NS_Handle {
-    int foo;			/* unused for now; some compilers object
-				   to empty structs */
-};    
-
-/* Create a structure that we will use to remember files created for
-   publishing.  */
-#undef FUNCNAME
-#define FUNCNAME MPID_NS_Create
-int MPID_NS_Create( const MPID_Info *info_ptr, MPID_NS_Handle *handle_ptr )
-{
-    static struct MPID_NS_Handle myNShandle;
-    *handle_ptr = &myNShandle;	/* The mpd name service needs no local data */
-                                /* All will be handled at the mpd through the 
-				   PMI interface */
-    return 0;
-}
-
-#undef FUNCNAME
-#define FUNCNAME MPID_NS_Publish
-int MPID_NS_Publish( MPID_NS_Handle handle, const MPID_Info *info_ptr, 
-                     const char service_name[], const char port[] )
-{
-    int rc;
-    static const char FCNAME[] = "MPID_NS_Publish";
-
-    rc = PMI_Publish_name( service_name, port );
-    if (rc != PMI_SUCCESS) {
-	/* --BEGIN ERROR HANDLING-- */
-	/* printf( "PMI_Publish_name failed for %s\n", service_name ); */
-	return MPIR_Err_create_code( MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_NAME, "**namepubnotpub", "**namepubnotpub %s", service_name );
-	/* --END ERROR HANDLING-- */
-    }
-
-    return 0;
-}
-
-#undef FUNCNAME
-#define FUNCNAME MPID_NS_Lookup
-int MPID_NS_Lookup( MPID_NS_Handle handle, const MPID_Info *info_ptr,
-                    const char service_name[], char port[] )
-{
-    int rc;
-    static const char FCNAME[] = "MPID_NS_Lookup";
-
-    rc = PMI_Lookup_name( service_name, port );
-    if (rc != PMI_SUCCESS) {
-	/* --BEGIN ERROR HANDLING-- */
-	/* printf( "PMI_Lookup_name failed for %s\n", service_name ); */
-	return MPIR_Err_create_code( MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_NAME, "**namepubnotfound", "**namepubnotfound %s", service_name );
-	/* --END ERROR HANDLING-- */
-    }
-
-    return 0;
-}
-
-#undef FUNCNAME
-#define FUNCNAME MPID_NS_Unpublish
-int MPID_NS_Unpublish( MPID_NS_Handle handle, const MPID_Info *info_ptr, 
-                       const char service_name[] )
-{
-    int rc;
-    static const char FCNAME[] = "MPID_NS_Unpublish";
-
-    rc = PMI_Unpublish_name( service_name );
-    if (rc != PMI_SUCCESS) {
-	/* --BEGIN ERROR HANDLING-- */
-	/* printf( "PMI_Unpublish_name failed for %s\n", service_name ); */
-	return MPIR_Err_create_code( MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_NAME, "**namepubnotunpub", "**namepubnotunpub %s", service_name );
-	/* --END ERROR HANDLING-- */
-    }
-
-    return 0;
-}
-
-#undef FUNCNAME
-#define FUNCNAME MPID_NS_Free
-int MPID_NS_Free( MPID_NS_Handle *handle_ptr )
-{
-    /* MPID_NS_Handle is points to statically allocated storage
-       (see MPID_NS_Create) */
-
-    return 0;
-}
diff --git a/src/pm/Makefile.mk b/src/pm/Makefile.mk
index c640168..2a2d351 100644
--- a/src/pm/Makefile.mk
+++ b/src/pm/Makefile.mk
@@ -30,9 +30,3 @@ SUBDIRS += src/pm/hydra
 DIST_SUBDIRS += src/pm/hydra
 MANDOC_SUBDIRS += src/pm/hydra
 endif BUILD_PM_HYDRA
-
-# uses a separate Makefile.sm, not Makefile.mk
-if BUILD_PM_MPD
-SUBDIRS += src/pm/mpd
-DIST_SUBDIRS += src/pm/mpd
-endif BUILD_PM_MPD
diff --git a/src/pm/gforker/mpiexec.c b/src/pm/gforker/mpiexec.c
index 834133b..4974357 100644
--- a/src/pm/gforker/mpiexec.c
+++ b/src/pm/gforker/mpiexec.c
@@ -58,8 +58,7 @@
 
   The singleton process (in a routine in simple_pmi.c) forks a process and
   execs mpiexe with these arguments, where port is the port to which 
-  mpiexec should connect, interfacename is the name of the network interface
-  (BUG: may not be correctly set as mpd currently ignores it), securitykey
+  mpiexec should connect, interfacename is the name of the network interface, securitykey
   is a place-holder for a key used by the singleton init process to verify
   that the process connecting on the port is the one that was intended, and
   pid is the pid of the singleton init process.
diff --git a/src/pm/mpd/Makefile.am b/src/pm/mpd/Makefile.am
deleted file mode 100644
index 185217c..0000000
--- a/src/pm/mpd/Makefile.am
+++ /dev/null
@@ -1,205 +0,0 @@
-# Makefile.in for mpd2
-# 
-# If we want to slightly alter the way in which our python scripts are installed
-# then we could probably replace this long-ish, error-prone, largely-manual
-# makefile with an automake-flavored one.  As it is, the current version is
-# basically the original Makefile.in modified slightly to account for the
-# elimination of the separate install/install-alt mechanism.
-
-# COMPILE and LINK are the automake names for these variables
-C_COMPILE = $(COMPILE)
-C_LINK	  = $(LINK)
-
-bin_PROGRAMS = mpdroot
-EXTRA_PROGRAMS = sigcatcher infloop
-noinst_HEADERS = mpdconf.h mpdroot.h
-AM_CPPFLAGS = '-DSYSCONFDIR="$(sysconfdir)"'
-
-MPD      = mpd
-MPDBOOT  = mpdboot
-CMDS     = mpiexec mpdtrace mpdringtest mpdlistjobs mpdkilljob mpdsigjob \
-           mpdexit mpdallexit mpdcleanup mpdhelp mpdcheck
-HELPERS  = mpdgdbdrv mpdman mpdlib mpdchkpyver Zeroconf
-
-PYTHON_SOURCE =  ${MPD} ${MPDBOOT} ${CMDS} ${HELPERS}
-
-mpdroot_sources  = mpdroot.c
-example_sources	 = sigcatcher.c infloop.c
-
-# make sure that all of these files end up in a "make dist" tarball
-EXTRA_DIST = ${PYTHON_SOURCE:=.py} autogen.sh
-
-all-local: ${programs}
-	@if [ ! -x ${srcdir}/install.sh ] ; then \
-	    echo "chmod a+x ${srcdir}/install.sh" ;\
-	    if [ ! `chmod a+x ${srcdir}/install.sh` ] ; then \
-	        echo "  chmod ok" ;\
-	    else \
-	        echo "Unable to set ${srcdir}/install.sh file to be executable." ;\
-		echo "Please fix and rerun make" ;\
-	        exit 1 ;\
-	    fi ;\
-	fi
-	@if [ "${DO_MTV}" = "yes" ] ; then \
-	    currdir=`pwd` ; cd ${srcdir}  &&  ${PYTHON} ./mtv_setup.py build_ext --build-lib=$$currdir --build-temp=$$currdir ;\
-	fi
-
-clean-local: 
-	@-rm -f *.o *.dep *~ ${EXAMPLES} core* *.1 *.pyc
-	@-rm -f *.gcno *.gcda *.bb *.bbg
-	@-rm -f ${srcdir}/*.gcno ${srcdir}/*.gcda
-
-CLEANFILES = mtv.so
-
-# if configured with wrong prefix, use:
-#     make prefix=new_install_dir install
-# Note the conditional test for files in PYTHON_SOURCE; this is to allow
-# us to install Zeroconf if present (it is not part of the MPICH release
-# in order to avoid Copyright problems).
-install-exec-local:
-if PRIMARY_PM_MPD
-	@if [ ! -d $(DESTDIR)${bindir} ] ; then \
-	    echo "mkdir -p $(DESTDIR)${bindir} " ;\
-	    mkdir -p $(DESTDIR)${bindir} ;\
-	fi   
-	- at if [ -n "`id | grep uid=0`" ] ; then \
-	    ${INSTALL} -m 4755 mpdroot $(DESTDIR)${bindir}/mpdroot ;\
-        else \
-	    ${INSTALL} -m  755 mpdroot $(DESTDIR)${bindir}/mpdroot ;\
-	fi
-	@echo "copying python files/links into " $(DESTDIR)${bindir}
-	- at for cmd in ${PYTHON_SOURCE} ; do \
-	    if [ ! -s $(srcdir)/$$cmd.py ] ; then continue ; fi ; \
-		sed \
-			-e 's#/usr/bin/env python.*#/usr/bin/env ${PYTHON}#' \
-			-e 's,/etc/mpd.conf,$(sysconfdir)/mpd.conf,g' \
-			${srcdir}/$$cmd.py > $(DESTDIR)${bindir}/temp$$cmd.py ; \
-	    ${INSTALL} -m 755 $(DESTDIR)${bindir}/temp$$cmd.py $(DESTDIR)${bindir}/$$cmd.py; \
-	    ( rm -f $(DESTDIR)${bindir}/temp$$cmd.py >/dev/null 2>&1 || exit 0 ) ; \
-	done
-	- at cd $(DESTDIR)${bindir} && rm -f mpd
-	- at cd $(DESTDIR)${bindir} && $(LN_S) mpd.py mpd
-	- at cd $(DESTDIR)${bindir} && rm -f mpdboot
-	- at cd $(DESTDIR)${bindir} && $(LN_S) mpdboot.py mpdboot
-	- at for cmd in ${CMDS} ; do \
-	    ( cd $(DESTDIR)${bindir} && rm -f $$cmd ; ) ; \
-	    ( cd $(DESTDIR)${bindir} && $(LN_S) $$cmd.py $$cmd ; ) \
-	done
-	-@( rm -f $(DESTDIR)${bindir}/mpdrun >/dev/null 2>&1 || exit 0 )
-	-@( rm -f $(DESTDIR)${bindir}/mpdrun.py >/dev/null 2>&1 || exit 0 )
-	-@( rm -f $(DESTDIR)${bindir}/mpirun >/dev/null 2>&1 || exit 0 )
-	-@( rm -f $(DESTDIR)${bindir}/mpirun.py >/dev/null 2>&1 || exit 0 )
-	- at cd $(DESTDIR)${bindir} && $(LN_S) mpiexec mpdrun
-	- at cd $(DESTDIR)${bindir} && $(LN_S) mpiexec.py mpdrun.py
-	- at cd $(DESTDIR)${bindir} && $(LN_S) mpiexec mpirun
-	- at cd $(DESTDIR)${bindir} && $(LN_S) mpiexec.py mpirun.py
-	- at if [ "${DO_MTV}" = "yes" ] ; then \
-	    ${INSTALL} -m 755 mtv.so $(DESTDIR)${bindir}/mtv.so ;\
-	fi
-else !PRIMARY_PM_MPD
-## This is the former body of the "install-alt" target
-## The purpose of this "target" is to allow users to use mpiexec.mpd to run
-## MPICH programs using the MPD process manager when they configure MPICH
-## to build multiple process managers.
-	@echo "MPD alternate PM installation"
-	@echo "copying python files/links into " $(DESTDIR)${bindir}
-	@if [ ! -d $(DESTDIR)${bindir} ] ; then \
-	    echo "mkdir -p $(DESTDIR)${bindir} " ;\
-	    mkdir -p $(DESTDIR)${bindir} ;\
-	fi   
-	for cmd in ${PYTHON_SOURCE} ; do \
-	    if [ ! -s $(srcdir)/$$cmd.py ] ; then continue ; fi ; \
-	    sed -e 's#/usr/bin/env python.*#/usr/bin/env ${PYTHON}#' ${srcdir}/$$cmd.py > $(DESTDIR)${bindir}/temp$$cmd.py ; \
-	    ${INSTALL} -m 755 $(DESTDIR)${bindir}/temp$$cmd.py $(DESTDIR)${bindir}/$$cmd.py; \
-	    ( rm -f $(DESTDIR)${bindir}/temp$$cmd.py >/dev/null 2>&1 || exit 0 ) ; \
-	done
-	cd $(DESTDIR)${bindir} && rm -f mpd
-	cd $(DESTDIR)${bindir} && $(LN_S) mpd.py mpd
-	cd $(DESTDIR)${bindir} && rm -f mpdboot
-	cd $(DESTDIR)${bindir} && $(LN_S) mpdboot.py mpdboot
-	for cmd in ${CMDS} ; do \
-	    if [ $$cmd = "mpiexec" ] ; then continue ; fi ; \
-	    ( cd $(DESTDIR)${bindir} && rm -f $$cmd ; ) ; \
-	    ( cd $(DESTDIR)${bindir} && $(LN_S) $$cmd.py $$cmd ; ) \
-	done
-	( rm -f $(DESTDIR)${bindir}/mpdrun >/dev/null 2>&1 || exit 0 )
-	( rm -f $(DESTDIR)${bindir}/mpdrun.py >/dev/null 2>&1 || exit 0 )
-	mv -f $(DESTDIR)${bindir}/mpiexec.py $(DESTDIR)${bindir}/mpiexec.mpd
-	cd $(DESTDIR)${bindir} && $(LN_S) mpiexec.mpd mpdrun
-endif !PRIMARY_PM_MPD
-
-uninstall-local:
-	-rm -f $(DESTDIR)${bindir}/mpdroot
-	-rm -f $(DESTDIR)${bindir}/Zeroconf.py
-	-rm -f $(DESTDIR)${bindir}/mpd
-	-rm -f $(DESTDIR)${bindir}/mpd.py
-	-rm -f $(DESTDIR)${bindir}/mpdallexit
-	-rm -f $(DESTDIR)${bindir}/mpdallexit.py
-	-rm -f $(DESTDIR)${bindir}/mpdboot
-	-rm -f $(DESTDIR)${bindir}/mpdboot.py
-	-rm -f $(DESTDIR)${bindir}/mpdcheck
-	-rm -f $(DESTDIR)${bindir}/mpdcheck.py
-	-rm -f $(DESTDIR)${bindir}/mpdchkpyver.py
-	-rm -f $(DESTDIR)${bindir}/mpdcleanup
-	-rm -f $(DESTDIR)${bindir}/mpdcleanup.py
-	-rm -f $(DESTDIR)${bindir}/mpdexit
-	-rm -f $(DESTDIR)${bindir}/mpdexit.py
-	-rm -f $(DESTDIR)${bindir}/mpdgdbdrv.py
-	-rm -f $(DESTDIR)${bindir}/mpdhelp
-	-rm -f $(DESTDIR)${bindir}/mpdhelp.py
-	-rm -f $(DESTDIR)${bindir}/mpdkilljob
-	-rm -f $(DESTDIR)${bindir}/mpdkilljob.py
-	-rm -f $(DESTDIR)${bindir}/mpdlib.py
-	-rm -f $(DESTDIR)${bindir}/mpdlib.pyc
-	-rm -f $(DESTDIR)${bindir}/mpdlistjobs
-	-rm -f $(DESTDIR)${bindir}/mpdlistjobs.py
-	-rm -f $(DESTDIR)${bindir}/mpdman.py
-	-rm -f $(DESTDIR)${bindir}/mpdman.pyc
-	-rm -f $(DESTDIR)${bindir}/mpdringtest
-	-rm -f $(DESTDIR)${bindir}/mpdringtest.py
-	-rm -f $(DESTDIR)${bindir}/mpdrun
-	-rm -f $(DESTDIR)${bindir}/mpdrun.py
-	-rm -f $(DESTDIR)${bindir}/mpdsigjob
-	-rm -f $(DESTDIR)${bindir}/mpdsigjob.py
-	-rm -f $(DESTDIR)${bindir}/mpdtrace
-	-rm -f $(DESTDIR)${bindir}/mpdtrace.py
-	-rm -f $(DESTDIR)${bindir}/mpecc.in
-	-rm -f $(DESTDIR)${bindir}/mpefc.in
-	-rm -f $(DESTDIR)${bindir}/mpiexec
-	-rm -f $(DESTDIR)${bindir}/mpiexec.py
-	-rm -f $(DESTDIR)${bindir}/mpirun
-	-rm -f $(DESTDIR)${bindir}/mpirun.py
-
-## DJG: these two rules seem to be unused...
-mpich-mpdroot: mpich-mpdroot.o
-	$(C_LINK) -o mpich-mpdroot mpich-mpdroot.o $(LIBS)
-	rm -f mpich-mpdroot.o
-
-mpich-mpdroot.o: ${srcdir}/mpdroot.c ${srcdir}/mpdroot.h mpdconf.h
-	${INSTALL} -m 644 ${srcdir}/mpdroot.c mpich-mpdroot.c
-	${C_COMPILE} -DSYSCONFDIR=\"$(sysconfdir)\" -c mpich-mpdroot.c
-	rm -f mpich-mpdroot.c
-
-# Empty documentations targets (MPICH wants this target)
-htmldoc:
-latexdoc:
-
-# make MPICH happy
-coverage:
-
-# EXPERIMENTAL TOTALVIEW STUFF
-
-# EXPERIMENTAL MAN STUFF
-mandoc:
-	- at for cmd in ${PYTHON_SOURCE} ; do \
-	    cd ${srcdir} &&  pydoc $$cmd | txt2man -t $$cmd -s 1 -v "mpd cmds" | awk ' !/Help on module/ { print } ' > ../../../man/man1/$$cmd.1 ; \
-	done
-# (Note to makefile maintainers: not all make programs accept comments in
-# the commands for a target; all Makefile comments must begin in the first
-# column)
-# example:  nroff -man mpd.1 | less
-
-install-man-local:
-	- at for cmd in ${PYTHON_SOURCE} ; do \
-		${INSTALL} -m 644 $$cmd.1 $(DESTDIR)${mandir}/man1/$$cmd.1 ; \
-	done
diff --git a/src/pm/mpd/README b/src/pm/mpd/README
deleted file mode 100644
index 58a5ff5..0000000
--- a/src/pm/mpd/README
+++ /dev/null
@@ -1,243 +0,0 @@
-
-
-		   README for MPD 1.0.0 - May, 2005
-
-
-General
--------
-
-MPD is a process management system for starting parallel jobs,
-especially MPICH jobs.  Before running a job (with mpiexec), the
-mpd daemons must be running on each host and connected into a ring.
-This README explains how to do that and also test and manage the daemons 
-after they have been started.
-
-You need to have Python version 2.2 or later installed to run the mpd.
-You can type
-
-    which python
-
-to make sure you have it installed, and 
-
-    python
-
-to find out what your version is.  The current version can be obtained
-from  www.python.org.
-
-Type 
-
-    mpdhelp
-
-for a list of mpd-related commands.  Each command can be run with the
---help argument for usage information.
-
-
-How to use MPD
---------------
-
-(Another version of these startup instructions can be found in the
-mpich/README at the top level of the MPICH distribution.)
-
-You can start one mpd on the current host by running
-
-   mpd &
-
-This starts a ring of one mpd.  Other mpd's join the ring by being run
-with host and port arguments for the first mpd.  You can automate this
-process by using mpdboot.
- 
-Make a file with machine names in it.  This file may or may not include the
-local machine.  It will be handy to use the default, which is ./mpd.hosts .
-
-donner% cat ./mpd.hosts
-donner.mcs.anl.gov
-foo.mcs.anl.gov
-shakey.mcs.anl.gov
-terra.mcs.anl.gov
-donner% 
-
-After mpich is built, the mpd commands are in mpich/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, so that it will be picked up by the mpd's that
-are started remotely:
-
-Put in .cshrc:  setenv PATH /home/you/mpich/bin:$PATH
-
-Put in .bashrc: export PATH=/home/you/mpich/bin:$PATH
-
-To start some mpds, use mpdboot.  It uses the mpd.hosts file:
-
-donner% mpdboot -n 4 
-donner%
-
-This command starts a total of 4 daemons, one on the local machine and the
-rest on machines in the mpd.hosts file.  You can specify another file (-f) or
-another mpd command (-m).  The mpdboot command uses ssh to start the mpd on
-each machine in the mpd.hosts file.
-
-You can use mpdtrace to see where your mpd's are running:
-
-donner% mpdtrace
-donner
-foo
-shakey
-donner% 
-
-You can run something with mpiexec
-
-donner% mpiexec -np 2 hostname 
-donner.mcs.anl.gov
-foo.mcs.anl.gov
-donner%
-
-You can run an mpich job:
-
-donner% mpiexec -np 10 /home/lusk/hellow
-Hello world from process 0 of 10
-Hello world from process 1 of 10
-Hello world from process 2 of 10
-Hello world from process 3 of 10
-Hello world from process 4 of 10
-Hello world from process 5 of 10
-Hello world from process 6 of 10
-Hello world from process 7 of 10
-Hello world from process 9 of 10
-Hello world from process 8 of 10
-donner% 
-
-You can take down the daemons:
-
-donner% mpdallexit
-donner%
-
-If things go bad and daemons seem to be in a bad state, you can remove the
-Unix sockets on all the machines in mpd.hosts by doing a cleanup:
-
-donner% mpdcleanup
-
-
-Parallel Debugging
-----------------------------
-
-There are at least 3 methods by which you may do parallel debugging
-via mpd.
-
-1.  MPD provides support for the totalview debugger via the -tv option to
-mpiexec.  Of course you must have a licensed copy of totalview to use
-this option.  Also, you must have configured with --enable-totalview.
-
-2.  You can also start GUI debuggers such as ddd on each process that you
-    execute, e.g.:
-        mpiexec -n 2 ddd mypgm
-This option is really only useful for small numbers of processes 
-since you will create a window per process.
-
-3.  This release also contains some specific support for using gdb to
-debug parallel programs. It is an interactive option of mpiexec that
-starts each application under the control of gdb and also (initially)
-broadcasts each gdb command to all processes, merging identical output
-from multiple processes into a single, labelled line.  It also adds
-one extra command, the "z" command, which can be used to select a
-process or range of proccesses for input to be directed to.  With no
-arguments it reverts to broadcasting subsequent commands to all processes.
-This capability can be seen in the following transcript of a session with
-mpiexec debugging 10 processes.  After the breakpoint at line 30 and two
-single steps, process 0 is selected ("z 0") and stepped once separately,
-to synchronize it with the other processes just before the MPI_Bcast.
-Then all processes are selected again ("z") and the next "n" steps them
-all through the broadcast together.
-
-Example of running  mpiexec with -gdb:
-
-(magpie:52) % ./mpiexec.py -gdb -n 8 ~/mpich/examples/cpi
-0-7:  (gdb) l 36
-0-7:  31	
-0-7:  32	    fprintf(stdout,"Process %d of %d is on %s\n",
-0-7:  33		    myid, numprocs, processor_name);
-0-7:  34	    fflush(stdout);
-0-7:  35	
-0-7:  36	    n = 10000;			/* default # of rectangles */
-0-7:  37	    if (myid == 0)
-0-7:  38		startwtime = MPI_Wtime();
-0-7:  39	
-0-7:  40	    MPI_Bcast(&n, 1, MPI_INT, 0, MPI_COMM_WORLD);
-0-7:  (gdb) b 36
-0-7:  Breakpoint 2 at 0x80493ac: file cpi.c, line 36.
-0-7:  (gdb) r
-0-7:  Continuing.
-0:  Process 0 of 8 is on magpie
-1:  Process 1 of 8 is on magpie
-2:  Process 2 of 8 is on magpie
-3:  Process 3 of 8 is on magpie
-4:  Process 4 of 8 is on magpie
-5:  Process 5 of 8 is on magpie
-6:  Process 6 of 8 is on magpie
-7:  Process 7 of 8 is on magpie
-0-7:  
-1:  Breakpoint 2, main (argc=1, argv=0xbfffe914) at cpi.c:36
-2:  Breakpoint 2, main (argc=1, argv=0xbfffe894) at cpi.c:36
-3:  Breakpoint 2, main (argc=1, argv=0xbfffe814) at cpi.c:36
-4:  Breakpoint 2, main (argc=1, argv=0xbfffe794) at cpi.c:36
-5:  Breakpoint 2, main (argc=1, argv=0xbfffe714) at cpi.c:36
-6:  Breakpoint 2, main (argc=1, argv=0xbfffe694) at cpi.c:36
-7:  Breakpoint 2, main (argc=1, argv=0xbfffe614) at cpi.c:36
-0:  Breakpoint 2, main (argc=1, argv=0xbfffe994) at cpi.c:36
-0-7:  36	    n = 10000;			/* default # of rectangles */
-0-7:  (gdb) n
-0-7:  37	    if (myid == 0)
-0-7:  (gdb) n
-0:  38		startwtime = MPI_Wtime();
-1-7:  40	    MPI_Bcast(&n, 1, MPI_INT, 0, MPI_COMM_WORLD);
-0-7:  (gdb) z 0
-0:  (gdb) n
-0:  40	    MPI_Bcast(&n, 1, MPI_INT, 0, MPI_COMM_WORLD);
-0:  (gdb) z
-0-7:  (gdb) n
-0-7:  42	    h   = 1.0 / (double) n;
-0-7:  (gdb) n
-0-7:  43	    sum = 0.0;
-0-7:  (gdb) n
-0-7:  45	    for (i = myid + 1; i <= n; i += numprocs)
-0-7:  (gdb) n
-0-7:  47		x = h * ((double)i - 0.5);
-0-7:  (gdb) n
-0-7:  48		sum += f(x);
-0-7:  (gdb) n
-0-7:  45	    for (i = myid + 1; i <= n; i += numprocs)
-0-7:  (gdb) n
-0-7:  47		x = h * ((double)i - 0.5);
-0-7:  (gdb) n
-0-7:  48		sum += f(x);
-0-7:  (gdb) n
-0-7:  45	    for (i = myid + 1; i <= n; i += numprocs)
-0-7:  (gdb) n
-0-7:  47		x = h * ((double)i - 0.5);
-0-7:  (gdb) n
-0-7:  48		sum += f(x);
-0-7:  (gdb) n
-0-7:  45	    for (i = myid + 1; i <= n; i += numprocs)
-0-7:  (gdb) n
-0-7:  47		x = h * ((double)i - 0.5);
-0-7:  (gdb) n
-0-7:  48		sum += f(x);
-0-7:  (gdb) p sum
-0:  $1 = 11.999986210031736
-1:  $1 = 11.999984050040775
-2:  $1 = 11.999981650051732
-3:  $1 = 11.999979010064893
-4:  $1 = 11.999976130080572
-5:  $1 = 11.999973010099122
-6:  $1 = 11.999969650120912
-7:  $1 = 11.999966050146345
-0-7:  (gdb) c
-0-7:  Continuing.
-0:  pi is approximately 3.1415926544231247, Error is 0.0000000008333316
-1-7:  
-1-7:  Program exited normally.
-1-7:  (gdb) 0:  wall clock time = 50.726732
-0:  
-0:  Program exited normally.
-0:  (gdb) q
-0-7:  MPIGDB ENDING
-(magpie:53) % 
diff --git a/src/pm/mpd/Zeroconf.py b/src/pm/mpd/Zeroconf.py
deleted file mode 100755
index bc93362..0000000
--- a/src/pm/mpd/Zeroconf.py
+++ /dev/null
@@ -1,1577 +0,0 @@
-#!/usr/bin/env python
-
-# minor chgs made by RMB and marked with initials
-
-""" Multicast DNS Service Discovery for Python, v0.12
-    Copyright (C) 2003, Paul Scott-Murphy
-
-    This module provides a framework for the use of DNS Service Discovery
-    using IP multicast.  It has been tested against the JRendezvous
-    implementation from <a href="http://strangeberry.com">StrangeBerry</a>,
-    and against the mDNSResponder from Mac OS X 10.3.8.
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-	
-"""
-
-"""0.12 update - allow selection of binding interface
-		 typo fix - Thanks A. M. Kuchlingi
-		 removed all use of word 'Rendezvous' - this is an API change"""
-
-"""0.11 update - correction to comments for addListener method
-                 support for new record types seen from OS X
-				  - IPv6 address
-				  - hostinfo
-				 ignore unknown DNS record types
-				 fixes to name decoding
-				 works alongside other processes using port 5353 (e.g. on Mac OS X)
-				 tested against Mac OS X 10.3.2's mDNSResponder
-				 corrections to removal of list entries for service browser"""
-
-"""0.10 update - Jonathon Paisley contributed these corrections:
-                 always multicast replies, even when query is unicast
-				 correct a pointer encoding problem
-				 can now write records in any order
-				 traceback shown on failure
-				 better TXT record parsing
-				 server is now separate from name
-				 can cancel a service browser
-
-				 modified some unit tests to accommodate these changes"""
-
-"""0.09 update - remove all records on service unregistration
-                 fix DOS security problem with readName"""
-
-"""0.08 update - changed licensing to LGPL"""
-
-"""0.07 update - faster shutdown on engine
-                 pointer encoding of outgoing names
-				 ServiceBrowser now works
-				 new unit tests"""
-
-"""0.06 update - small improvements with unit tests
-                 added defined exception types
-				 new style objects
-				 fixed hostname/interface problem
-				 fixed socket timeout problem
-				 fixed addServiceListener() typo bug
-				 using select() for socket reads
-				 tested on Debian unstable with Python 2.2.2"""
-
-"""0.05 update - ensure case insensitivty on domain names
-                 support for unicast DNS queries"""
-
-"""0.04 update - added some unit tests
-                 added __ne__ adjuncts where required
-				 ensure names end in '.local.'
-				 timeout on receiving socket for clean shutdown"""
-
-__author__ = "Paul Scott-Murphy"
-__email__ = "paul at scott dash murphy dot com"
-__version__ = "0.12"
-
-import string
-import time
-import struct
-import socket
-import threading
-import select
-import traceback
-
-__all__ = ["Zeroconf", "ServiceInfo", "ServiceBrowser"]
-
-# hook for threads
-
-globals()['_GLOBAL_DONE'] = 0
-
-# Some timing constants
-
-_UNREGISTER_TIME = 125
-_CHECK_TIME = 175
-_REGISTER_TIME = 225
-_LISTENER_TIME = 200
-_BROWSER_TIME = 500
-
-# Some DNS constants
-	
-_MDNS_ADDR = '224.0.0.251'
-_MDNS_PORT = 5353;
-_DNS_PORT = 53;
-_DNS_TTL = 60 * 60; # one hour default TTL
-
-_MAX_MSG_TYPICAL = 1460 # unused
-_MAX_MSG_ABSOLUTE = 8972
-
-_FLAGS_QR_MASK = 0x8000 # query response mask
-_FLAGS_QR_QUERY = 0x0000 # query
-_FLAGS_QR_RESPONSE = 0x8000 # response
-
-_FLAGS_AA = 0x0400 # Authorative answer
-_FLAGS_TC = 0x0200 # Truncated
-_FLAGS_RD = 0x0100 # Recursion desired
-_FLAGS_RA = 0x8000 # Recursion available
-
-_FLAGS_Z = 0x0040 # Zero
-_FLAGS_AD = 0x0020 # Authentic data
-_FLAGS_CD = 0x0010 # Checking disabled
-
-_CLASS_IN = 1
-_CLASS_CS = 2
-_CLASS_CH = 3
-_CLASS_HS = 4
-_CLASS_NONE = 254
-_CLASS_ANY = 255
-_CLASS_MASK = 0x7FFF
-_CLASS_UNIQUE = 0x8000
-
-_TYPE_A = 1
-_TYPE_NS = 2
-_TYPE_MD = 3
-_TYPE_MF = 4
-_TYPE_CNAME = 5
-_TYPE_SOA = 6
-_TYPE_MB = 7
-_TYPE_MG = 8
-_TYPE_MR = 9
-_TYPE_NULL = 10
-_TYPE_WKS = 11
-_TYPE_PTR = 12
-_TYPE_HINFO = 13
-_TYPE_MINFO = 14
-_TYPE_MX = 15
-_TYPE_TXT = 16
-_TYPE_AAAA = 28
-_TYPE_SRV = 33
-_TYPE_ANY =  255
-
-# Mapping constants to names
-
-_CLASSES = { _CLASS_IN : "in",
-			 _CLASS_CS : "cs",
-			 _CLASS_CH : "ch",
-			 _CLASS_HS : "hs",
-			 _CLASS_NONE : "none",
-			 _CLASS_ANY : "any" }
-
-_TYPES = { _TYPE_A : "a",
-		   _TYPE_NS : "ns",
-		   _TYPE_MD : "md",
-		   _TYPE_MF : "mf",
-		   _TYPE_CNAME : "cname",
-		   _TYPE_SOA : "soa",
-		   _TYPE_MB : "mb",
-		   _TYPE_MG : "mg",
-		   _TYPE_MR : "mr",
-		   _TYPE_NULL : "null",
-		   _TYPE_WKS : "wks",
-		   _TYPE_PTR : "ptr",
-		   _TYPE_HINFO : "hinfo",
-		   _TYPE_MINFO : "minfo",
-		   _TYPE_MX : "mx",
-		   _TYPE_TXT : "txt",
-		   _TYPE_AAAA : "quada",
-		   _TYPE_SRV : "srv",
-		   _TYPE_ANY : "any" }
-
-# utility functions
-
-def currentTimeMillis():
-	"""Current system time in milliseconds"""
-	return time.time() * 1000
-
-# Exceptions
-
-class NonLocalNameException(Exception):
-	pass
-
-class NonUniqueNameException(Exception):
-	pass
-
-class NamePartTooLongException(Exception):
-	pass
-
-class AbstractMethodException(Exception):
-	pass
-
-class BadTypeInNameException(Exception):
-	pass
-
-# implementation classes
-
-class DNSEntry(object):
-	"""A DNS entry"""
-	
-	def __init__(self, name, type, clazz):
-		self.key = string.lower(name)
-		self.name = name
-		self.type = type
-		self.clazz = clazz & _CLASS_MASK
-		self.unique = (clazz & _CLASS_UNIQUE) != 0
-
-	def __eq__(self, other):
-		"""Equality test on name, type, and class"""
-		if isinstance(other, DNSEntry):
-			return self.name == other.name and self.type == other.type and self.clazz == other.clazz
-		return 0
-
-	def __ne__(self, other):
-		"""Non-equality test"""
-		return not self.__eq__(other)
-
-	def getClazz(self, clazz):
-		"""Class accessor"""
-		try:
-			return _CLASSES[clazz]
-		except:
-			return "?(%s)" % (clazz)
-
-	def getType(self, type):
-		"""Type accessor"""
-		try:
-			return _TYPES[type]
-		except:
-			return "?(%s)" % (type)
-
-	def toString(self, hdr, other):
-		"""String representation with additional information"""
-		result = "%s[%s,%s" % (hdr, self.getType(self.type), self.getClazz(self.clazz))
-		if self.unique:
-			result += "-unique,"
-		else:
-			result += ","
-		result += self.name
-		if other is not None:
-			result += ",%s]" % (other)
-		else:
-			result += "]"
-		return result
-
-class DNSQuestion(DNSEntry):
-	"""A DNS question entry"""
-	
-	def __init__(self, name, type, clazz):
-		## RMB COMMENT OUT THIS IF-RAISE FOR UNICAST ??  probably not sufficient
-		if not name.endswith(".local."):
-			raise NonLocalNameException
-		DNSEntry.__init__(self, name, type, clazz)
-
-	def answeredBy(self, rec):
-		"""Returns true if the question is answered by the record"""
-		return self.clazz == rec.clazz and (self.type == rec.type or self.type == _TYPE_ANY) and self.name == rec.name
-
-	def __repr__(self):
-		"""String representation"""
-		return DNSEntry.toString(self, "question", None)
-
-
-class DNSRecord(DNSEntry):
-	"""A DNS record - like a DNS entry, but has a TTL"""
-	
-	def __init__(self, name, type, clazz, ttl):
-		DNSEntry.__init__(self, name, type, clazz)
-		self.ttl = ttl
-		self.created = currentTimeMillis()
-
-	def __eq__(self, other):
-		"""Tests equality as per DNSRecord"""
-		if isinstance(other, DNSRecord):
-			return DNSEntry.__eq__(self, other)
-		return 0
-
-	def suppressedBy(self, msg):
-		"""Returns true if any answer in a message can suffice for the
-		information held in this record."""
-		for record in msg.answers:
-			if self.suppressedByAnswer(record):
-				return 1
-		return 0
-
-	def suppressedByAnswer(self, other):
-		"""Returns true if another record has same name, type and class,
-		and if its TTL is at least half of this record's."""
-		if self == other and other.ttl > (self.ttl / 2):
-			return 1
-		return 0
-
-	def getExpirationTime(self, percent):
-		"""Returns the time at which this record will have expired
-		by a certain percentage."""
-		return self.created + (percent * self.ttl * 10)
-
-	def getRemainingTTL(self, now):
-		"""Returns the remaining TTL in seconds."""
-		return max(0, (self.getExpirationTime(100) - now) / 1000)
-
-	def isExpired(self, now):
-		"""Returns true if this record has expired."""
-		return self.getExpirationTime(100) <= now
-
-	def isStale(self, now):
-		"""Returns true if this record is at least half way expired."""
-		return self.getExpirationTime(50) <= now
-
-	def resetTTL(self, other):
-		"""Sets this record's TTL and created time to that of
-		another record."""
-		self.created = other.created
-		self.ttl = other.ttl
-
-	def write(self, out):
-		"""Abstract method"""
-		raise AbstractMethodException
-
-	def toString(self, other):
-		"""String representation with addtional information"""
-		arg = "%s/%s,%s" % (self.ttl, self.getRemainingTTL(currentTimeMillis()), other)
-		return DNSEntry.toString(self, "record", arg)
-
-class DNSAddress(DNSRecord):
-	"""A DNS address record"""
-	
-	def __init__(self, name, type, clazz, ttl, address):
-		DNSRecord.__init__(self, name, type, clazz, ttl)
-		self.address = address
-
-	def write(self, out):
-		"""Used in constructing an outgoing packet"""
-		out.writeString(self.address, len(self.address))
-
-	def __eq__(self, other):
-		"""Tests equality on address"""
-		if isinstance(other, DNSAddress):
-			return self.address == other.address
-		return 0
-
-	def __repr__(self):
-		"""String representation"""
-		try:
-			return socket.inet_ntoa(self.address)
-		except:
-			return self.address
-
-class DNSHinfo(DNSRecord):
-	"""A DNS host information record"""
-
-	def __init__(self, name, type, clazz, ttl, cpu, os):
-		DNSRecord.__init__(self, name, type, clazz, ttl)
-		self.cpu = cpu
-		self.os = os
-
-	def write(self, out):
-		"""Used in constructing an outgoing packet"""
-		out.writeString(self.cpu, len(self.cpu))
-		out.writeString(self.os, len(self.os))
-
-	def __eq__(self, other):
-		"""Tests equality on cpu and os"""
-		if isinstance(other, DNSHinfo):
-			return self.cpu == other.cpu and self.os == other.os
-		return 0
-
-	def __repr__(self):
-		"""String representation"""
-		return self.cpu + " " + self.os
-	
-class DNSPointer(DNSRecord):
-	"""A DNS pointer record"""
-	
-	def __init__(self, name, type, clazz, ttl, alias):
-		DNSRecord.__init__(self, name, type, clazz, ttl)
-		self.alias = alias
-
-	def write(self, out):
-		"""Used in constructing an outgoing packet"""
-		out.writeName(self.alias)
-
-	def __eq__(self, other):
-		"""Tests equality on alias"""
-		if isinstance(other, DNSPointer):
-			return self.alias == other.alias
-		return 0
-
-	def __repr__(self):
-		"""String representation"""
-		return self.toString(self.alias)
-
-class DNSText(DNSRecord):
-	"""A DNS text record"""
-	
-	def __init__(self, name, type, clazz, ttl, text):
-		DNSRecord.__init__(self, name, type, clazz, ttl)
-		self.text = text
-
-	def write(self, out):
-		"""Used in constructing an outgoing packet"""
-		out.writeString(self.text, len(self.text))
-
-	def __eq__(self, other):
-		"""Tests equality on text"""
-		if isinstance(other, DNSText):
-			return self.text == other.text
-		return 0
-
-	def __repr__(self):
-		"""String representation"""
-		if len(self.text) > 10:
-			return self.toString(self.text[:7] + "...")
-		else:
-			return self.toString(self.text)
-
-class DNSService(DNSRecord):
-	"""A DNS service record"""
-	
-	def __init__(self, name, type, clazz, ttl, priority, weight, port, server):
-		DNSRecord.__init__(self, name, type, clazz, ttl)
-		self.priority = priority
-		self.weight = weight
-		self.port = port
-		self.server = server
-
-	def write(self, out):
-		"""Used in constructing an outgoing packet"""
-		out.writeShort(self.priority)
-		out.writeShort(self.weight)
-		out.writeShort(self.port)
-		out.writeName(self.server)
-
-	def __eq__(self, other):
-		"""Tests equality on priority, weight, port and server"""
-		if isinstance(other, DNSService):
-			return self.priority == other.priority and self.weight == other.weight and self.port == other.port and self.server == other.server
-		return 0
-
-	def __repr__(self):
-		"""String representation"""
-		return self.toString("%s:%s" % (self.server, self.port))
-
-class DNSIncoming(object):
-	"""Object representation of an incoming DNS packet"""
-	
-	def __init__(self, data):
-		"""Constructor from string holding bytes of packet"""
-		self.offset = 0
-		self.data = data
-		self.questions = []
-		self.answers = []
-		self.numQuestions = 0
-		self.numAnswers = 0
-		self.numAuthorities = 0
-		self.numAdditionals = 0
-		
-		self.readHeader()
-		self.readQuestions()
-		self.readOthers()
-
-	def readHeader(self):
-		"""Reads header portion of packet"""
-		format = '!HHHHHH'
-		length = struct.calcsize(format)
-		info = struct.unpack(format, self.data[self.offset:self.offset+length])
-		self.offset += length
-
-		self.id = info[0]
-		self.flags = info[1]
-		self.numQuestions = info[2]
-		self.numAnswers = info[3]
-		self.numAuthorities = info[4]
-		self.numAdditionals = info[5]
-
-	def readQuestions(self):
-		"""Reads questions section of packet"""
-		format = '!HH'
-		length = struct.calcsize(format)
-		for i in range(0, self.numQuestions):
-			name = self.readName()
-			info = struct.unpack(format, self.data[self.offset:self.offset+length])
-			self.offset += length
-			
-			question = DNSQuestion(name, info[0], info[1])
-			self.questions.append(question)
-
-	def readInt(self):
-		"""Reads an integer from the packet"""
-		format = '!I'
-		length = struct.calcsize(format)
-		info = struct.unpack(format, self.data[self.offset:self.offset+length])
-		self.offset += length
-		return info[0]
-
-	def readCharacterString(self):
-		"""Reads a character string from the packet"""
-		length = ord(self.data[self.offset])
-		self.offset += 1
-		return self.readString(length)
-
-	def readString(self, len):
-		"""Reads a string of a given length from the packet"""
-		format = '!' + str(len) + 's'
-		length =  struct.calcsize(format)
-		info = struct.unpack(format, self.data[self.offset:self.offset+length])
-		self.offset += length
-		return info[0]
-
-	def readUnsignedShort(self):
-		"""Reads an unsigned short from the packet"""
-		format = '!H'
-		length = struct.calcsize(format)
-		info = struct.unpack(format, self.data[self.offset:self.offset+length])
-		self.offset += length
-		return info[0]
-
-	def readOthers(self):
-		"""Reads the answers, authorities and additionals section of the packet"""
-		format = '!HHiH'
-		length = struct.calcsize(format)
-		n = self.numAnswers + self.numAuthorities + self.numAdditionals
-		for i in range(0, n):
-			domain = self.readName()
-			info = struct.unpack(format, self.data[self.offset:self.offset+length])
-			self.offset += length
-
-			rec = None
-			if info[0] == _TYPE_A:
-				rec = DNSAddress(domain, info[0], info[1], info[2], self.readString(4))
-			elif info[0] == _TYPE_CNAME or info[0] == _TYPE_PTR:
-				rec = DNSPointer(domain, info[0], info[1], info[2], self.readName())
-			elif info[0] == _TYPE_TXT:
-				rec = DNSText(domain, info[0], info[1], info[2], self.readString(info[3]))
-			elif info[0] == _TYPE_SRV:
-				rec = DNSService(domain, info[0], info[1], info[2], self.readUnsignedShort(), self.readUnsignedShort(), self.readUnsignedShort(), self.readName())
-			elif info[0] == _TYPE_HINFO:
-				rec = DNSHinfo(domain, info[0], info[1], info[2], self.readCharacterString(), self.readCharacterString())
-			elif info[0] == _TYPE_AAAA:
-				rec = DNSAddress(domain, info[0], info[1], info[2], self.readString(16))
-			else:
-				# Try to ignore types we don't know about
-				# this may mean the rest of the name is
-				# unable to be parsed, and may show errors
-				# so this is left for debugging.  New types
-				# encountered need to be parsed properly.
-				#
-				#print "UNKNOWN TYPE = " + str(info[0])
-				#raise BadTypeInNameException
-				pass
-
-			if rec is not None:
-				self.answers.append(rec)
-				
-	def isQuery(self):
-		"""Returns true if this is a query"""
-		return (self.flags & _FLAGS_QR_MASK) == _FLAGS_QR_QUERY
-
-	def isResponse(self):
-		"""Returns true if this is a response"""
-		return (self.flags & _FLAGS_QR_MASK) == _FLAGS_QR_RESPONSE
-
-	def readUTF(self, offset, len):
-		"""Reads a UTF-8 string of a given length from the packet"""
-		result = self.data[offset:offset+len].decode('utf-8')
-		return result
-		
-	def readName(self):
-		"""Reads a domain name from the packet"""
-		result = ''
-		off = self.offset
-		next = -1
-		first = off
-
-		while 1:
-			len = ord(self.data[off])
-			off += 1
-			if len == 0:
-				break
-			t = len & 0xC0
-			if t == 0x00:
-				result = ''.join((result, self.readUTF(off, len) + '.'))
-				off += len
-			elif t == 0xC0:
-				if next < 0:
-					next = off + 1
-				off = ((len & 0x3F) << 8) | ord(self.data[off])
-				if off >= first:
-					raise "Bad domain name (circular) at " + str(off)
-				first = off
-			else:
-				raise "Bad domain name at " + str(off)
-
-		if next >= 0:
-			self.offset = next
-		else:
-			self.offset = off
-
-		return result
-	
-		
-class DNSOutgoing(object):
-	"""Object representation of an outgoing packet"""
-	
-	def __init__(self, flags, multicast = 1):
-		self.finished = 0
-		self.id = 0
-		self.multicast = multicast
-		self.flags = flags
-		self.names = {}
-		self.data = []
-		self.size = 12
-		
-		self.questions = []
-		self.answers = []
-		self.authorities = []
-		self.additionals = []
-
-	def addQuestion(self, record):
-		"""Adds a question"""
-		self.questions.append(record)
-
-	def addAnswer(self, inp, record):
-		"""Adds an answer"""
-		if not record.suppressedBy(inp):
-			self.addAnswerAtTime(record, 0)
-
-	def addAnswerAtTime(self, record, now):
-		"""Adds an answer if if does not expire by a certain time"""
-		if record is not None:
-			if now == 0 or not record.isExpired(now):
-				self.answers.append((record, now))
-
-	def addAuthorativeAnswer(self, record):
-		"""Adds an authoritative answer"""
-		self.authorities.append(record)
-
-	def addAdditionalAnswer(self, record):
-		"""Adds an additional answer"""
-		self.additionals.append(record)
-
-	def writeByte(self, value):
-		"""Writes a single byte to the packet"""
-		format = '!c'
-		self.data.append(struct.pack(format, chr(value)))
-		self.size += 1
-
-	def insertShort(self, index, value):
-		"""Inserts an unsigned short in a certain position in the packet"""
-		format = '!H'
-		self.data.insert(index, struct.pack(format, value))
-		self.size += 2
-		
-	def writeShort(self, value):
-		"""Writes an unsigned short to the packet"""
-		format = '!H'
-		self.data.append(struct.pack(format, value))
-		self.size += 2
-
-	def writeInt(self, value):
-		"""Writes an unsigned integer to the packet"""
-		format = '!I'
-		self.data.append(struct.pack(format, value))
-		self.size += 4
-
-	def writeString(self, value, length):
-		"""Writes a string to the packet"""
-		format = '!' + str(length) + 's'
-		self.data.append(struct.pack(format, value))
-		self.size += length
-
-	def writeUTF(self, s):
-		"""Writes a UTF-8 string of a given length to the packet"""
-		utfstr = s.encode('utf-8')
-		length = len(utfstr)
-		if length > 64:
-			raise NamePartTooLongException
-		self.writeByte(length)
-		self.writeString(utfstr, length)
-
-	def writeName(self, name):
-		"""Writes a domain name to the packet"""
-
-		try:
-			# Find existing instance of this name in packet
-			#
-			index = self.names[name]
-		except KeyError:
-			# No record of this name already, so write it
-			# out as normal, recording the location of the name
-			# for future pointers to it.
-			#
-			self.names[name] = self.size
-			parts = name.split('.')
-			if parts[-1] == '':
-				parts = parts[:-1]
-			for part in parts:
-				self.writeUTF(part)
-			self.writeByte(0)
-			return
-
-		# An index was found, so write a pointer to it
-		#
-		self.writeByte((index >> 8) | 0xC0)
-		self.writeByte(index)
-
-	def writeQuestion(self, question):
-		"""Writes a question to the packet"""
-		self.writeName(question.name)
-		self.writeShort(question.type)
-		self.writeShort(question.clazz)
-
-	def writeRecord(self, record, now):
-		"""Writes a record (answer, authoritative answer, additional) to
-		the packet"""
-		self.writeName(record.name)
-		self.writeShort(record.type)
-		if record.unique and self.multicast:
-			self.writeShort(record.clazz | _CLASS_UNIQUE)
-		else:
-			self.writeShort(record.clazz)
-		if now == 0:
-			self.writeInt(record.ttl)
-		else:
-			self.writeInt(record.getRemainingTTL(now))
-		index = len(self.data)
-		# Adjust size for the short we will write before this record
-		#
-		self.size += 2
-		record.write(self)
-		self.size -= 2
-		
-		length = len(''.join(self.data[index:]))
-		self.insertShort(index, length) # Here is the short we adjusted for
-
-	def packet(self):
-		"""Returns a string containing the packet's bytes
-
-		No further parts should be added to the packet once this
-		is done."""
-		if not self.finished:
-			self.finished = 1
-			for question in self.questions:
-				self.writeQuestion(question)
-			for answer, time in self.answers:
-				self.writeRecord(answer, time)
-			for authority in self.authorities:
-				self.writeRecord(authority, 0)
-			for additional in self.additionals:
-				self.writeRecord(additional, 0)
-		
-			self.insertShort(0, len(self.additionals))
-			self.insertShort(0, len(self.authorities))
-			self.insertShort(0, len(self.answers))
-			self.insertShort(0, len(self.questions))
-			self.insertShort(0, self.flags)
-			if self.multicast:
-				self.insertShort(0, 0)
-			else:
-				self.insertShort(0, self.id)
-		return ''.join(self.data)
-
-
-class DNSCache(object):
-	"""A cache of DNS entries"""
-	
-	def __init__(self):
-		self.cache = {}
-
-	def add(self, entry):
-		"""Adds an entry"""
-		try:
-			list = self.cache[entry.key]
-		except:
-			list = self.cache[entry.key] = []
-		list.append(entry)
-
-	def remove(self, entry):
-		"""Removes an entry"""
-		try:
-			list = self.cache[entry.key]
-			list.remove(entry)
-		except:
-			pass
-
-	def get(self, entry):
-		"""Gets an entry by key.  Will return None if there is no
-		matching entry."""
-		try:
-			list = self.cache[entry.key]
-			return list[list.index(entry)]
-		except:
-			return None
-
-	def getByDetails(self, name, type, clazz):
-		"""Gets an entry by details.  Will return None if there is
-		no matching entry."""
-		entry = DNSEntry(name, type, clazz)
-		return self.get(entry)
-
-	def entriesWithName(self, name):
-		"""Returns a list of entries whose key matches the name."""
-		try:
-			return self.cache[name]
-		except:
-			return []
-
-	def entries(self):
-		"""Returns a list of all entries"""
-		def add(x, y): return x+y
-		try:
-			return reduce(add, self.cache.values())
-		except:
-			return []
-
-
-class Engine(threading.Thread):
-	"""An engine wraps read access to sockets, allowing objects that
-	need to receive data from sockets to be called back when the
-	sockets are ready.
-
-	A reader needs a handle_read() method, which is called when the socket
-	it is interested in is ready for reading.
-
-	Writers are not implemented here, because we only send short
-	packets.
-	"""
-
-	def __init__(self, zeroconf):
-		threading.Thread.__init__(self)
-		self.zeroconf = zeroconf
-		self.readers = {} # maps socket to reader
-		self.timeout = 5
-		self.condition = threading.Condition()
-		self.setDaemon(1)    ### added by RMB
-		self.start()
-
-	def run(self):
-		while not globals()['_GLOBAL_DONE']:
-			rs = self.getReaders()
-			if len(rs) == 0:
-				# No sockets to manage, but we wait for the timeout
-				# or addition of a socket
-				#
-				self.condition.acquire()
-				self.condition.wait(self.timeout)
-				self.condition.release()
-			else:
-				try:
-					rr, wr, er = select.select(rs, [], [], self.timeout)
-					for socket in rr:
-						try:
-							self.readers[socket].handle_read()
-						except:
-							traceback.print_exc()
-				except:
-					pass
-
-	def getReaders(self):
-		result = []
-		self.condition.acquire()
-		result = self.readers.keys()
-		self.condition.release()
-		return result
-	
-	def addReader(self, reader, socket):
-		self.condition.acquire()
-		self.readers[socket] = reader
-		self.condition.notify()
-		self.condition.release()
-
-	def delReader(self, socket):
-		self.condition.acquire()
-		del(self.readers[socket])
-		self.condition.notify()
-		self.condition.release()
-
-	def notify(self):
-		self.condition.acquire()
-		self.condition.notify()
-		self.condition.release()
-
-class Listener(object):
-	"""A Listener is used by this module to listen on the multicast
-	group to which DNS messages are sent, allowing the implementation
-	to cache information as it arrives.
-
-	It requires registration with an Engine object in order to have
-	the read() method called when a socket is availble for reading."""
-	
-	def __init__(self, zeroconf):
-		self.zeroconf = zeroconf
-		self.zeroconf.engine.addReader(self, self.zeroconf.socket)
-
-	def handle_read(self):
-		data, (addr, port) = self.zeroconf.socket.recvfrom(_MAX_MSG_ABSOLUTE)
-		self.data = data
-		msg = DNSIncoming(data)
-		if msg.isQuery():
-			# Always multicast responses
-			#
-			if port == _MDNS_PORT:
-				self.zeroconf.handleQuery(msg, _MDNS_ADDR, _MDNS_PORT)
-			# If it's not a multicast query, reply via unicast
-			# and multicast
-			#
-			elif port == _DNS_PORT:
-				self.zeroconf.handleQuery(msg, addr, port)
-				self.zeroconf.handleQuery(msg, _MDNS_ADDR, _MDNS_PORT)
-		else:
-			self.zeroconf.handleResponse(msg)
-
-
-class Reaper(threading.Thread):
-	"""A Reaper is used by this module to remove cache entries that
-	have expired."""
-	
-	def __init__(self, zeroconf):
-		threading.Thread.__init__(self)
-		self.zeroconf = zeroconf
-		self.setDaemon(1)    ### added by RMB
-		self.start()
-
-	def run(self):
-		while 1:
-			self.zeroconf.wait(10 * 1000)
-			if globals()['_GLOBAL_DONE']:
-				return
-			now = currentTimeMillis()
-			for record in self.zeroconf.cache.entries():
-				if record.isExpired(now):
-					self.zeroconf.updateRecord(now, record)
-					self.zeroconf.cache.remove(record)
-
-
-class ServiceBrowser(threading.Thread):
-	"""Used to browse for a service of a specific type.
-
-	The listener object will have its addService() and
-	removeService() methods called when this browser
-	discovers changes in the services availability."""
-	
-	def __init__(self, zeroconf, type, listener):
-		"""Creates a browser for a specific type"""
-		threading.Thread.__init__(self)
-		self.zeroconf = zeroconf
-		self.type = type
-		self.listener = listener
-		self.services = {}
-		self.nextTime = currentTimeMillis()
-		self.delay = _BROWSER_TIME
-		self.list = []
-		
-		self.done = 0
-
-		self.zeroconf.addListener(self, DNSQuestion(self.type, _TYPE_PTR, _CLASS_IN))
-		self.setDaemon(1)    ### added by RMB
-		self.start()
-
-	def updateRecord(self, zeroconf, now, record):
-		"""Callback invoked by Zeroconf when new information arrives.
-		Updates information required by browser in the Zeroconf cache."""
-
-		# print "RMB: SB: UPDATING"  ## "Updating: now=", now, "rec=", record
-		if record.type == _TYPE_PTR and record.name == self.type:
-			expired = record.isExpired(now)
-			try:
-				# print "RMB: DOING TRY"
-				oldrecord = self.services[record.alias.lower()]
-				# print "RMB: TRY GOT OLDRECORD", oldrecord
-				if not expired:
-					oldrecord.resetTTL(record)
-				else:
-					del(self.services[record.alias.lower()])
-					callback = lambda x: self.listener.removeService(x, self.type, record.alias)
-					self.list.append(callback)
-					return
-			except:
-				# print "RMB: DOING EXCEPT"
-				if not expired:
-					self.services[record.alias.lower()] = record
-					callback = lambda x: self.listener.addService(x, self.type, record.alias)
-					self.list.append(callback)
-
-			expires = record.getExpirationTime(75)
-			if expires < self.nextTime:
-				self.nextTime = expires
-
-	def cancel(self):
-		self.done = 1
-		self.zeroconf.notifyAll()
-
-	def run(self):
-		while 1:
-			event = None
-			now = currentTimeMillis()
-			if len(self.list) == 0 and self.nextTime > now:
-				self.zeroconf.wait(self.nextTime - now)
-			if globals()['_GLOBAL_DONE'] or self.done:
-				return
-			now = currentTimeMillis()
-
-			if self.nextTime <= now:
-				# print "RMB: SENDING OUTGOING"
-				out = DNSOutgoing(_FLAGS_QR_QUERY)
-				out.addQuestion(DNSQuestion(self.type, _TYPE_PTR, _CLASS_IN))
-				for record in self.services.values():
-					if not record.isExpired(now):
-						out.addAnswerAtTime(record, now)
-				self.zeroconf.send(out)
-				self.nextTime = now + self.delay
-				self.delay = min(20 * 1000, self.delay * 2)
-
-			# print "RMB: LENLIST=", len(self.list)
-			if len(self.list) > 0:
-				event = self.list.pop(0)
-				# event = self.list[0]
-
-			if event is not None:
-				# print "RMB: BEFORE CALLBACK", event
-				event(self.zeroconf)
-				# print "RMB: AFTER  CALLBACK"
-				
-
-class ServiceInfo(object):
-	"""Service information"""
-	
-	def __init__(self, type, name, address=None, port=None, weight=0, priority=0, properties=None, server=None):
-		"""Create a service description.
-
-		type: fully qualified service type name
-		name: fully qualified service name
-		address: IP address as unsigned short, network byte order
-		port: port that the service runs on
-		weight: weight of the service
-		priority: priority of the service
-		properties: dictionary of properties (or a string holding the bytes for the text field)
-		server: fully qualified name for service host (defaults to name)"""
-
-		if not name.endswith(type):
-			raise BadTypeInNameException
-		self.type = type
-		self.name = name
-		self.address = address
-		self.port = port
-		self.weight = weight
-		self.priority = priority
-		if server:
-			self.server = server
-		else:
-			self.server = name
-		self.setProperties(properties)
-
-	def setProperties(self, properties):
-		"""Sets properties and text of this info from a dictionary"""
-		if isinstance(properties, dict):
-			self.properties = properties
-			list = []
-			result = ''
-			for key in properties:
-				value = properties[key]
-				if value is None:
-					suffix = ''.encode('utf-8')
-				elif isinstance(value, str):
-					suffix = value.encode('utf-8')
-				elif isinstance(value, int):
-					if value:
-						suffix = 'true'
-					else:
-						suffix = 'false'
-				else:
-					suffix = ''.encode('utf-8')
-				list.append('='.join((key, suffix)))
-			for item in list:
-				result = ''.join((result, struct.pack('!c', chr(len(item))), item))
-			self.text = result
-		else:
-			self.text = properties
-
-	def setText(self, text):
-		"""Sets properties and text given a text field"""
-		self.text = text
-		try:
-			result = {}
-			end = len(text)
-			index = 0
-			strs = []
-			while index < end:
-				length = ord(text[index])
-				index += 1
-				strs.append(text[index:index+length])
-				index += length
-			
-			for s in strs:
-				eindex = s.find('=')
-				if eindex == -1:
-					# No equals sign at all
-					key = s
-					value = 0
-				else:
-					key = s[:eindex]
-					value = s[eindex+1:]
-					if value == 'true':
-						value = 1
-					elif value == 'false' or not value:
-						value = 0
-
-				# Only update non-existent properties
-				if key and result.get(key) == None:
-					result[key] = value
-
-			self.properties = result
-		except:
-			traceback.print_exc()
-			self.properties = None
-			
-	def getType(self):
-		"""Type accessor"""
-		return self.type
-
-	def getName(self):
-		"""Name accessor"""
-		if self.type is not None and self.name.endswith("." + self.type):
-			return self.name[:len(self.name) - len(self.type) - 1]
-		return self.name
-
-	def getAddress(self):
-		"""Address accessor"""
-		return self.address
-
-	def getPort(self):
-		"""Port accessor"""
-		return self.port
-
-	def getPriority(self):
-		"""Pirority accessor"""
-		return self.priority
-
-	def getWeight(self):
-		"""Weight accessor"""
-		return self.weight
-
-	def getProperties(self):
-		"""Properties accessor"""
-		return self.properties
-
-	def getText(self):
-		"""Text accessor"""
-		return self.text
-
-	def getServer(self):
-		"""Server accessor"""
-		return self.server
-
-	def updateRecord(self, zeroconf, now, record):
-		"""Updates service information from a DNS record"""
-		# print "RMB: SI: UPDATING"  ## "Updating: now=", now, "rec=", record
-		if record is not None and not record.isExpired(now):
-			if record.type == _TYPE_A:
-				if record.name == self.name:
-					self.address = record.address
-			elif record.type == _TYPE_SRV:
-				if record.name == self.name:
-					self.server = record.server
-					self.port = record.port
-					self.weight = record.weight
-					self.priority = record.priority
-					self.address = None
-					self.updateRecord(zeroconf, now, zeroconf.cache.getByDetails(self.server, _TYPE_A, _CLASS_IN))
-			elif record.type == _TYPE_TXT:
-				if record.name == self.name:
-					self.setText(record.text)
-
-	def request(self, zeroconf, timeout):
-		"""Returns true if the service could be discovered on the
-		network, and updates this object with details discovered.
-		"""
-		now = currentTimeMillis()
-		delay = _LISTENER_TIME
-		next = now + delay
-		last = now + timeout
-		result = 0
-		try:
-			zeroconf.addListener(self, DNSQuestion(self.name, _TYPE_ANY, _CLASS_IN))
-			while self.server is None or self.address is None or self.text is None:
-				if last <= now:
-					return 0
-				if next <= now:
-					out = DNSOutgoing(_FLAGS_QR_QUERY)
-					out.addQuestion(DNSQuestion(self.name, _TYPE_SRV, _CLASS_IN))
-					out.addAnswerAtTime(zeroconf.cache.getByDetails(self.name, _TYPE_SRV, _CLASS_IN), now)
-					out.addQuestion(DNSQuestion(self.name, _TYPE_TXT, _CLASS_IN))
-					out.addAnswerAtTime(zeroconf.cache.getByDetails(self.name, _TYPE_TXT, _CLASS_IN), now)
-					if self.server is not None:
-						out.addQuestion(DNSQuestion(self.server, _TYPE_A, _CLASS_IN))
-						out.addAnswerAtTime(zeroconf.cache.getByDetails(self.server, _TYPE_A, _CLASS_IN), now)
-					zeroconf.send(out)
-					next = now + delay
-					delay = delay * 2
-
-				zeroconf.wait(min(next, last) - now)
-				now = currentTimeMillis()
-			result = 1
-		finally:
-			zeroconf.removeListener(self)
-			
-		return result
-
-	def __eq__(self, other):
-		"""Tests equality of service name"""
-		if isinstance(other, ServiceInfo):
-			return other.name == self.name
-		return 0
-
-	def __ne__(self, other):
-		"""Non-equality test"""
-		return not self.__eq__(other)
-
-	def __repr__(self):
-		"""String representation"""
-		result = "service[%s,%s:%s," % (self.name, socket.inet_ntoa(self.getAddress()), self.port)
-		if self.text is None:
-			result += "None"
-		else:
-			if len(self.text) < 20:
-				result += self.text
-			else:
-				result += self.text[:17] + "..."
-		result += "]"
-		return result
-				
-
-class Zeroconf(object):
-	"""Implementation of Zeroconf Multicast DNS Service Discovery
-
-	Supports registration, unregistration, queries and browsing.
-	"""
-	def __init__(self, bindaddress=None):
-		"""Creates an instance of the Zeroconf class, establishing
-		multicast communications, listening and reaping threads."""
-		globals()['_GLOBAL_DONE'] = 0
-		if bindaddress is None:
-			self.intf = socket.gethostbyname(socket.gethostname())
-		else:
-			self.intf = bindaddress
-		self.group = ('', _MDNS_PORT)
-		self.socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
-		try:
-			self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
-			self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
-		except:
-			# SO_REUSEADDR should be equivalent to SO_REUSEPORT for
-			# multicast UDP sockets (p 731, "TCP/IP Illustrated,
-			# Volume 2"), but some BSD-derived systems require
-			# SO_REUSEPORT to be specified explicity.  Also, not all
-			# versions of Python have SO_REUSEPORT available.  So
-			# if you're on a BSD-based system, and haven't upgraded
-			# to Python 2.3 yet, you may find this library doesn't
-			# work as expected.
-			#
-			pass
-		self.socket.setsockopt(socket.SOL_IP, socket.IP_MULTICAST_TTL, 255)
-		self.socket.setsockopt(socket.SOL_IP, socket.IP_MULTICAST_LOOP, 1)
-		try:
-			self.socket.bind(self.group)
-		except:
-			# Some versions of linux raise an exception even though
-			# the SO_REUSE* options have been set, so ignore it
-			#
-			pass
-		self.socket.setsockopt(socket.SOL_IP, socket.IP_MULTICAST_IF, socket.inet_aton(self.intf) + socket.inet_aton('0.0.0.0'))
-		self.socket.setsockopt(socket.SOL_IP, socket.IP_ADD_MEMBERSHIP, socket.inet_aton(_MDNS_ADDR) + socket.inet_aton('0.0.0.0'))
-
-		self.listeners = []
-		self.browsers = []
-		self.services = {}
-
-		self.cache = DNSCache()
-
-		self.condition = threading.Condition()
-		
-		self.engine = Engine(self)
-		self.listener = Listener(self)
-		self.reaper = Reaper(self)
-
-	def isLoopback(self):
-		return self.intf.startswith("127.0.0.1")
-
-	def isLinklocal(self):
-		return self.intf.startswith("169.254.")
-
-	def wait(self, timeout):
-		"""Calling thread waits for a given number of milliseconds or
-		until notified."""
-		self.condition.acquire()
-		self.condition.wait(timeout/1000)
-		self.condition.release()
-
-	def notifyAll(self):
-		"""Notifies all waiting threads"""
-		self.condition.acquire()
-		self.condition.notifyAll()
-		self.condition.release()
-
-	def getServiceInfo(self, type, name, timeout=3000):
-		"""Returns network's service information for a particular
-		name and type, or None if no service matches by the timeout,
-		which defaults to 3 seconds."""
-		info = ServiceInfo(type, name)
-		if info.request(self, timeout):
-			return info
-		return None
-
-	def addServiceListener(self, type, listener):
-		"""Adds a listener for a particular service type.  This object
-		will then have its updateRecord method called when information
-		arrives for that type."""
-		self.removeServiceListener(listener)
-		self.browsers.append(ServiceBrowser(self, type, listener))
-
-	def removeServiceListener(self, listener):
-		"""Removes a listener from the set that is currently listening."""
-		for browser in self.browsers:
-			if browser.listener == listener:
-				browser.cancel()
-				del(browser)
-
-	def registerService(self, info, ttl=_DNS_TTL):
-		"""Registers service information to the network with a default TTL
-		of 60 seconds.  Zeroconf will then respond to requests for
-		information for that service.  The name of the service may be
-		changed if needed to make it unique on the network."""
-		self.checkService(info)
-		self.services[info.name.lower()] = info
-		now = currentTimeMillis()
-		nextTime = now
-		i = 0
-		while i < 3:
-			if now < nextTime:
-				self.wait(nextTime - now)
-				now = currentTimeMillis()
-				continue
-			out = DNSOutgoing(_FLAGS_QR_RESPONSE | _FLAGS_AA)
-			out.addAnswerAtTime(DNSPointer(info.type, _TYPE_PTR, _CLASS_IN, ttl, info.name), 0)
-			out.addAnswerAtTime(DNSService(info.name, _TYPE_SRV, _CLASS_IN, ttl, info.priority, info.weight, info.port, info.server), 0)
-			out.addAnswerAtTime(DNSText(info.name, _TYPE_TXT, _CLASS_IN, ttl, info.text), 0)
-			if info.address:
-				out.addAnswerAtTime(DNSAddress(info.server, _TYPE_A, _CLASS_IN, ttl, info.address), 0)
-			self.send(out)
-			i += 1
-			nextTime += _REGISTER_TIME
-
-	def unregisterService(self, info):
-		"""Unregister a service."""
-		try:
-			del(self.services[info.name.lower()])
-		except:
-			pass
-		now = currentTimeMillis()
-		nextTime = now
-		i = 0
-		while i < 3:
-			if now < nextTime:
-				self.wait(nextTime - now)
-				now = currentTimeMillis()
-				continue
-			out = DNSOutgoing(_FLAGS_QR_RESPONSE | _FLAGS_AA)
-			out.addAnswerAtTime(DNSPointer(info.type, _TYPE_PTR, _CLASS_IN, 0, info.name), 0)
-			out.addAnswerAtTime(DNSService(info.name, _TYPE_SRV, _CLASS_IN, 0, info.priority, info.weight, info.port, info.name), 0)
-			out.addAnswerAtTime(DNSText(info.name, _TYPE_TXT, _CLASS_IN, 0, info.text), 0)
-			if info.address:
-				out.addAnswerAtTime(DNSAddress(info.server, _TYPE_A, _CLASS_IN, 0, info.address), 0)
-			self.send(out)
-			i += 1
-			nextTime += _UNREGISTER_TIME
-
-	def unregisterAllServices(self):
-		"""Unregister all registered services."""
-		if len(self.services) > 0:
-			now = currentTimeMillis()
-			nextTime = now
-			i = 0
-			while i < 3:
-				if now < nextTime:
-					self.wait(nextTime - now)
-					now = currentTimeMillis()
-					continue
-				out = DNSOutgoing(_FLAGS_QR_RESPONSE | _FLAGS_AA)
-				for info in self.services.values():
-					out.addAnswerAtTime(DNSPointer(info.type, _TYPE_PTR, _CLASS_IN, 0, info.name), 0)
-					out.addAnswerAtTime(DNSService(info.name, _TYPE_SRV, _CLASS_IN, 0, info.priority, info.weight, info.port, info.server), 0)
-					out.addAnswerAtTime(DNSText(info.name, _TYPE_TXT, _CLASS_IN, 0, info.text), 0)
-					if info.address:
-						out.addAnswerAtTime(DNSAddress(info.server, _TYPE_A, _CLASS_IN, 0, info.address), 0)
-				self.send(out)
-				i += 1
-				nextTime += _UNREGISTER_TIME
-
-	def checkService(self, info):
-		"""Checks the network for a unique service name, modifying the
-		ServiceInfo passed in if it is not unique."""
-		now = currentTimeMillis()
-		nextTime = now
-		i = 0
-		while i < 3:
-			for record in self.cache.entriesWithName(info.type):
-				if record.type == _TYPE_PTR and not record.isExpired(now) and record.alias == info.name:
-					if (info.name.find('.') < 0):
-						info.name = info.name + ".[" + info.address + ":" + info.port + "]." + info.type
-						self.checkService(info)
-						return
-					raise NonUniqueNameException
-			if now < nextTime:
-				self.wait(nextTime - now)
-				now = currentTimeMillis()
-				continue
-			out = DNSOutgoing(_FLAGS_QR_QUERY | _FLAGS_AA)
-			self.debug = out
-			out.addQuestion(DNSQuestion(info.type, _TYPE_PTR, _CLASS_IN))
-			out.addAuthorativeAnswer(DNSPointer(info.type, _TYPE_PTR, _CLASS_IN, _DNS_TTL, info.name))
-			self.send(out)
-			i += 1
-			nextTime += _CHECK_TIME
-
-	def addListener(self, listener, question):
-		"""Adds a listener for a given question.  The listener will have
-		its updateRecord method called when information is available to
-		answer the question."""
-		now = currentTimeMillis()
-		self.listeners.append(listener)
-		if question is not None:
-			for record in self.cache.entriesWithName(question.name):
-				if question.answeredBy(record) and not record.isExpired(now):
-					listener.updateRecord(self, now, record)
-		self.notifyAll()
-
-	def removeListener(self, listener):
-		"""Removes a listener."""
-		try:
-			self.listeners.remove(listener)
-			self.notifyAll()
-		except:
-			pass
-
-	def updateRecord(self, now, rec):
-		"""Used to notify listeners of new information that has updated
-		a record."""
-		for listener in self.listeners:
-                        # print "RMB: HANDLING REC:",type(listener.updateRecord)
-			listener.updateRecord(self, now, rec)
-                        # print "RMB: HANDLED REC:",rec
-		self.notifyAll()
-
-	def handleResponse(self, msg):
-		"""Deal with incoming response packets.  All answers
-		are held in the cache, and listeners are notified."""
-		# print "RMB: HANDLE_RESPONSE:", msg
-		now = currentTimeMillis()
-		for record in msg.answers:
-			expired = record.isExpired(now)
-			if record in self.cache.entries():
-				if expired:
-					self.cache.remove(record)
-				else:
-					entry = self.cache.get(record)
-					if entry is not None:
-						entry.resetTTL(record)
-						record = entry
-			else:
-				self.cache.add(record)
-				
-			self.updateRecord(now, record)
-
-	def handleQuery(self, msg, addr, port):
-		"""Deal with incoming query packets.  Provides a response if
-		possible."""
-		out = None
-
-		# Support unicast client responses
-		#
-		if port != _MDNS_PORT:
-			out = DNSOutgoing(_FLAGS_QR_RESPONSE | _FLAGS_AA, 0)
-			for question in msg.questions:
-				out.addQuestion(question)
-		
-		for question in msg.questions:
-			if question.type == _TYPE_PTR:
-				for service in self.services.values():
-					if question.name == service.type:
-						if out is None:
-							out = DNSOutgoing(_FLAGS_QR_RESPONSE | _FLAGS_AA)
-						out.addAnswer(msg, DNSPointer(service.type, _TYPE_PTR, _CLASS_IN, _DNS_TTL, service.name))
-			else:
-				try:
-					if out is None:
-						out = DNSOutgoing(_FLAGS_QR_RESPONSE | _FLAGS_AA)
-					
-					# Answer A record queries for any service addresses we know
-					if question.type == _TYPE_A or question.type == _TYPE_ANY:
-						for service in self.services.values():
-							if service.server == question.name.lower():
-								out.addAnswer(msg, DNSAddress(question.name, _TYPE_A, _CLASS_IN | _CLASS_UNIQUE, _DNS_TTL, service.address))
-					
-					service = self.services.get(question.name.lower(), None)
-					if not service: continue
-					
-					if question.type == _TYPE_SRV or question.type == _TYPE_ANY:
-						out.addAnswer(msg, DNSService(question.name, _TYPE_SRV, _CLASS_IN | _CLASS_UNIQUE, _DNS_TTL, service.priority, service.weight, service.port, service.server))
-					if question.type == _TYPE_TXT or question.type == _TYPE_ANY:
-						out.addAnswer(msg, DNSText(question.name, _TYPE_TXT, _CLASS_IN | _CLASS_UNIQUE, _DNS_TTL, service.text))
-					if question.type == _TYPE_SRV:
-						out.addAdditionalAnswer(DNSAddress(service.server, _TYPE_A, _CLASS_IN | _CLASS_UNIQUE, _DNS_TTL, service.address))
-				except:
-					traceback.print_exc()
-				
-		if out is not None and out.answers:
-			out.id = msg.id
-			self.send(out, addr, port)
-
-	def send(self, out, addr = _MDNS_ADDR, port = _MDNS_PORT):
-		"""Sends an outgoing packet."""
-		# This is a quick test to see if we can parse the packets we generate
-		#temp = DNSIncoming(out.packet())
-		try:
-			bytes_sent = self.socket.sendto(out.packet(), 0, (addr, port))
-		except:
-			# Ignore this, it may be a temporary loss of network connection
-			pass
-
-	def close(self):
-		"""Ends the background threads, and prevent this instance from
-		servicing further queries."""
-		if globals()['_GLOBAL_DONE'] == 0:
-			globals()['_GLOBAL_DONE'] = 1
-			self.notifyAll()
-			self.engine.notify()
-			self.unregisterAllServices()
-			self.socket.setsockopt(socket.SOL_IP, socket.IP_DROP_MEMBERSHIP, socket.inet_aton(_MDNS_ADDR) + socket.inet_aton('0.0.0.0'))
-			self.socket.close()
-			
-# Test a few module features, including service registration, service
-# query (for Zoe), and service unregistration.
-
-if __name__ == '__main__':	
-	print "Multicast DNS Service Discovery for Python, version", __version__
-	r = Zeroconf()
-	print "1. Testing registration of a service..."
-	desc = {'version':'0.10','a':'test value', 'b':'another value'}
-	info = ServiceInfo("_http._tcp.local.", "My Service Name._http._tcp.local.", socket.inet_aton("127.0.0.1"), 1234, 0, 0, desc)
-	print "   Registering service..."
-	r.registerService(info)
-	print "   Registration done."
-	print "2. Testing query of service information..."
-	print "   Getting ZOE service:", str(r.getServiceInfo("_http._tcp.local.", "ZOE._http._tcp.local."))
-	print "   Query done."
-	print "3. Testing query of own service..."
-	print "   Getting self:", str(r.getServiceInfo("_http._tcp.local.", "My Service Name._http._tcp.local."))
-	print "   Query done."
-	print "4. Testing unregister of service information..."
-	r.unregisterService(info)
-	print "   Unregister done."
-	r.close()
diff --git a/src/pm/mpd/autogen.sh b/src/pm/mpd/autogen.sh
deleted file mode 100755
index 4e157e3..0000000
--- a/src/pm/mpd/autogen.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-# we use an autogen.sh script here to be able to add the "-I ../../../confdb"
-# args to the autoreconf line
-
-${AUTORECONF:-autoreconf} ${autoreconf_args:-"-vif"} -I ../../../confdb
-
diff --git a/src/pm/mpd/configure.ac b/src/pm/mpd/configure.ac
deleted file mode 100644
index 9e11768..0000000
--- a/src/pm/mpd/configure.ac
+++ /dev/null
@@ -1,198 +0,0 @@
-
-dnl Set the directory that contains support scripts such as install-sh and
-dnl config.guess
-AC_CONFIG_AUX_DIR(../../../confdb)
-
-# Autoconf initialization:
-m4_include([../../../maint/version.m4])
-dnl 2nd arg is intentionally underquoted
-AC_INIT([MPD],
-        MPICH_VERSION_m4,
-        [discuss at mpich.org],
-        [mpd],
-        [http://www.mpich.org/])
-
-# Autoconf header:
-rm -f ${srcdir}/mpdconf.h mpdconf.h
-AC_CONFIG_HEADER(mpdconf.h)
-AH_TOP([/* -*- Mode: C; c-basic-offset:4 ; -*- */
-/*  
- *  (C) 2001 by Argonne National Laboratory.
- *      See COPYRIGHT in top-level directory.
- */
-#ifndef MPDCONF_H_INCLUDED
-#define MPDCONF_H_INCLUDED
-])
-AH_BOTTOM([#endif])
-
-AM_INIT_AUTOMAKE([-Wall -Werror -Wno-portability-recursive foreign 1.12.3 silent-rules subdir-objects no-installinfo no-installman])
-# first_pm_name is set and exported by the top level configure
-AM_CONDITIONAL([PRIMARY_PM_MPD],[test "X$first_pm_name" = "Xmpd"])
-
-dnl Process configure arguments
-AC_ARG_ENABLE(echo,
-   [--enable-echo - turn on echoing from within configure script],
-   set -x)
-CONFIGURE_ARGS="$*"
-if test -n "$CONFIGURE_ARGS" ; then 
-    echo "Configuring with args $CONFIGURE_ARGS"
-fi
-AC_SUBST(COPTIONS)
-
-dnl Checks for programs.
-dnl Determine the executable and object file extensions.  These
-dnl are needed for some operations under cygwin
-AC_EXEEXT
-AC_OBJEXT
-# Checking for programs.
-PAC_PROG_CC
-AM_PROG_CC_C_O
-AC_PROG_MAKE_SET
-AC_PROG_LN_S
-# A quick check to ensure that install-sh has the execute bit set
-# (we've had some problems with that)
-if test -f install.sh -a ! -x install.sh ; then chmod +x install.sh ; fi
-AC_PROG_INSTALL
-
-PAC_PROG_CHECK_INSTALL_WORKS
-
-if test "$installOk" = "no" ; then
-    # echo "RMB1: SETTING install"
-    INSTALL="${srcdir}/install.sh"
-fi
-echo Using INSTALL=$INSTALL
-
-AC_ARG_ENABLE(totalview,[--enable-totalview - turn on mpd-totalview support],,
-              enable_totalview=default )
-if test "$enable_totalview" = "no" ; then
-    DO_MTV="no"
-elif test "$enable_totalview" = "yes" ; then
-    DO_MTV="yes"
-else
-    AC_CHECK_PROG(TOTALVIEW, totalview, totalview)
-    if test -n "$TOTALVIEW" ; then
-        DO_MTV="yes"
-    fi
-fi
-AC_SUBST(DO_MTV)
-
-AC_ARG_WITH(python,
-            [--with-python=name - Specify a particular python to use for mpd],,
-            with_python="")
-PYTHON=$with_python
-# echo "GOT PYTHON", $PYTHON
-if test -z "$PYTHON" ; then  ## user did not give us a python; find one
-    dnl Find a Python
-    AC_CHECK_PROG(PY26, python2.6, python2.6)
-    AC_CHECK_PROG(PY25, python2.5, python2.5)
-    AC_CHECK_PROG(PY24, python2.4, python2.4)
-    AC_CHECK_PROG(PY23, python2.3, python2.3)
-    AC_CHECK_PROG(PY22, python2.2, python2.2)
-    AC_CHECK_PROG(PY2,  python2, python2)
-    AC_CHECK_PROG(PY,   python, python)
-    if test -z "$PY26"  -a  \
-            -z "$PY25"  -a  \
-            -z "$PY24"  -a  \
-            -z "$PY23"  -a  \
-            -z "$PY22"  -a  \
-            -z "$PY2"   -a  \
-            -z "$PY" ; then
-        AC_MSG_WARN([Could not find a python executable in path: $PATH]) 
-    fi
-    dnl See if one of the pythons has the right modules
-    for pypgm in $PY26 $PY25 $PY24 $PY23 $PY22 $PY2 $PY ; do \
-        AC_MSG_CHECKING([that $pypgm is a valid python version])
-        changequote(,)dnl
-        py_version=`$pypgm -c "import sys;print sys.version_info[0]"`
-        py_subversion=`$pypgm -c "import sys;print sys.version_info[1]"`
-        changequote([,])dnl
-        if test "$py_version" -gt "2" -o "$py_version" -ge "2" -a "$py_subversion" -ge "2" ; then
-            AC_MSG_RESULT(yes)
-        else
-            AC_MSG_RESULT(no)
-            continue
-        fi	       
-        
-        AC_MSG_CHECKING([that the cPickle module is available for $pypgm])
-        if $pypgm -c 'from cPickle import dumps'  >/dev/null 2>&1 ; then
-            AC_MSG_RESULT(yes)
-        else
-            AC_MSG_RESULT(no)
-            continue
-        fi
-        
-dnl        if test "$enable_totalview" = "yes" ; then
-dnl             AC_MSG_CHECKING([that $pypgm has development tools for totalview])
-dnl             has_python_sdk=no
-dnl             for python_homedir in /usr/lib64 /usr/lib32 /usr/lib ; do
-dnl                 if test -f $python_homedir/$pypgm/config/Makefile ; then
-dnl                     has_python_sdk=yes
-dnl                     break
-dnl                 fi
-dnl             done
-dnl             if test "$has_python_sdk" = "yes" ; then
-dnl                 AC_MSG_RESULT(yes)
-dnl             else
-dnl                 AC_MSG_RESULT(no)
-dnl                 continue
-dnl             fi
-dnl        fi
-
-        PYTHON="$pypgm"
-        break
-    done
-else  ### user-supplied with_python
-        dnl See if the user's python has the right modules
-	continue
-fi
-#
-if test -z "$PYTHON" ; then
-    AC_MSG_ERROR([Python required (version 2.2 or greater, with necessary modules)]) 
-fi
-
-CYGWIN_TEST=`uname -a | grep -i cygwin`
-if test -n "$CYGWIN_TEST" ; then
-    AC_MSG_CHECKING([that rebaseall is ok on this cygwin system])
-    echo
-    if ! $PYTHON -c 'from socket import socket ; from os import fork ; x = fork()'  >/dev/null 2>&1 ; then
-        AC_MSG_ERROR([*** fork may fail on this cygwin system; you may need to run rebaseall]) 
-    fi
-fi
-
-# echo "RMB PYTHON=" $PYTHON
-AC_SUBST(PYTHON)
-
-
-# In case clinker is not defined
-if test -z "$CLINKER" ; then 
-    CLINKER="$CC"
-    AC_SUBST(CLINKER)
-fi
-
-dnl Checks for libraries.
-# Searching libraries instead of checking
-AC_SEARCH_LIBS(socket, socket)
-
-dnl Checks for header files.
-# Checking headers
-AC_HEADER_STDC
-AC_HEADER_SYS_WAIT
-# sys/param.h for MAXHOSTNAMELEN
-AC_CHECK_HEADERS(fcntl.h strings.h sys/time.h unistd.h stdlib.h sys/param.h)
-
-dnl Checks for library functions.
-# Checking library functions
-AC_CHECK_FUNCS(putenv socket)
-
-AC_CHECK_FUNCS(snprintf)
-if test "$ac_cv_func_snprintf" = "yes" ; then
-     PAC_FUNC_NEEDS_DECL([#include <stdio.h>],snprintf)
-fi
-
-dnl Output:
-# Starting output
-MPD_HOME=`pwd`
-AC_SUBST(MPD_HOME)
-
-# AC_OUTPUT_COMMANDS(chmod +x startdaemons)
-AC_OUTPUT(Makefile)
diff --git a/src/pm/mpd/edi2.xml b/src/pm/mpd/edi2.xml
deleted file mode 100644
index 0d87c61..0000000
--- a/src/pm/mpd/edi2.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<PMRequests>
-    <create-process-group
-            totalprocs='5'
-            exec='/home/lusk/mpich/src/pmi/impls/mpd/proxy' 
-            path='/home/lusk/mpich/src/pmi/impls/mpd:/usr/bin:/usr/local/bin'
-            user='lusk' 
-            cwd='/home/lusk'
-            args = ''
-	    >
-        <host name='donner.mcs.anl.gov' range='0-2'/>
-
-	<args range='0'>
-	    <arg value='13'/>
-	    <arg value='app'/>
-	    <arg value='arg1'/>
-	    <arg value='arg2'/>
-        </args>
-
-	<args range='1'>
-	    <arg value='14'/>
-	    <arg value='app'/>
-        </args>
-
-	<args range='2'>
-	    <arg value='22'/>
-	    <arg value='app'/>
-        </args>
-
-        <host name='foo.mcs.anl.gov'    range='3-4'/>
-
-	<args range='3'>
-	    <arg value='24'/>
-	    <arg value='app'/>
-        </args>
-
-	<args range='4'>
-	    <arg value='31'/>
-	    <arg value='app'/>
-        </args>
-
-    </create-process-group>
-</PMRequests>
diff --git a/src/pm/mpd/ex1.xml b/src/pm/mpd/ex1.xml
deleted file mode 100644
index 09fe7df..0000000
--- a/src/pm/mpd/ex1.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<create-process-group
-	   totalprocs='2'>
-      <process-spec
-	   range='0'
-	   cwd='/home/rbutler'
-	   exec='/bin/echo'>
-        <arg idx='1' value="hello"> </arg>
-        <arg idx='2' value="again"> </arg>
-      </process-spec>
-      <process-spec
-	   range='1'
-	   cwd='/home/rbutler'
-	   exec='/usr/bin/printenv'>
-        <env name='foo' value="bar"> </env>
-      </process-spec>
-      <host-spec>
-	   magpie
-      </host-spec>
-</create-process-group>
diff --git a/src/pm/mpd/ex2.xml b/src/pm/mpd/ex2.xml
deleted file mode 100644
index 57bab7c..0000000
--- a/src/pm/mpd/ex2.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<create-process-group
-	   totalprocs='7'
-	   stdin_dest='0,2-4,6'
-	   output='label'
-	   >
-      <process-spec
-	   range='0-6'
-	   cwd='/home/rbutler/mpd2'
-	   exec='temp1'>
-      </process-spec>
-      <host-spec>
-	   magpie
-      </host-spec>
-</create-process-group>
diff --git a/src/pm/mpd/ex3.xml b/src/pm/mpd/ex3.xml
deleted file mode 100644
index faba483..0000000
--- a/src/pm/mpd/ex3.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<create-process-group
-	   totalprocs='2'>
-      <process-spec
-	   range='0'
-	   cwd='/home/rbutler/mpd2'
-	   exec='infloop'>
-        <arg idx='1' value="hello"> </arg>
-        <arg idx='2' value="from 0"> </arg>
-	<limit type='cpu' value="2"/>
-      </process-spec>
-      <process-spec
-	   range='1'
-	   cwd='/home/rbutler/mpd2'
-	   exec='infloop'>
-        <arg idx='1' value="hello"> </arg>
-        <arg idx='2' value="from 1"> </arg>
-        <env name='foo' value="bar"> </env>
-	<limit type='cpu' value="3"/>
-      </process-spec>
-      <host-spec>
-	   magpie
-      </host-spec>
-</create-process-group>
diff --git a/src/pm/mpd/exittest_nompi.c b/src/pm/mpd/exittest_nompi.c
deleted file mode 100644
index a90d633..0000000
--- a/src/pm/mpd/exittest_nompi.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *  (C) 2001 by Argonne National Laboratory.
- *      See COPYRIGHT in top-level directory.
- */
-
-#include <stdio.h>
-
-int main(int argc, char *argv[])
-{
-    fprintf( stderr, "Process %d is alive\n", getpid( ) );
-    fprintf( stderr, "Process %d exiting with exit code %d\n", getpid( ), -getpid( ) );
-    return( -getpid( ) );
-}
diff --git a/src/pm/mpd/infloop.c b/src/pm/mpd/infloop.c
deleted file mode 100644
index 8654592..0000000
--- a/src/pm/mpd/infloop.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *  (C) 2001 by Argonne National Laboratory.
- *      See COPYRIGHT in top-level directory.
- */
-
-#include <stdio.h>
-
-int main( int argc, char *argv[] )
-{
-    int i, print_flag = 1;
-
-    if (argc > 1  &&  strcmp(argv[1],"-p") == 0)
-        print_flag = 0;
-    for (i=0; ; i++)
-    {
-	if (i % 100000000 == 0)
-	{
-            if (print_flag)
-            {
-                printf("i=%d\n",i);
-	        fflush(stdout);
-            }
-	}
-    }
-    return 0;
-}
diff --git a/src/pm/mpd/install.sh b/src/pm/mpd/install.sh
deleted file mode 100755
index a32f989..0000000
--- a/src/pm/mpd/install.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-
-#  example usage from Makefile.in
-#  ${INSTALL} -m 4755 mpdroot ${bindir}/mpdroot ;\
-
-if [ "$1" = "-c" ]
-then
-    shift    # get rid of it
-fi
-
-if [ "$1" != "-m" ]
-then
-    echo "-m option (permissions) required for this version of install.sh"
-    exit -1
-fi
-
-perms=$2
-src=$3
-dest=$4
-
-/bin/cp $src $dest
-/bin/chmod $perms $dest
diff --git a/src/pm/mpd/mpd.py b/src/pm/mpd/mpd.py
deleted file mode 100755
index b5f6616..0000000
--- a/src/pm/mpd/mpd.py
+++ /dev/null
@@ -1,1647 +0,0 @@
-#!/usr/bin/env python
-#
-#   (C) 2001 by Argonne National Laboratory.
-#       See COPYRIGHT in top-level directory.
-#
-
-"""
-usage: mpd [--host=<host> --port=<portnum>] [--noconsole]
-           [--trace] [--echo] [--daemon] [--bulletproof] --ncpus=<ncpus>
-           [--ifhn=<interface-hostname>] [--listenport=<listenport>]
-           [--pid=<pidfilename>] --tmpdir=<tmpdir>] [-zc] [--debug]
-
-Some long parameter names may be abbreviated to their first letters by using
-  only one hyphen and no equal sign:
-     mpd -h donner -p 4268 -n
-  is equivalent to
-     mpd --host=magpie --port=4268 --noconsole
-
---host and --port must be specified together; they tell the new mpd where
-  to enter an existing ring;  if they are omitted, the new mpd forms a
-  stand-alone ring that other mpds may enter later
---noconsole is useful for running 2 mpds on the same machine; only one of
-  them will accept mpd commands
---trace yields lots of traces thru mpd routines; currently too verbose
---debug turns on some debugging prints; currently not verbose enough
---echo causes the mpd echo its listener port by which other mpds may connect
---daemon causes mpd to run backgrounded, with no controlling tty
---bulletproof says to turn bulletproofing on (experimental)
---ncpus indicates how many cpus are on the local host; used for starting processes
---ifhn specifies an alternate interface hostname for the host this mpd is running on;
-  e.g. may be used to specify the alias for an interface other than default
---listenport specifies a port for this mpd to listen on; by default it will
-  acquire one from the system
---conlistenport specifies a port for this mpd to listen on for console
-  connections (only used when employing inet socket for console); by default it
-  will acquire one from the system
---pid=filename writes the mpd pid into the specified file, or --pid alone
-  writes it into /var/run/mpd.pid
---tmpdir=tmpdirname where mpd places temporary sockets, etc.
--zc is a purely EXPERIMENTAL option right now used to investigate zeroconf
-  networking; it can be used to allow mpds to discover each other locally
-  using multicast DNS; its usage may change over time
-  Currently, -zc is specified like this:  -zc N
-  where N specifies a 'level' in a startup set of mpds.  The first mpd in a ring
-  must have 1 and it will establish a ring of one mpd.  Subsequent mpds can specify
-  -zc 2 and will hook into the ring via the one at level 1.  Except for level 1, new
-  mpds enter the ring via an mpd at level-1.
-
-A file named .mpd.conf file must be present in the user's home directory
-  with read and write access only for the user, and must contain at least
-  a line with MPD_SECRETWORD=<secretword>
-
-To run mpd as root, install it while root and instead of a .mpd.conf file
-use mpd.conf (no leading dot) in the /etc directory.' 
-"""
-from  time    import  ctime
-from  mpdlib  import  mpd_version
-__author__ = "Ralph Butler and Rusty Lusk"
-__date__ = ctime()
-__version__ = "$Revision: 1.160 $"
-__version__ += "  " + str(mpd_version())
-__credits__ = ""
-
-
-import sys, os, signal, socket, stat
-
-from  re          import  sub
-from  atexit      import  register
-from  cPickle     import  dumps
-from  types       import  ClassType
-from  random      import  seed, randrange, random
-from  time        import  sleep
-from  md5         import  new as md5new
-from  mpdlib      import  mpd_set_my_id, mpd_check_python_version, mpd_sockpair, \
-                          mpd_print, mpd_get_my_username, mpd_close_zc, \
-                          mpd_get_groups_for_username, mpd_uncaught_except_tb, \
-                          mpd_set_procedures_to_trace, mpd_trace_calls, \
-                          mpd_dbg_level, mpd_set_dbg_level, mpd_set_tmpdir, \
-                          MPDSock, MPDListenSock, MPDConListenSock, \
-                          MPDStreamHandler, MPDRing, MPDParmDB
-from  mpdman      import  MPDMan
-
-# fix for ticket #753 where the set() builtin isn't available in python2.3
-try:
-    set
-except NameError:
-    from sets import Set as set
-
-
-try:
-    import pwd
-    pwd_module_available = 1
-except:
-    pwd_module_available = 0
-try:
-    import  syslog
-    syslog_module_available = 1
-except:
-    syslog_module_available = 0
-try:
-    import  subprocess
-    subprocess_module_available = 1
-except:
-    subprocess_module_available = 0
-
-
-def sigchld_handler(signum,frame):
-    done = 0
-    while not done:
-        try:
-            (pid,status) = os.waitpid(-1,os.WNOHANG)
-            if pid == 0:    # no existing child process is finished
-                done = 1
-        except:    # no more child processes to be waited for
-            done = 1
-            
-class MPD(object):
-    def __init__(self):
-        self.myHost = socket.gethostname()
-        try:
-            hostinfo = socket.gethostbyname_ex(self.myHost)
-            self.myIfhn = hostinfo[2][0]    # chgd below when I get the real value
-        except:
-            print 'mpd failed: gethostbyname_ex failed for %s' % (self.myHost)
-            sys.exit(-1)
-    def run(self):
-        if syslog_module_available:
-            syslog.openlog("mpd",0,syslog.LOG_DAEMON)
-            syslog.syslog(syslog.LOG_INFO,"mpd starting; no mpdid yet")
-        sys.excepthook = mpd_uncaught_except_tb
-        self.spawnQ = []
-        self.spawnInProgress = 0
-        self.parmdb = MPDParmDB(orderedSources=['cmdline','xml','env','rcfile','thispgm'])
-        self.parmsToOverride = {
-                                 'MPD_SECRETWORD'       :  '',
-                                 'MPD_MY_IFHN'          :  self.myIfhn,
-                                 'MPD_ENTRY_IFHN'       :  '',
-                                 'MPD_ENTRY_PORT'       :  0,
-                                 'MPD_NCPUS'            :  1,
-                                 'MPD_LISTEN_PORT'      :  0,
-                                 'MPD_TRACE_FLAG'       :  0,
-                                 'MPD_CONSOLE_FLAG'     :  1,
-                                 'MPD_ECHO_PORT_FLAG'   :  0,
-                                 'MPD_DAEMON_FLAG'      :  0,
-                                 'MPD_BULLETPROOF_FLAG' :  0,
-                                 'MPD_PID_FILENAME'     :  '',
-                                 'MPD_ZC'               :  0,
-                                 'MPD_LOGFILE_TRUNC_SZ' :  4000000,  # -1 -> don't trunc
-                                 'MPD_PORT_RANGE'       :  0,
-                                 'MPD_TMPDIR'           :  '/tmp',
-                               }
-        for (k,v) in self.parmsToOverride.items():
-            self.parmdb[('thispgm',k)] = v
-        self.get_parms_from_cmdline()
-        self.parmdb.get_parms_from_rcfile(self.parmsToOverride,errIfMissingFile=1)
-        self.parmdb.get_parms_from_env(self.parmsToOverride)
-        self.myIfhn = self.parmdb['MPD_MY_IFHN']    # variable for convenience
-        self.myPid = os.getpid()
-        if self.parmdb['MPD_PORT_RANGE']:
-            os.environ['MPICH_PORT_RANGE'] = self.parmdb['MPD_PORT_RANGE']
-        self.tmpdir = self.parmdb['MPD_TMPDIR']
-        mpd_set_tmpdir(self.tmpdir)
-        self.listenSock = MPDListenSock(name='ring_listen_sock',
-                                        port=self.parmdb['MPD_LISTEN_PORT'])
-        self.parmdb[('thispgm','MPD_LISTEN_PORT')] = self.listenSock.sock.getsockname()[1]
-        self.myId = '%s_%d' % (self.myHost,self.parmdb['MPD_LISTEN_PORT'])
-        mpd_set_my_id(myid=self.myId)
-        self.streamHandler = MPDStreamHandler()
-        self.ring = MPDRing(streamHandler=self.streamHandler,
-                            secretword=self.parmdb['MPD_SECRETWORD'],
-                            listenSock=self.listenSock,
-                            myIfhn=self.myIfhn,
-                            entryIfhn=self.parmdb['MPD_ENTRY_IFHN'],
-                            entryPort=self.parmdb['MPD_ENTRY_PORT'],
-                            zcMyLevel=self.parmdb['MPD_ZC'])
-        # setup tracing if requested via args
-        if self.parmdb['MPD_TRACE_FLAG']:
-            proceduresToTrace = []
-            import inspect
-            symbolsAndTypes = globals().items() + \
-                              inspect.getmembers(self) + \
-                              inspect.getmembers(self.ring) + \
-                              inspect.getmembers(self.streamHandler)
-            for (symbol,symtype) in symbolsAndTypes:
-                if symbol == '__init__':  # a problem to trace
-                    continue
-                if inspect.isfunction(symtype)  or  inspect.ismethod(symtype):
-                    # print symbol
-                    proceduresToTrace.append(symbol)
-            mpd_set_procedures_to_trace(proceduresToTrace)
-            sys.settrace(mpd_trace_calls)
-        if syslog_module_available:
-            syslog.syslog(syslog.LOG_INFO,"mpd has mpdid=%s (port=%d)" % \
-                          (self.myId,self.parmdb['MPD_LISTEN_PORT']) )
-        vinfo = mpd_check_python_version()
-        if vinfo:
-            print "mpd: your python version must be >= 2.2 ; current version is:", vinfo
-            sys.exit(-1)
-
-        # need to close both object and underlying fd (ticket #963)
-        sys.stdin.close()
-        os.close(0)
-
-        if self.parmdb['MPD_ECHO_PORT_FLAG']:    # do this before becoming a daemon
-            # print self.parmdb['MPD_LISTEN_PORT']
-            print "mpd_port=%d" % self.parmdb['MPD_LISTEN_PORT']
-            sys.stdout.flush()
-            ##### NEXT 2 for debugging
-            ## print >>sys.stderr, self.parmdb['MPD_LISTEN_PORT']
-            ## sys.stderr.flush()
-        self.myRealUsername = mpd_get_my_username()
-        self.currRingSize = 1    # default
-        self.currRingNCPUs = 1   # default
-        if os.environ.has_key('MPD_CON_EXT'):
-            self.conExt = '_'  + os.environ['MPD_CON_EXT']
-        else:
-            self.conExt = ''
-        self.logFilename = self.tmpdir + '/mpd2.logfile_' + mpd_get_my_username() + self.conExt
-        if self.parmdb['MPD_PID_FILENAME']:  # may overwrite it below
-            pidFile = open(self.parmdb['MPD_PID_FILENAME'],'w')
-            print >>pidFile, "%d" % (os.getpid())
-            pidFile.close()
-
-        self.conListenSock = 0    # don't want one when I do cleanup for forked daemon procs
-        if self.parmdb['MPD_DAEMON_FLAG']:      # see if I should become a daemon with no controlling tty
-            rc = os.fork()
-            if rc != 0:   # parent exits; child in background
-                sys.exit(0)
-            os.setsid()  # become session leader; no controlling tty
-            signal.signal(signal.SIGHUP,signal.SIG_IGN)  # make sure no sighup when leader ends
-            ## leader exits; svr4: make sure do not get another controlling tty
-            rc = os.fork()
-            if rc != 0:
-                sys.exit(0)
-            if self.parmdb['MPD_PID_FILENAME']:  # overwrite one above before chg usmask
-                pidFile = open(self.parmdb['MPD_PID_FILENAME'],'w')
-                print >>pidFile, "%d" % (os.getpid())
-                pidFile.close()
-            os.chdir("/")  # free up filesys for umount
-            os.umask(0)
-            try:    os.unlink(self.logFilename)
-            except: pass
-            logFileFD = os.open(self.logFilename,os.O_CREAT|os.O_WRONLY|os.O_EXCL,0600)
-            self.logFile = os.fdopen(logFileFD,'w',0)
-            sys.stdout = self.logFile
-            sys.stderr = self.logFile
-            print >>sys.stdout, 'logfile for mpd with pid %d' % os.getpid()
-            sys.stdout.flush()
-            os.dup2(self.logFile.fileno(),sys.__stdout__.fileno())
-            os.dup2(self.logFile.fileno(),sys.__stderr__.fileno())
-        if self.parmdb['MPD_CONSOLE_FLAG']:
-            self.conListenSock = MPDConListenSock(secretword=self.parmdb['MPD_SECRETWORD'])
-            self.streamHandler.set_handler(self.conListenSock,
-                                           self.handle_console_connection)
-        register(self.cleanup)
-        seed()
-        self.nextJobInt    = 1
-        self.activeJobs    = {}
-        self.conSock       = 0
-        self.allExiting    = 0    # for mpdallexit (for first loop for graceful exit)
-        self.exiting       = 0    # for mpdexit or mpdallexit
-        self.kvs_cntr      = 0    # for mpdman
-        self.pulse_cntr    = 0
-        rc = self.ring.enter_ring(lhsHandler=self.handle_lhs_input,
-                                  rhsHandler=self.handle_rhs_input)
-        if rc < 0:
-            mpd_print(1,"failed to enter ring")
-            sys.exit(-1)
-        self.pmi_published_names = {}
-        if hasattr(signal,'SIGCHLD'):
-            signal.signal(signal.SIGCHLD,sigchld_handler)
-        if not self.parmdb['MPD_BULLETPROOF_FLAG']:
-            #    import profile ; profile.run('self.runmainloop()')
-            self.runmainloop()
-        else:
-            try:
-                from threading import Thread
-            except:
-                print '*** mpd terminating'
-                print '    bulletproof option must be able to import threading-Thread'
-                sys.exit(-1)
-            # may use SIG_IGN on all but SIGCHLD and SIGHUP (handled above)
-            while 1:
-                mpdtid = Thread(target=self.runmainloop)
-                mpdtid.start()
-                # signals must be handled in main thread; thus we permit timeout of join
-                while mpdtid.isAlive():
-                    mpdtid.join(2)   # come out sometimes and handle signals
-                if self.exiting:
-                    break
-                if self.conSock:
-                    msgToSend = { 'cmd' : 'restarting_mpd' }
-                    self.conSock.msgToSend.send_dict_msg(msgToSend)
-                    self.streamHandler.del_handler(self.conSock)
-                    self.conSock.close()
-                    self.conSock = 0
-    def runmainloop(self):
-        # Main Loop
-        while 1:
-            if self.spawnQ  and  not self.spawnInProgress:
-                self.ring.rhsSock.send_dict_msg(self.spawnQ[0])
-                self.spawnQ = self.spawnQ[1:]
-                self.spawnInProgress = 1
-                continue
-            rv = self.streamHandler.handle_active_streams(timeout=8.0)
-            if rv[0] < 0:
-                if type(rv[1]) == ClassType  and  rv[1] == KeyboardInterrupt: # ^C
-                    sys.exit(-1)
-            if self.exiting:
-                break
-            if rv[0] == 0:
-                if self.pulse_cntr == 0  and  self.ring.rhsSock:
-                    self.ring.rhsSock.send_dict_msg({'cmd':'pulse'})
-                self.pulse_cntr += 1
-            if self.pulse_cntr >= 3:
-                if self.ring.rhsSock:  # rhs must have disappeared
-                    self.streamHandler.del_handler(self.ring.rhsSock)
-                    self.ring.rhsSock.close()
-                    self.ring.rhsSock = 0
-                if self.ring.lhsSock:
-                    self.streamHandler.del_handler(self.ring.lhsSock)
-                    self.ring.lhsSock.close()
-                    self.ring.lhsSock = 0
-                mpd_print(1,'no pulse_ack from rhs; re-entering ring')
-                rc = self.ring.reenter_ring(lhsHandler=self.handle_lhs_input,
-                                            rhsHandler=self.handle_rhs_input,
-                                            ntries=16)
-                if rc == 0:
-                    mpd_print(1,'back in ring')
-		else:
-                    mpd_print(1,'failed to reenter ring')
-                    sys.exit(-1)
-                self.pulse_cntr = 0
-        mpd_close_zc()  # only does something if we have zc
-    def usage(self):
-        print __doc__
-        print "This version of mpd is", mpd_version()
-        sys.exit(-1)
-    def cleanup(self):
-        try:
-            mpd_print(0, "CLEANING UP" )
-            if syslog_module_available:
-                syslog.syslog(syslog.LOG_INFO,"mpd ending mpdid=%s (inside cleanup)" % \
-                              (self.myId) )
-                syslog.closelog()
-            if self.conListenSock:    # only del if I created
-                os.unlink(self.conListenSock.conFilename)
-        except:
-            pass
-    def get_parms_from_cmdline(self):
-        global mpd_dbg_level
-        argidx = 1
-        while argidx < len(sys.argv):
-            if sys.argv[argidx] == '--help':
-                self.usage()
-                argidx += 1
-            elif sys.argv[argidx] == '-h':
-                if len(sys.argv) < 3:
-                    self.usage()
-                self.parmdb[('cmdline','MPD_ENTRY_IFHN')] = sys.argv[argidx+1]
-                argidx += 2
-            elif sys.argv[argidx].startswith('--host'):
-                try:
-                    entryHost = sys.argv[argidx].split('=',1)[1]
-                except:
-                    print 'failed to parse --host option'
-                    self.usage()
-                self.parmdb[('cmdline','MPD_ENTRY_IFHN')] = entryHost
-                argidx += 1
-            elif sys.argv[argidx] == '-p':
-                if argidx >= (len(sys.argv)-1):
-                    print 'missing arg for -p'
-                    sys.exit(-1)
-                if not sys.argv[argidx+1].isdigit():
-                    print 'invalid port %s ; must be numeric' % (sys.argv[argidx+1])
-                    sys.exit(-1)
-                self.parmdb[('cmdline','MPD_ENTRY_PORT')] = int(sys.argv[argidx+1])
-                argidx += 2
-            elif sys.argv[argidx].startswith('--port'):
-                try:
-                    entryPort = sys.argv[argidx].split('=',1)[1]
-                except:
-                    print 'failed to parse --port option'
-                    self.usage()
-                if not entryPort.isdigit():
-                    print 'invalid port %s ; must be numeric' % (entryPort)
-                    sys.exit(-1)
-                self.parmdb[('cmdline','MPD_ENTRY_PORT')] = int(entryPort)
-                argidx += 1
-            elif sys.argv[argidx].startswith('--ncpus'):
-                try:
-                    NCPUs = sys.argv[argidx].split('=',1)[1]
-                except:
-                    print 'failed to parse --ncpus option'
-                    self.usage()
-                if not NCPUs.isdigit():
-                    print 'invalid ncpus %s ; must be numeric' % (NCPUs)
-                    sys.exit(-1)
-                self.parmdb[('cmdline','MPD_NCPUS')] = int(NCPUs)
-                argidx += 1
-            elif sys.argv[argidx].startswith('--pid'):
-                try:
-                    splitPid = sys.argv[argidx].split('=')
-                except:
-                    print 'failed to parse --pid option'
-                    self.usage()
-                if len(splitPid) == 1  or  not splitPid[1]:
-                    pidFilename = '/var/run/mpd.pid'
-                else:
-                    pidFilename = splitPid[1]
-                self.parmdb[('cmdline','MPD_PID_FILENAME')] = pidFilename
-                argidx += 1
-            elif sys.argv[argidx].startswith('--tmpdir'):
-                try:
-                    splitTmpdir = sys.argv[argidx].split('=')
-                except:
-                    print 'failed to parse --tmpdir option'
-                    self.usage()
-                if len(splitTmpdir) == 1  or  not splitTmpdir[1]:
-                    tmpdirName = '/tmp'
-                else:
-                    tmpdirName = splitTmpdir[1]
-                self.parmdb[('cmdline','MPD_TMPDIR')] = tmpdirName
-                argidx += 1
-            elif sys.argv[argidx].startswith('--ifhn'):
-                try:
-                    ifhn = sys.argv[argidx].split('=',1)[1]
-                except:
-                    print 'failed to parse --ifhn option'
-                    self.usage()
-                try:
-                    hostinfo = socket.gethostbyname_ex(ifhn)
-                    ifhn = hostinfo[2][0]
-                except:
-                    print 'mpd failed: gethostbyname_ex failed for %s' % (ifhn)
-                    sys.exit(-1)
-                self.parmdb[('cmdline','MPD_MY_IFHN')] = ifhn
-                argidx += 1
-            elif sys.argv[argidx] == '-l':
-                if argidx >= (len(sys.argv)-1):
-                    print 'missing arg for -l'
-                    sys.exit(-1)
-                if not sys.argv[argidx+1].isdigit():
-                    print 'invalid listenport %s ; must be numeric' % (sys.argv[argidx+1])
-                    sys.exit(-1)
-                self.parmdb[('cmdline','MPD_LISTEN_PORT')] = int(sys.argv[argidx+1])
-                argidx += 2
-            elif sys.argv[argidx].startswith('--listenport'):
-                try:
-                    myListenPort = sys.argv[argidx].split('=',1)[1]
-                except:
-                    print 'failed to parse --listenport option'
-                    self.usage()
-                if not myListenPort.isdigit():
-                    print 'invalid listenport %s ; must be numeric' % (myListenPort)
-                    sys.exit(-1)
-                self.parmdb[('cmdline','MPD_LISTEN_PORT')] = int(myListenPort)
-                argidx += 1
-            elif sys.argv[argidx] == '-hp':
-                if argidx >= (len(sys.argv)-1):
-                    print 'missing arg for -hp'
-                    sys.exit(-1)
-                try:
-                    (entryIfhn,entryPort) = sys.argv[argidx+1].split('_')
-                except:
-                    print 'invalid entry host: %s' % (sys.argv[argidx+1])
-                    sys.exit(-1)
-                if not entryPort.isdigit():
-                    print 'invalid port %s ; must be numeric' % (sys.argv[argidx+1])
-                    sys.exit(-1)
-                self.parmdb[('cmdline','MPD_ENTRY_IFHN')] = entryIfhn
-                self.parmdb[('cmdline','MPD_ENTRY_PORT')] = int(entryPort)
-                argidx += 2
-            elif sys.argv[argidx] == '-t'  or  sys.argv[argidx] == '--trace':
-                self.parmdb[('cmdline','MPD_TRACE_FLAG')] = 1
-                argidx += 1
-            elif sys.argv[argidx] == '--debug':
-                mpd_set_dbg_level(1)
-                argidx += 1
-            elif sys.argv[argidx] == '-n'  or  sys.argv[argidx] == '--noconsole':
-                self.parmdb[('cmdline','MPD_CONSOLE_FLAG')] = 0
-                argidx += 1
-            elif sys.argv[argidx] == '-e'  or  sys.argv[argidx] == '--echo':
-                self.parmdb[('cmdline','MPD_ECHO_PORT_FLAG')] = 1 
-                argidx += 1
-            elif sys.argv[argidx] == '-d'  or  sys.argv[argidx] == '--daemon':
-                self.parmdb[('cmdline','MPD_DAEMON_FLAG')] = 1 
-                argidx += 1
-            elif sys.argv[argidx] == '-b'  or  sys.argv[argidx] == '--bulletproof':
-                self.parmdb[('cmdline','MPD_BULLETPROOF_FLAG')] = 1 
-                argidx += 1
-            elif sys.argv[argidx] == '-zc':
-                if argidx >= (len(sys.argv)-1):
-                    print 'missing arg for -zc'
-                    sys.exit(-1)
-                if not sys.argv[argidx+1].isdigit():
-                    print 'invalid arg for -zc %s ; must be numeric' % (sys.argv[argidx+1])
-                    sys.exit(-1)
-                intarg = int(sys.argv[argidx+1])
-                if intarg < 1:
-                    print 'invalid arg for -zc %s ; must be >= 1' % (sys.argv[argidx+1])
-                    sys.exit(-1)
-                self.parmdb[('cmdline','MPD_ZC')] = intarg
-                argidx += 2
-            else:
-                print 'unrecognized arg: %s' % (sys.argv[argidx])
-                sys.exit(-1)
-        if (self.parmdb['MPD_ENTRY_IFHN']  and  not self.parmdb['MPD_ENTRY_PORT']) \
-        or (self.parmdb['MPD_ENTRY_PORT']  and  not self.parmdb['MPD_ENTRY_IFHN']):
-            print 'host and port must be specified together'
-            sys.exit(-1)
-    def handle_console_connection(self,sock):
-        if not self.conSock:
-            (self.conSock,newConnAddr) = sock.accept()
-            if hasattr(socket,'AF_UNIX')  and  sock.family == socket.AF_UNIX:
-                line = self.conSock.recv_char_msg().rstrip()
-                if not line:  # caller went away (perhaps another mpd seeing if I am here)
-                    self.streamHandler.del_handler(self.conSock)
-                    self.conSock.close()
-                    self.conSock = 0
-                    return
-                errorMsg = ''
-                try:
-                    (kv1,kv2) = line.split(' ',1)  # 'realusername=xxx secretword=yyy'
-                except:
-                    errorMsg = 'failed to split this msg on " ": %s' % line
-                if not errorMsg:
-                    try:
-                        (k1,self.conSock.realUsername) = kv1.split('=',1)
-                    except:
-                        errorMsg = 'failed to split first kv pair on "=": %s' % line
-                if not errorMsg:
-                    try:
-                        (k2,secretword) = kv2.split('=',1)
-                    except:
-                        errorMsg = 'failed to split second kv pair on "=": %s' % line
-                if not errorMsg  and  k1 != 'realusername':
-                    errorMsg = 'first key is not realusername'
-                if not errorMsg  and  k2 != 'secretword':
-                    errorMsg = 'second key is not secretword'
-                if not errorMsg  and  os.getuid() == 0  and  secretword != self.parmdb['MPD_SECRETWORD']:
-                    errorMsg = 'invalid secretword to root mpd'
-                if errorMsg:
-                    try:
-                        self.conSock.send_dict_msg({'error_msg': errorMsg})
-                    except:
-                        pass
-                    self.streamHandler.del_handler(self.conSock)
-                    self.conSock.close()
-                    self.conSock = 0
-                    return
-                self.conSock.beingChallenged = 0
-            else:
-                msg = self.conSock.recv_dict_msg()
-                if not msg:    # caller went away (perhaps another mpd seeing if I am here)
-                    self.streamHandler.del_handler(self.conSock)
-                    self.conSock.close()
-                    self.conSock = 0
-                    return
-                if not msg.has_key('cmd')  or  msg['cmd'] != 'con_init':
-                    mpd_print(1, 'console sent bad msg :%s:' % (msg) )
-                    try:  # try to let console know
-                        self.conSock.send_dict_msg({'cmd':'invalid_msg_received_from_you'})
-                    except:
-                        pass
-                    self.streamHandler.del_handler(self.conSock)
-                    self.conSock.close()
-                    self.conSock = 0
-                    return
-                self.streamHandler.set_handler(self.conSock,self.handle_console_input)
-                self.conSock.beingChallenged = 1
-                self.conSock.name = 'console'
-                randNum = randrange(1,10000)
-                randVal = sock.secretword + str(randNum)
-                self.conSock.expectedResponse = md5new(randVal).digest()
-                self.conSock.send_dict_msg({'cmd' : 'con_challenge', 'randnum' : randNum })
-                self.conSock.realUsername = mpd_get_my_username()
-            self.streamHandler.set_handler(self.conSock,self.handle_console_input)
-            self.conSock.name = 'console'
-        else:
-            return  ## postpone it; hope the other one frees up soon
-    def handle_console_input(self,sock):
-        msg = self.conSock.recv_dict_msg()
-        if not msg:
-            mpd_print(0000, 'console has disappeared; closing it')
-            self.streamHandler.del_handler(self.conSock)
-            self.conSock.close()
-            self.conSock = 0
-            return
-        if not msg.has_key('cmd'):
-            mpd_print(1, 'console sent bad msg :%s:' % msg)
-            try:  # try to let console know
-                self.conSock.send_dict_msg({ 'cmd':'invalid_msg_received_from_you' })
-            except:
-                pass
-            self.streamHandler.del_handler(self.conSock)
-            self.conSock.close()
-            self.conSock = 0
-            return
-        if self.conSock.beingChallenged  and  msg['cmd'] != 'con_challenge_response':
-            mpd_print(1, 'console did not respond to con_challenge; msg=:%s:' % msg)
-            try:  # try to let console know
-                self.conSock.send_dict_msg({ 'cmd':'expected_con_challenge_response' })
-            except:
-                pass
-            self.streamHandler.del_handler(self.conSock)
-            self.conSock.close()
-            self.conSock = 0
-            return
-        if msg['cmd'] == 'con_challenge_response':
-            self.conSock.beingChallenged = 0
-            self.conSock.realUsername = msg['realusername']
-            if not msg.has_key('response'):
-                try:  # try to let console know
-                    self.conSock.send_dict_msg({ 'cmd':'missing_response_in_msg' })
-                except:
-                    pass
-                self.streamHandler.del_handler(self.conSock)
-                self.conSock.close()
-                self.conSock = 0
-                return
-            elif msg['response'] != self.conSock.expectedResponse:
-                try:  # try to let console know
-                    self.conSock.send_dict_msg({ 'cmd':'invalid_response' })
-                except:
-                    pass
-                self.streamHandler.del_handler(self.conSock)
-                self.conSock.close()
-                self.conSock = 0
-                return
-            self.conSock.send_dict_msg({ 'cmd':'valid_response' })
-        elif msg['cmd'] == 'mpdrun':
-            # permit anyone to run but use THEIR own username
-            #   thus, override any username specified by the user
-            if self.conSock.realUsername != 'root':
-                msg['username'] = self.conSock.realUsername
-                msg['users'] = { (0,msg['nprocs']-1) : self.conSock.realUsername }
-            #
-            msg['mpdid_mpdrun_start'] = self.myId
-            msg['nstarted_on_this_loop'] = 0
-            msg['first_loop'] = 1
-            msg['ringsize'] = 0
-            msg['ring_ncpus'] = 0
-            # maps rank => hostname
-            msg['process_mapping'] = {}
-            if msg.has_key('try_1st_locally'):
-                self.do_mpdrun(msg)
-            else:
-                self.ring.rhsSock.send_dict_msg(msg)
-            # send ack after job is going
-        elif msg['cmd'] == 'get_mpdrun_values':
-            msgToSend = { 'cmd' : 'response_get_mpdrun_values',
-	                  'mpd_version' : mpd_version(),
-	                  'mpd_ifhn' : self.myIfhn }
-            self.conSock.send_dict_msg(msgToSend)
-        elif msg['cmd'] == 'mpdtrace':
-            msgToSend = { 'cmd'     : 'mpdtrace_info',
-                          'dest'    : self.myId,
-                          'id'      : self.myId,
-                          'ifhn'    : self.myIfhn,
-                          'lhsport' : '%s' % (self.ring.lhsPort),
-                          'lhsifhn' : '%s' % (self.ring.lhsIfhn),
-                          'rhsport' : '%s' % (self.ring.rhsPort),
-                          'rhsifhn' : '%s' % (self.ring.rhsIfhn) }
-            self.ring.rhsSock.send_dict_msg(msgToSend)
-            msgToSend = { 'cmd'  : 'mpdtrace_trailer', 'dest' : self.myId }
-            self.ring.rhsSock.send_dict_msg(msgToSend)
-            # do not send an ack to console now; will send trace info later
-        elif msg['cmd'] == 'mpdallexit':
-            if self.conSock.realUsername != self.myRealUsername:
-                msgToSend = { 'cmd':'invalid_username_to_make_this_request' }
-                self.conSock.send_dict_msg(msgToSend)
-                self.streamHandler.del_handler(self.conSock)
-                self.conSock.close()
-                self.conSock = 0
-                return
-            # self.allExiting = 1  # doesn't really help here
-            self.ring.rhsSock.send_dict_msg( {'cmd' : 'mpdallexit', 'src' : self.myId} )
-            self.conSock.send_dict_msg( {'cmd' : 'mpdallexit_ack'} )
-        elif msg['cmd'] == 'mpdexit':
-            if self.conSock.realUsername != self.myRealUsername:
-                msgToSend = { 'cmd':'invalid_username_to_make_this_request' }
-                self.conSock.send_dict_msg(msgToSend)
-                self.streamHandler.del_handler(self.conSock)
-                self.conSock.close()
-                self.conSock = 0
-                return
-            if msg['mpdid'] == 'localmpd':
-                msg['mpdid'] = self.myId
-            self.ring.rhsSock.send_dict_msg( {'cmd' : 'mpdexit', 'src' : self.myId,
-                                              'done' : 0, 'dest' : msg['mpdid']} )
-        elif msg['cmd'] == 'mpdringtest':
-            msg['src'] = self.myId
-            self.ring.rhsSock.send_dict_msg(msg)
-            # do not send an ack to console now; will send ringtest info later
-        elif msg['cmd'] == 'mpdlistjobs':
-            msgToSend = { 'cmd'  : 'local_mpdid', 'id' : self.myId }
-            self.conSock.send_dict_msg(msgToSend)
-            for jobid in self.activeJobs.keys():
-                for manPid in self.activeJobs[jobid]:
-                    msgToSend = { 'cmd' : 'mpdlistjobs_info',
-                                  'dest' : self.myId,
-                                  'jobid' : jobid,
-                                  'username' : self.activeJobs[jobid][manPid]['username'],
-                                  'host' : self.myHost,
-                                  'ifhn' : self.myIfhn,
-                                  'clipid' : str(self.activeJobs[jobid][manPid]['clipid']),
-                                  'sid' : str(manPid),  # may chg to actual sid later
-                                  'pgm'  : self.activeJobs[jobid][manPid]['pgm'],
-                                  'rank' : self.activeJobs[jobid][manPid]['rank'] }
-                    self.conSock.send_dict_msg(msgToSend)
-            msgToSend = { 'cmd'  : 'mpdlistjobs_trailer', 'dest' : self.myId }
-            self.ring.rhsSock.send_dict_msg(msgToSend)
-            # do not send an ack to console now; will send listjobs info later
-        elif msg['cmd'] == 'mpdkilljob':
-            # permit anyone to kill but use THEIR own username
-            #   thus, override any username specified by the user
-            if self.conSock.realUsername != 'root':
-                msg['username'] = self.conSock.realUsername
-            msg['src'] = self.myId
-            msg['handled'] = 0
-            if msg['mpdid'] == '':
-                msg['mpdid'] = self.myId
-            self.ring.rhsSock.send_dict_msg(msg)
-            # send ack to console after I get this msg back and do the kill myself
-        elif msg['cmd'] == 'mpdsigjob':
-            # permit anyone to sig but use THEIR own username
-            #   thus, override any username specified by the user
-            if self.conSock.realUsername != 'root':
-                msg['username'] = self.conSock.realUsername
-            msg['src'] = self.myId
-            msg['handled'] = 0
-            if msg['mpdid'] == '':
-                msg['mpdid'] = self.myId
-            self.ring.rhsSock.send_dict_msg(msg)
-            # send ack to console after I get this msg back
-        elif msg['cmd'] == 'verify_hosts_in_ring':
-            msgToSend = { 'cmd'  : 'verify_hosts_in_ring', 'dest' : self.myId,
-                          'host_list' : msg['host_list'] }
-            self.ring.rhsSock.send_dict_msg(msgToSend)
-            # do not send an ack to console now; will send trace info later
-        else:
-            msgToSend = { 'cmd' : 'invalid_msg_received_from_you' }
-            self.conSock.send_dict_msg(msgToSend)
-            badMsg = 'invalid msg received from console: %s' % (str(msg))
-            mpd_print(1, badMsg)
-            if syslog_module_available:
-                syslog.syslog(syslog.LOG_ERR,badMsg)
-    def handle_man_input(self,sock):
-        msg = sock.recv_dict_msg()
-        if not msg:
-            for jobid in self.activeJobs.keys():
-                deleted = 0
-                for manPid in self.activeJobs[jobid]:
-                    if sock == self.activeJobs[jobid][manPid]['socktoman']:
-			mpd_print(mpd_dbg_level,\
-                                  "Deleting %s %d" % (str(jobid),manPid))
-                        del self.activeJobs[jobid][manPid]
-                        if len(self.activeJobs[jobid]) == 0:
-                            del self.activeJobs[jobid]
-                        deleted = 1
-                        break
-                if deleted:
-                    break
-            self.streamHandler.del_handler(sock)
-            sock.close()
-            return
-        if not msg.has_key('cmd'):
-            mpd_print(1, 'INVALID msg for man request msg=:%s:' % (msg) )
-            msgToSend = { 'cmd' : 'invalid_msg' }
-            sock.send_dict_msg(msgToSend)
-            self.streamHandler.del_handler(sock)
-            sock.close()
-            return
-	# Who asks, and why?  
-        # We have a failure that deletes the spawnerManPid from the
-	# activeJobs[jobid] variable.   The temporary work-around is
-        # to ignore this request if the target process is no longer 
-	# in the activeJobs table.
-        if msg['cmd'] == 'client_info':
-            jobid = msg['jobid']
-            manPid = msg['manpid']
-            self.activeJobs[jobid][manPid]['clipid'] = msg['clipid']
-            if msg['spawner_manpid']  and  msg['rank'] == 0:
-                if msg['spawner_mpd'] == self.myId:
-                    spawnerManPid = msg['spawner_manpid']
-		    mpd_print(mpd_dbg_level,\
-                       "About to check %s:%s" % (str(jobid),str(spawnerManPid)))
-
-                    if not self.activeJobs[jobid].has_key(spawnerManPid):
-                        mpd_print(0,"Missing %d in %s" % (spawnerManPid,str(jobid)))
-                    elif not self.activeJobs[jobid][spawnerManPid].has_key('socktoman'):
-                        mpd_print(0,"Missing socktoman!")
-                    else:
-                        spawnerManSock = self.activeJobs[jobid][spawnerManPid]['socktoman']
-                        msgToSend = { 'cmd' : 'spawn_done_by_mpd', 'rc' : 0, 'reason' : '' }
-                        spawnerManSock.send_dict_msg(msgToSend)
-                else:
-                    self.ring.rhsSock.send_dict_msg(msg)
-        elif msg['cmd'] == 'spawn':
-            msg['mpdid_mpdrun_start'] = self.myId
-            msg['spawner_mpd'] = self.myId
-            msg['nstarted_on_this_loop'] = 0
-            msg['first_loop'] = 1
-            msg['jobalias'] = ''
-            msg['stdin_dest'] = '0'
-            msg['ringsize'] = 0
-            msg['ring_ncpus'] = 0
-            msg['gdb'] = 0
-            msg['gdba'] = ''
-            msg['totalview'] = 0
-            msg['ifhns'] = {}
-            # maps rank => hostname
-            msg['process_mapping'] = {}
-            self.spawnQ.append(msg)
-        elif msg['cmd'] == 'publish_name':
-            self.pmi_published_names[msg['service']] = msg['port']
-            msgToSend = { 'cmd' : 'publish_result', 'info' : 'ok' }
-            sock.send_dict_msg(msgToSend)
-        elif msg['cmd'] == 'lookup_name':
-            if self.pmi_published_names.has_key(msg['service']):
-                msgToSend = { 'cmd' : 'lookup_result', 'info' : 'ok',
-                              'port' : self.pmi_published_names[msg['service']] }
-                sock.send_dict_msg(msgToSend)
-            else:
-                msg['cmd'] = 'pmi_lookup_name'    # add pmi_
-                msg['src'] = self.myId
-                msg['port'] = 0    # invalid
-                self.ring.rhsSock.send_dict_msg(msg)
-        elif msg['cmd'] == 'unpublish_name':
-            if self.pmi_published_names.has_key(msg['service']):
-                del self.pmi_published_names[msg['service']]
-                msgToSend = { 'cmd' : 'unpublish_result', 'info' : 'ok' }
-                sock.send_dict_msg(msgToSend)
-            else:
-                msg['cmd'] = 'pmi_unpublish_name'    # add pmi_
-                msg['src'] = self.myId
-                self.ring.rhsSock.send_dict_msg(msg)
-        else:
-            mpd_print(1, 'INVALID request from man msg=:%s:' % (msg) )
-            msgToSend = { 'cmd' : 'invalid_request' }
-            sock.send_dict_msg(msgToSend)
-
-    def calculate_process_mapping(self,mapping_dict):
-        # mapping_dict maps ranks => hostnames
-        ranks = list(mapping_dict.keys())
-        ranks.sort()
-
-        # assign node ids based in first-come-first-serve order when iterating
-        # over the ranks in increasing order
-        next_id = 0
-        node_ids = {}
-        for rank in ranks:
-            host = mapping_dict[rank]
-            if not node_ids.has_key(host):
-                node_ids[host] = next_id
-                next_id += 1
-
-
-        # maps {node_id_A: set([rankX,rankY,...]), node_id_B:...}
-        node_to_ranks = {}
-        for rank in ranks:
-            node_id = node_ids[mapping_dict[rank]]
-            if not node_to_ranks.has_key(node_id):
-                node_to_ranks[node_id] = set([])
-            node_to_ranks[node_id].add(rank)
-
-        # we only handle two cases for now:
-        # 1. block regular
-        # 2. round-robin regular
-        # we do handle "remainder nodes" that might not be full
-        delta = -1
-        max_ranks_per_node = 0
-        for node_id in node_to_ranks.keys():
-            last_rank = -1
-            if len(node_to_ranks[node_id]) > max_ranks_per_node:
-                max_ranks_per_node = len(node_to_ranks[node_id])
-            ranks = list(node_to_ranks[node_id])
-            ranks.sort()
-            for rank in ranks:
-                if last_rank != -1:
-                    if delta == -1:
-                        if node_id == 0:
-                            delta = rank - last_rank
-                        else:
-                            # irregular case detected such as {0:A,1:B,2:B}
-                            mpd_print(1, "irregular case A detected")
-                            return ''
-                    elif (rank - last_rank) != delta:
-                        # irregular such as {0:A,1:B,2:A,3:A,4:B}
-                        mpd_print(1, "irregular case B detected")
-                        return ''
-                last_rank = rank
-
-        # another check (case caught in ticket #905) for layouts like {0:A,1:A,2:B,3:B,4:B}
-        if len(node_to_ranks.keys()) > 1:
-            first_size = len(node_to_ranks[0])
-            last_size  = len(node_to_ranks[len(node_to_ranks.keys())-1])
-            if (last_size > first_size):
-                mpd_print(1, "irregular case C1 detected")
-                return ''
-            in_remainder = False
-            node_ids = node_to_ranks.keys()
-            node_ids.sort()
-            for node_id in node_ids:
-                node_size = len(node_to_ranks[node_id])
-                if not in_remainder:
-                    if node_size == first_size:
-                        pass # OK
-                    elif node_size == last_size:
-                        in_remainder = True
-                    else:
-                        mpd_print(1, "irregular case C2 detected")
-                        return ''
-                else: # in_remainder
-                    if node_size != last_size:
-                        mpd_print(1, "irregular case C3 detected")
-                        return ''
-
-        num_nodes = len(node_to_ranks.keys())
-        if delta == 1:
-            return '(vector,(%d,%d,%d))' % (0,num_nodes,max_ranks_per_node)
-        else:
-            # either we are round-robin-regular (delta > 1) or there is only one
-            # process per node (delta == -1), either way results in the same
-            # mapping spec
-            return '(vector,(%d,%d,%d))' % (0,num_nodes,1)
-
-    def handle_lhs_input(self,sock):
-        msg = self.ring.lhsSock.recv_dict_msg()
-        if not msg:    # lost lhs; don't worry
-            mpd_print(0, "CLOSING self.ring.lhsSock ", self.ring.lhsSock )
-            self.streamHandler.del_handler(self.ring.lhsSock)
-            self.ring.lhsSock.close()
-            self.ring.lhsSock = 0
-            return
-        if msg['cmd'] == 'mpdrun'  or  msg['cmd'] == 'spawn':
-            if  msg.has_key('mpdid_mpdrun_start')  \
-            and msg['mpdid_mpdrun_start'] == self.myId:
-                if msg['first_loop']:
-                    self.currRingSize = msg['ringsize']
-                    self.currRingNCPUs = msg['ring_ncpus']
-                if msg['nstarted'] == msg['nprocs']:
-                    # we have started all processes in the job, tell the
-                    # requester this and stop forwarding the mpdrun/spawn
-                    # message around the loop
-                    if msg['cmd'] == 'spawn':
-                        self.spawnInProgress = 0
-                    if self.conSock:
-                        msgToSend = { 'cmd' : 'mpdrun_ack',
-                                      'ringsize' : self.currRingSize,
-                                      'ring_ncpus' : self.currRingNCPUs}
-                        self.conSock.send_dict_msg(msgToSend)
-                    # Tell all MPDs in the ring the final process mapping.  In
-                    # turn, they will inform all of their child mpdmans.
-                    # Only do this in the case of a regular mpdrun.  The spawn
-                    # case it too complicated to handle this way right now.
-                    if msg['cmd'] == 'mpdrun':
-                        process_mapping_str = self.calculate_process_mapping(msg['process_mapping'])
-                        msgToSend = { 'cmd' : 'process_mapping',
-                                      'jobid' : msg['jobid'],
-                                      'mpdid_mpdrun_start' : self.myId,
-                                      'process_mapping' : process_mapping_str }
-                        self.ring.rhsSock.send_dict_msg(msgToSend)
-                    return
-                if not msg['first_loop']  and  msg['nstarted_on_this_loop'] == 0:
-                    if msg.has_key('jobid'):
-                        if msg['cmd'] == 'mpdrun':
-                            msgToSend = { 'cmd' : 'abortjob', 'src' : self.myId,
-                                          'jobid' : msg['jobid'],
-                                          'reason' : 'some_procs_not_started' }
-                            self.ring.rhsSock.send_dict_msg(msgToSend)
-                        else:  # spawn
-                            msgToSend = { 'cmd' : 'startup_status', 'rc' : -1,
-                                          'reason' : 'some_procs_not_started' }
-                            jobid = msg['jobid']
-                            manPid = msg['spawner_manpid']
-                            manSock = self.activeJobs[jobid][manPid]['socktoman']
-                            manSock.send_dict_msg(msgToSend)
-                    if self.conSock:
-                        msgToSend = { 'cmd' : 'job_failed',
-                                      'reason' : 'some_procs_not_started',
-                                      'remaining_hosts' : msg['hosts'] }
-                        self.conSock.send_dict_msg(msgToSend)
-                    return
-                msg['first_loop'] = 0
-                msg['nstarted_on_this_loop'] = 0
-            self.do_mpdrun(msg)
-        elif msg['cmd'] == 'process_mapping':
-            # message transmission terminates once the message has made it all
-            # the way around the loop once
-            if msg['mpdid_mpdrun_start'] != self.myId:
-                self.ring.rhsSock.send_dict_msg(msg) # forward it on around
-
-            # send to all mpdman's for the jobid embedded in the msg
-            jobid = msg['jobid']
-
-            # there may be no entry for jobid in the activeJobs table if there
-            # weren't any processes from that job actually launched on our host
-            if self.activeJobs.has_key(jobid):
-                for manPid in self.activeJobs[jobid].keys():
-                    manSock = self.activeJobs[jobid][manPid]['socktoman']
-                    manSock.send_dict_msg(msg)
-        elif msg['cmd'] == 'mpdtrace_info':
-            if msg['dest'] == self.myId:
-                if self.conSock:
-                    self.conSock.send_dict_msg(msg)
-            else:
-                self.ring.rhsSock.send_dict_msg(msg)
-        elif msg['cmd'] == 'mpdtrace_trailer':
-            if msg['dest'] == self.myId:
-                if self.conSock:
-                    self.conSock.send_dict_msg(msg)
-            else:
-                msgToSend = { 'cmd'     : 'mpdtrace_info',
-                              'dest'    : msg['dest'],
-                              'id'      : self.myId,
-                              'ifhn'    : self.myIfhn,
-                              'lhsport' : '%s' % (self.ring.lhsPort),
-                              'lhsifhn' : '%s' % (self.ring.lhsIfhn),
-                              'rhsport' : '%s' % (self.ring.rhsPort),
-                              'rhsifhn' : '%s' % (self.ring.rhsIfhn) }
-                self.ring.rhsSock.send_dict_msg(msgToSend)
-                self.ring.rhsSock.send_dict_msg(msg)
-        elif msg['cmd'] == 'mpdlistjobs_info':
-            if msg['dest'] == self.myId:
-                if self.conSock:
-                    self.conSock.send_dict_msg(msg)
-            else:
-                self.ring.rhsSock.send_dict_msg(msg)
-        elif msg['cmd'] == 'mpdlistjobs_trailer':
-            if msg['dest'] == self.myId:
-                if self.conSock:
-                    self.conSock.send_dict_msg(msg)
-            else:
-                for jobid in self.activeJobs.keys():
-                    for manPid in self.activeJobs[jobid]:
-                        msgToSend = { 'cmd' : 'mpdlistjobs_info',
-                                      'dest' : msg['dest'],
-                                      'jobid' : jobid,
-                                      'username' : self.activeJobs[jobid][manPid]['username'],
-                                      'host' : self.myHost,
-                                      'ifhn' : self.myIfhn,
-                                      'clipid' : str(self.activeJobs[jobid][manPid]['clipid']),
-                                      'sid' : str(manPid),  # may chg to actual sid later
-                                      'pgm' : self.activeJobs[jobid][manPid]['pgm'],
-                                      'rank' : self.activeJobs[jobid][manPid]['rank'] }
-                        self.ring.rhsSock.send_dict_msg(msgToSend)
-                self.ring.rhsSock.send_dict_msg(msg)
-        elif msg['cmd'] == 'mpdallexit':
-            if self.allExiting:   # already seen this once
-                self.exiting = 1  # set flag to exit main loop
-            self.allExiting = 1
-            self.ring.rhsSock.send_dict_msg(msg)
-        elif msg['cmd'] == 'mpdexit':
-            if msg['dest'] == self.myId:
-                msg['done'] = 1    # do this first
-            if msg['src'] == self.myId:    # may be src and dest
-                if self.conSock:
-                    if msg['done']:
-                        self.conSock.send_dict_msg({'cmd' : 'mpdexit_ack'})
-                    else:
-                        self.conSock.send_dict_msg({'cmd' : 'mpdexit_failed'})
-            else:
-                self.ring.rhsSock.send_dict_msg(msg)
-            if msg['dest'] == self.myId:
-                self.exiting = 1
-                self.ring.lhsSock.send_dict_msg( { 'cmd'     : 'mpdexiting',
-                                                   'rhsifhn' : self.ring.rhsIfhn,
-                                                   'rhsport' : self.ring.rhsPort })
-        elif msg['cmd'] == 'mpdringtest':
-            if msg['src'] != self.myId:
-                self.ring.rhsSock.send_dict_msg(msg)
-            else:
-                numLoops = msg['numloops'] - 1
-                if numLoops > 0:
-                    msg['numloops'] = numLoops
-                    self.ring.rhsSock.send_dict_msg(msg)
-                else:
-                    if self.conSock:    # may have closed it if user did ^C at console
-                        self.conSock.send_dict_msg({'cmd' : 'mpdringtest_done' })
-        elif msg['cmd'] == 'mpdsigjob':
-            forwarded = 0
-            if msg['handled']  and  msg['src'] != self.myId:
-                self.ring.rhsSock.send_dict_msg(msg)
-                forwarded = 1
-            handledHere = 0
-            for jobid in self.activeJobs.keys():
-                sjobid = jobid.split('  ')  # jobnum and mpdid
-                if (sjobid[0] == msg['jobnum']  and  sjobid[1] == msg['mpdid'])  \
-                or (msg['jobalias']  and  sjobid[2] == msg['jobalias']):
-                    for manPid in self.activeJobs[jobid].keys():
-                        if self.activeJobs[jobid][manPid]['username'] == msg['username']  \
-                        or msg['username'] == 'root':
-                            manSock = self.activeJobs[jobid][manPid]['socktoman']
-                            manSock.send_dict_msg( { 'cmd' : 'signal_to_handle',
-                                                     's_or_g' : msg['s_or_g'],
-                                                     'sigtype' : msg['sigtype'] } )
-                            handledHere = 1
-            if handledHere:
-                msg['handled'] = 1
-            if not forwarded  and  msg['src'] != self.myId:
-                self.ring.rhsSock.send_dict_msg(msg)
-            if msg['src'] == self.myId:
-                if self.conSock:
-                    self.conSock.send_dict_msg( {'cmd' : 'mpdsigjob_ack',
-                                                 'handled' : msg['handled'] } )
-        elif msg['cmd'] == 'mpdkilljob':
-            forwarded = 0
-            if msg['handled'] and msg['src'] != self.myId:
-                self.ring.rhsSock.send_dict_msg(msg)
-                forwarded = 1
-            handledHere = 0
-            for jobid in self.activeJobs.keys():
-                sjobid = jobid.split('  ')  # jobnum and mpdid
-                if (sjobid[0] == msg['jobnum']  and  sjobid[1] == msg['mpdid'])  \
-                or (msg['jobalias']  and  sjobid[2] == msg['jobalias']):
-                    for manPid in self.activeJobs[jobid].keys():
-                        if self.activeJobs[jobid][manPid]['username'] == msg['username']  \
-                        or msg['username'] == 'root':
-                            try:
-                                pgrp = manPid * (-1)  # neg manPid -> group
-                                os.kill(pgrp,signal.SIGKILL)
-                                cliPid = self.activeJobs[jobid][manPid]['clipid']
-                                pgrp = cliPid * (-1)  # neg Pid -> group
-                                os.kill(pgrp,signal.SIGKILL)  # neg Pid -> group
-                                handledHere = 1
-                            except:
-                                pass
-                    # del self.activeJobs[jobid]  ## handled when child goes away
-            if handledHere:
-                msg['handled'] = 1
-            if not forwarded  and  msg['src'] != self.myId:
-                self.ring.rhsSock.send_dict_msg(msg)
-            if msg['src'] == self.myId:
-                if self.conSock:
-                    self.conSock.send_dict_msg( {'cmd' : 'mpdkilljob_ack',
-                                                 'handled' : msg['handled'] } )
-        elif msg['cmd'] == 'abortjob':
-            if msg['src'] != self.myId:
-                self.ring.rhsSock.send_dict_msg(msg)
-            for jobid in self.activeJobs.keys():
-                if jobid == msg['jobid']:
-                    for manPid in self.activeJobs[jobid].keys():
-                        manSocket = self.activeJobs[jobid][manPid]['socktoman']
-                        if manSocket:
-                            manSocket.send_dict_msg(msg)
-                            sleep(0.5)  # give man a brief chance to deal with this
-                        try:
-                            pgrp = manPid * (-1)  # neg manPid -> group
-                            os.kill(pgrp,signal.SIGKILL)
-                            cliPid = self.activeJobs[jobid][manPid]['clipid']
-                            pgrp = cliPid * (-1)  # neg Pid -> group
-                            os.kill(pgrp,signal.SIGKILL)  # neg Pid -> group
-                        except:
-                            pass
-                    # del self.activeJobs[jobid]  ## handled when child goes away
-        elif msg['cmd'] == 'pulse':
-            self.ring.lhsSock.send_dict_msg({'cmd':'pulse_ack'})
-        elif msg['cmd'] == 'verify_hosts_in_ring':
-            while self.myIfhn in msg['host_list']  or  self.myHost in msg['host_list']:
-                if self.myIfhn in msg['host_list']:
-                    msg['host_list'].remove(self.myIfhn)
-                elif self.myHost in msg['host_list']:
-                    msg['host_list'].remove(self.myHost)
-            if msg['dest'] == self.myId:
-                msgToSend = { 'cmd' : 'verify_hosts_in_ring_response',
-                              'host_list' : msg['host_list'] }
-                self.conSock.send_dict_msg(msgToSend)
-            else:
-                self.ring.rhsSock.send_dict_msg(msg)
-        elif msg['cmd'] == 'pmi_lookup_name':
-            if msg['src'] == self.myId:
-                if msg.has_key('port') and msg['port'] != 0:
-                    msgToSend = msg
-                    msgToSend['cmd'] = 'lookup_result'
-                    msgToSend['info'] = 'ok'
-                else:
-                    msgToSend = { 'cmd' : 'lookup_result', 'info' : 'unknown_service',
-                                  'port' : 0}
-                jobid = msg['jobid']
-                manPid = msg['manpid']
-                manSock = self.activeJobs[jobid][manPid]['socktoman']
-                manSock.send_dict_msg(msgToSend)
-            else:
-                if self.pmi_published_names.has_key(msg['service']):
-                    msg['port'] = self.pmi_published_names[msg['service']]
-                self.ring.rhsSock.send_dict_msg(msg)
-        elif msg['cmd'] == 'pmi_unpublish_name':
-            if msg['src'] == self.myId:
-                if msg.has_key('done'):
-                    msgToSend = msg
-                    msgToSend['cmd'] = 'unpublish_result'
-                    msgToSend['info'] = 'ok'
-                else:
-                    msgToSend = { 'cmd' : 'unpublish_result', 'info' : 'unknown_service' }
-                jobid = msg['jobid']
-                manPid = msg['manpid']
-                manSock = self.activeJobs[jobid][manPid]['socktoman']
-                manSock.send_dict_msg(msgToSend)
-            else:
-                if self.pmi_published_names.has_key(msg['service']):
-                    del self.pmi_published_names[msg['service']]
-                    msg['done'] = 1
-                self.ring.rhsSock.send_dict_msg(msg)
-        elif msg['cmd'] == 'client_info':
-            if msg['spawner_manpid']  and  msg['rank'] == 0:
-                if msg['spawner_mpd'] == self.myId:
-                    jobid = msg['jobid']
-                    spawnerManPid = msg['spawner_manpid']
-                    if self.activeJobs[jobid].has_key(spawnerManPid):
-                        spawnerManSock = self.activeJobs[jobid][spawnerManPid]['socktoman']
-                        msgToSend = { 'cmd' : 'spawn_done_by_mpd', 'rc' : 0, 'reason' : '' }
-                        spawnerManSock.send_dict_msg(msgToSend)
-                else:
-                    self.ring.rhsSock.send_dict_msg(msg)
-        else:
-            mpd_print(1, 'unrecognized cmd from lhs: %s' % (msg) )
-
-    def handle_rhs_input(self,sock):
-        if self.allExiting:
-            return
-        msg = sock.recv_dict_msg()
-        if not msg:    # lost rhs; re-knit the ring
-            if sock == self.ring.rhsSock:
-                needToReenter = 1
-            else:
-                needToReenter = 0
-            if sock == self.ring.rhsSock  and self.ring.lhsSock:
-                self.streamHandler.del_handler(self.ring.lhsSock)
-                self.ring.lhsSock.close()
-                self.ring.lhsSock = 0
-            if sock == self.ring.rhsSock  and self.ring.rhsSock:
-                self.streamHandler.del_handler(self.ring.rhsSock)
-                self.ring.rhsSock.close()
-                self.ring.rhsSock = 0
-            if needToReenter:
-                mpd_print(1,'lost rhs; re-entering ring')
-                rc = self.ring.reenter_ring(lhsHandler=self.handle_lhs_input,
-                                            rhsHandler=self.handle_rhs_input,
-                                            ntries=16)
-                if rc == 0:
-                    mpd_print(1,'back in ring')
-		else:
-                    mpd_print(1,'failed to reenter ring')
-                    sys.exit(-1)
-            return
-        if msg['cmd'] == 'pulse_ack':
-            self.pulse_cntr = 0
-        elif msg['cmd'] == 'mpdexiting':    # for mpdexit
-            if self.ring.rhsSock:
-                self.streamHandler.del_handler(self.ring.rhsSock)
-                self.ring.rhsSock.close()
-                self.ring.rhsSock = 0
-            # connect to new rhs
-            self.ring.rhsIfhn = msg['rhsifhn']
-            self.ring.rhsPort = int(msg['rhsport'])
-            if self.ring.rhsIfhn == self.myIfhn  and  self.ring.rhsPort == self.parmdb['MPD_LISTEN_PORT']:
-                rv = self.ring.connect_rhs(rhsHost=self.ring.rhsIfhn,
-                                           rhsPort=self.ring.rhsPort,
-                                           rhsHandler=self.handle_rhs_input,
-                                           numTries=3)
-                if rv[0] <=  0:  # connect did not succeed; may try again
-                    mpd_print(1,"rhs connect failed")
-                    sys.exit(-1)
-                return
-            self.ring.rhsSock = MPDSock(name='rhs')
-            self.ring.rhsSock.connect((self.ring.rhsIfhn,self.ring.rhsPort))
-            self.pulse_cntr = 0
-            if not self.ring.rhsSock:
-                mpd_print(1,'handle_rhs_input failed to obtain rhs socket')
-                return
-            msgToSend = { 'cmd' : 'request_to_enter_as_lhs', 'host' : self.myHost,
-                          'ifhn' : self.myIfhn, 'port' : self.parmdb['MPD_LISTEN_PORT'] }
-            self.ring.rhsSock.send_dict_msg(msgToSend)
-            msg = self.ring.rhsSock.recv_dict_msg()
-            if (not msg) or  \
-               (not msg.has_key('cmd')) or  \
-               (msg['cmd'] != 'challenge') or (not msg.has_key('randnum')):
-                mpd_print(1, 'failed to recv challenge from rhs; msg=:%s:' % (msg) )
-            response = md5new(''.join([self.parmdb['MPD_SECRETWORD'],
-                                       msg['randnum']])).digest()
-            msgToSend = { 'cmd' : 'challenge_response',
-                          'response' : response,
-                          'host' : self.myHost, 'ifhn' : self.myIfhn,
-                          'port' : self.parmdb['MPD_LISTEN_PORT'] }
-            self.ring.rhsSock.send_dict_msg(msgToSend)
-            msg = self.ring.rhsSock.recv_dict_msg()
-            if (not msg) or  \
-               (not msg.has_key('cmd')) or  \
-               (msg['cmd'] != 'OK_to_enter_as_lhs'):
-                mpd_print(1, 'NOT OK to enter ring; msg=:%s:' % (msg) )
-            self.streamHandler.set_handler(self.ring.rhsSock,self.handle_rhs_input)
-        else:
-            mpd_print(1, 'unexpected from rhs; msg=:%s:' % (msg) )
-        return
-
-    def do_mpdrun(self,msg):
-        if self.parmdb['MPD_LOGFILE_TRUNC_SZ'] >= 0:
-            try:
-                logSize = os.stat(self.logFilename)[stat.ST_SIZE]
-                if logSize > self.parmdb['MPD_LOGFILE_TRUNC_SZ']:
-                    self.logFile.truncate(self.parmdb['MPD_LOGFILE_TRUNC_SZ'])
-            except:
-                pass
-
-        if msg.has_key('jobid'):
-            jobid = msg['jobid']
-        else:
-            jobid = str(self.nextJobInt) + '  ' + self.myId + '  ' + msg['jobalias']
-            self.nextJobInt += 1
-            msg['jobid'] = jobid
-        if msg['nstarted'] >= msg['nprocs']:
-            self.ring.rhsSock.send_dict_msg(msg)  # forward it on around
-            return
-        hosts = msg['hosts']
-        if self.myIfhn in hosts.values():
-            hostsKeys = hosts.keys()
-            hostsKeys.sort()
-            for ranks in hostsKeys:
-                if hosts[ranks] == self.myIfhn:
-                    (lorank,hirank) = ranks
-                    for rank in range(lorank,hirank+1):
-                        self.run_one_cli(rank,msg)
-                        # we use myHost under the assumption that there is only
-                        # one mpd per user on a given host.  The ifhn only
-                        # affects how the MPDs communicate with each other, not
-                        # which host they are on
-                        msg['process_mapping'][rank] = self.myHost
-                        msg['nstarted'] += 1
-                        msg['nstarted_on_this_loop'] += 1
-                    del msg['hosts'][ranks]
-        elif '_any_from_pool_' in hosts.values():
-            hostsKeys = hosts.keys()
-            hostsKeys.sort()
-            for ranks in hostsKeys:
-                if hosts[ranks] == '_any_from_pool_':
-                    (lorank,hirank) = ranks
-                    hostSpecPool = msg['host_spec_pool']
-                    if self.myIfhn in hostSpecPool  or  self.myHost in hostSpecPool:
-                        self.run_one_cli(lorank,msg)
-                        msg['process_mapping'][lorank] = self.myHost
-                        msg['nstarted'] += 1
-                        msg['nstarted_on_this_loop'] += 1
-                        del msg['hosts'][ranks]
-                        if lorank < hirank:
-                            msg['hosts'][(lorank+1,hirank)] = '_any_from_pool_'
-                    break
-        elif '_any_' in hosts.values():
-            done = 0
-            while not done:
-                hostsKeys = hosts.keys()
-                hostsKeys.sort()
-                for ranks in hostsKeys:
-                    if hosts[ranks] == '_any_':
-                        (lorank,hirank) = ranks
-                        self.run_one_cli(lorank,msg)
-                        msg['process_mapping'][lorank] = self.myHost
-                        msg['nstarted'] += 1
-                        msg['nstarted_on_this_loop'] += 1
-                        del msg['hosts'][ranks]
-                        if lorank < hirank:
-                            msg['hosts'][(lorank+1,hirank)] = '_any_'
-                        # self.activeJobs maps:
-                        # { jobid => { mpdman_pid => {...} } }
-                        procsHereForJob = len(self.activeJobs[jobid].keys())
-                        if procsHereForJob >= self.parmdb['MPD_NCPUS']:
-                            break  # out of for loop
-                # if no more to start via any or enough started here
-                if '_any_' not in hosts.values() \
-                or procsHereForJob >= self.parmdb['MPD_NCPUS']:
-                    done = 1
-        if msg['first_loop']:
-            msg['ringsize'] += 1
-            msg['ring_ncpus'] += self.parmdb['MPD_NCPUS']
-        self.ring.rhsSock.send_dict_msg(msg)  # forward it on around
-    def run_one_cli(self,currRank,msg):
-        users = msg['users']
-        for ranks in users.keys():
-            (lo,hi) = ranks
-            if currRank >= lo  and  currRank <= hi:
-                username = users[ranks]
-                break
-        execs = msg['execs']
-        for ranks in execs.keys():
-            (lo,hi) = ranks
-            if currRank >= lo  and  currRank <= hi:
-                pgm = execs[ranks]
-                break
-        paths = msg['paths']
-        for ranks in paths.keys():
-            (lo,hi) = ranks
-            if currRank >= lo  and  currRank <= hi:
-                pathForExec = paths[ranks]
-                break
-        args = msg['args']
-        for ranks in args.keys():
-            (lo,hi) = ranks
-            if currRank >= lo  and  currRank <= hi:
-                pgmArgs = dumps(args[ranks])
-                break
-        envvars = msg['envvars']
-        for ranks in envvars.keys():
-            (lo,hi) = ranks
-            if currRank >= lo  and  currRank <= hi:
-                pgmEnvVars = dumps(envvars[ranks])
-                break
-        limits = msg['limits']
-        for ranks in limits.keys():
-            (lo,hi) = ranks
-            if currRank >= lo  and  currRank <= hi:
-                pgmLimits = dumps(limits[ranks])
-                break
-        cwds = msg['cwds']
-        for ranks in cwds.keys():
-            (lo,hi) = ranks
-            if currRank >= lo  and  currRank <= hi:
-                cwd = cwds[ranks]
-                break
-        umasks = msg['umasks']
-        for ranks in umasks.keys():
-            (lo,hi) = ranks
-            if currRank >= lo  and  currRank <= hi:
-                pgmUmask = umasks[ranks]
-                break
-        man_env = {}
-        if msg['ifhns'].has_key(currRank):
-            man_env['MPICH_INTERFACE_HOSTNAME'] = msg['ifhns'][currRank]
-        else:
-            man_env['MPICH_INTERFACE_HOSTNAME'] = self.myIfhn
-        man_env.update(os.environ)    # may only want to mov non-MPD_ stuff
-        man_env['MPDMAN_MYHOST'] = self.myHost
-        man_env['MPDMAN_MYIFHN'] = self.myIfhn
-        man_env['MPDMAN_JOBID'] = msg['jobid']
-        man_env['MPDMAN_CLI_PGM'] = pgm
-        man_env['MPDMAN_CLI_PATH'] = pathForExec
-        man_env['MPDMAN_PGM_ARGS'] = pgmArgs
-        man_env['MPDMAN_PGM_ENVVARS'] = pgmEnvVars
-        man_env['MPDMAN_PGM_LIMITS'] = pgmLimits
-        man_env['MPDMAN_CWD'] = cwd
-        man_env['MPDMAN_UMASK'] = pgmUmask
-        man_env['MPDMAN_SPAWNED'] = str(msg['spawned'])
-        if msg.has_key('spawner_manpid'):
-            man_env['MPDMAN_SPAWNER_MANPID'] = str(msg['spawner_manpid'])
-        else:
-            man_env['MPDMAN_SPAWNER_MANPID'] = '0'
-        if msg.has_key('spawner_mpd'):
-            man_env['MPDMAN_SPAWNER_MPD'] = msg['spawner_mpd']
-        else:
-            man_env['MPDMAN_SPAWNER_MPD'] = ''
-        man_env['MPDMAN_NPROCS'] = str(msg['nprocs'])
-        man_env['MPDMAN_MPD_LISTEN_PORT'] = str(self.parmdb['MPD_LISTEN_PORT'])
-        man_env['MPDMAN_MPD_CONF_SECRETWORD'] = self.parmdb['MPD_SECRETWORD']
-        man_env['MPDMAN_CONHOST'] = msg['conhost']
-        man_env['MPDMAN_CONIFHN'] = msg['conifhn']
-        man_env['MPDMAN_CONPORT'] = str(msg['conport'])
-        man_env['MPDMAN_RANK'] = str(currRank)
-        man_env['MPDMAN_POS_IN_RING'] = str(msg['nstarted'])
-        man_env['MPDMAN_STDIN_DEST'] = msg['stdin_dest']
-        man_env['MPDMAN_TOTALVIEW'] = str(msg['totalview'])
-        man_env['MPDMAN_GDB'] = str(msg['gdb'])
-        man_env['MPDMAN_GDBA'] = str(msg['gdba'])  # for attach to running pgm
-        fullDirName = os.path.abspath(os.path.split(sys.argv[0])[0])  # normalize
-        man_env['MPDMAN_FULLPATHDIR'] = fullDirName    # used to find gdbdrv
-        man_env['MPDMAN_SINGINIT_PID']  = str(msg['singinitpid'])
-        man_env['MPDMAN_SINGINIT_PORT'] = str(msg['singinitport'])
-        man_env['MPDMAN_LINE_LABELS_FMT'] = msg['line_labels']
-        if msg.has_key('rship'):
-            man_env['MPDMAN_RSHIP'] = msg['rship']
-            man_env['MPDMAN_MSHIP_HOST'] = msg['mship_host']
-            man_env['MPDMAN_MSHIP_PORT'] = str(msg['mship_port'])
-        if msg.has_key('doing_bnr'):
-            man_env['MPDMAN_DOING_BNR'] = '1'
-        else:
-            man_env['MPDMAN_DOING_BNR'] = '0'
-        if msg['nstarted'] == 0:
-            manKVSTemplate = '%s_%s_%d' % \
-                             (self.myHost,self.parmdb['MPD_LISTEN_PORT'],self.kvs_cntr)
-            manKVSTemplate = sub('\.','_',manKVSTemplate)  # chg magpie.cs to magpie_cs
-            manKVSTemplate = sub('\-','_',manKVSTemplate)  # chg node-0 to node_0
-            self.kvs_cntr += 1
-            msg['kvs_template'] = manKVSTemplate
-        man_env['MPDMAN_KVS_TEMPLATE'] = msg['kvs_template']
-	msg['username'] = username
-        if hasattr(os,'fork'):
-            (manPid,toManSock) = self.launch_mpdman_via_fork(msg,man_env)
-            if not manPid:
-                print '**** mpd: launch_client_via_fork_exec failed; exiting'
-        elif subprocess_module_available:
-            (manPid,toManSock) = self.launch_mpdman_via_subprocess(msg,man_env)
-        else:
-            mpd_print(1,'neither fork nor subprocess is available')
-            sys.exit(-1)
-        jobid = msg['jobid']
-        if not self.activeJobs.has_key(jobid):
-            self.activeJobs[jobid] = {}
-        self.activeJobs[jobid][manPid] = { 'pgm' : pgm, 'rank' : currRank,
-                                           'username' : username,
-                                           'clipid' : -1,    # until report by man
-                                           'socktoman' : toManSock }
-        mpd_print(mpd_dbg_level,"Created entry for %s %d" % (str(jobid),manPid) )
-    def launch_mpdman_via_fork(self,msg,man_env):
-        man_env['MPDMAN_HOW_LAUNCHED'] = 'FORK'
-        currRank = int(man_env['MPDMAN_RANK'])
-        manListenSock = MPDListenSock('',0,name='tempsock')
-        manListenPort = manListenSock.getsockname()[1]
-        if msg['nstarted'] == 0:
-            manEntryIfhn = ''
-            manEntryPort = 0
-            msg['pos0_host'] = self.myHost
-            msg['pos0_ifhn'] = self.myIfhn
-            msg['pos0_port'] = str(manListenPort)
-            man_env['MPDMAN_POS0_IFHN'] = self.myIfhn
-            man_env['MPDMAN_POS0_PORT'] = str(manListenPort)
-        else:
-            manEntryIfhn = msg['entry_ifhn']
-            manEntryPort = msg['entry_port']
-            man_env['MPDMAN_POS0_IFHN'] = msg['pos0_ifhn']
-            man_env['MPDMAN_POS0_PORT'] = msg['pos0_port']
-        man_env['MPDMAN_LHS_IFHN']  = manEntryIfhn
-        man_env['MPDMAN_LHS_PORT'] = str(manEntryPort)
-        man_env['MPDMAN_MY_LISTEN_FD'] = str(manListenSock.fileno())
-        man_env['MPDMAN_MY_LISTEN_PORT'] = str(manListenPort)
-        mpd_print(mpd_dbg_level,"About to get sockpair for mpdman")
-        (toManSock,toMpdSock) = mpd_sockpair()
-        mpd_print(mpd_dbg_level,"Found sockpair (%d,%d) for mpdman" % \
-                                (toManSock.fileno(), toMpdSock.fileno()) )
-        toManSock.name = 'to_man'
-        toMpdSock.name = 'to_mpd'  ## to be used by mpdman below
-        man_env['MPDMAN_TO_MPD_FD'] = str(toMpdSock.fileno())
-        self.streamHandler.set_handler(toManSock,self.handle_man_input)
-        msg['entry_host'] = self.myHost
-        msg['entry_ifhn'] = self.myIfhn
-        msg['entry_port'] = manListenPort
-        maxTries = 6
-        numTries = 0
-        while numTries < maxTries:
-            try:
-                manPid = os.fork()
-                errinfo = 0
-            except OSError, errinfo:
-                pass  ## could check for errinfo.errno == 35 (resource unavailable)
-            if errinfo:
-                sleep(1)
-                numTries += 1
-            else:
-                break
-        if numTries >= maxTries:
-            return (0,0)
-        if manPid == 0:
-            self.conListenSock = 0    # don't want to clean up console if I am manager
-            self.myId = '%s_man_%d' % (self.myHost,self.myPid)
-            mpd_set_my_id(self.myId)
-            self.streamHandler.close_all_active_streams()
-            os.setpgrp()
-            os.environ = man_env
-            if hasattr(os,'getuid')  and  os.getuid() == 0  and  pwd_module_available:
-		username = msg['username']
-                try:
-                    pwent = pwd.getpwnam(username)
-                except:
-                    mpd_print(1,'invalid username :%s: on %s' % (username,self.myHost))
-                    msgToSend = {'cmd' : 'job_failed', 'reason' : 'invalid_username',
-                                 'username' : username, 'host' : self.myHost }
-                    self.conSock.send_dict_msg(msgToSend)
-                    return
-                uid = pwent[2]
-                gid = pwent[3]
-                os.setgroups(mpd_get_groups_for_username(username))
-                os.setregid(gid,gid)
-                try:
-                    os.setreuid(uid,uid)
-                except OSError, errmsg1:
-                    try:
-                        os.setuid(uid)
-                    except OSError, errmsg2:
-                        mpd_print(1,"unable to perform setreuid or setuid")
-                        sys.exit(-1)
-            import atexit    # need to use full name of _exithandlers
-            atexit._exithandlers = []    # un-register handlers in atexit module
-            # import profile
-            # print 'profiling the manager'
-            # profile.run('mpdman()')
-            mpdman = MPDMan()
-            mpdman.run()
-            sys.exit(0)  # do NOT do cleanup (eliminated atexit handlers above)
-        # After the fork, if we're the parent, close the other side of the
-        # mpdpair sockets, as well as the listener socket
-        manListenSock.close()
-        toMpdSock.close()
-        return (manPid,toManSock)
-    def launch_mpdman_via_subprocess(self,msg,man_env):
-        man_env['MPDMAN_HOW_LAUNCHED'] = 'SUBPROCESS'
-        currRank = int(man_env['MPDMAN_RANK'])
-        if msg['nstarted'] == 0:
-            manEntryIfhn = ''
-            manEntryPort = 0
-        else:
-            manEntryIfhn = msg['entry_ifhn']
-            manEntryPort = msg['entry_port']
-            man_env['MPDMAN_POS0_IFHN'] = msg['pos0_ifhn']
-            man_env['MPDMAN_POS0_PORT'] = msg['pos0_port']
-        man_env['MPDMAN_LHS_IFHN']  = manEntryIfhn
-        man_env['MPDMAN_LHS_PORT'] = str(manEntryPort)
-        tempListenSock = MPDListenSock()
-        man_env['MPDMAN_MPD_PORT'] = str(tempListenSock.getsockname()[1])
-        # python_executable = '\Python24\python.exe'
-        python_executable = 'python2.4'
-        fullDirName = man_env['MPDMAN_FULLPATHDIR']
-        manCmd = os.path.join(fullDirName,'mpdman.py')
-        runner = subprocess.Popen([python_executable,'-u',manCmd],  # only one 'python' arg
-                                  bufsize=0,
-                                  env=man_env,
-                                  close_fds=False)
-                                  ### stdin=subprocess.PIPE,stdout=subprocess.PIPE,
-                                  ### stderr=subprocess.PIPE)
-        manPid = runner.pid
-        oldTimeout = socket.getdefaulttimeout()
-        socket.setdefaulttimeout(8)
-        try:
-            (toManSock,toManAddr) = tempListenSock.accept()
-        except Exception, errmsg:
-            toManSock = 0
-        socket.setdefaulttimeout(oldTimeout)
-        tempListenSock.close()
-        if not toManSock:
-            mpd_print(1,'failed to recv msg from launched man')
-            return (0,0)
-        msgFromMan = toManSock.recv_dict_msg()
-        if not msgFromMan  or  not msgFromMan.has_key('man_listen_port'):
-            toManSock.close()
-            mpd_print(1,'invalid msg from launched man')
-            return (0,0)
-        manListenPort = msgFromMan['man_listen_port']
-        if currRank == 0:
-            msg['pos0_host'] = self.myHost
-            msg['pos0_ifhn'] = self.myIfhn
-            msg['pos0_port'] = str(manListenPort)
-        msg['entry_host'] = self.myHost
-        msg['entry_ifhn'] = self.myIfhn
-        msg['entry_port'] = manListenPort
-        return (manPid,toManSock)
-
-# code for testing
-if __name__ == '__main__':
-    mpd = MPD()
-    mpd.run()
diff --git a/src/pm/mpd/mpdallexit.py b/src/pm/mpd/mpdallexit.py
deleted file mode 100755
index d202dfd..0000000
--- a/src/pm/mpd/mpdallexit.py
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/usr/bin/env python
-#
-#   (C) 2001 by Argonne National Laboratory.
-#       See COPYRIGHT in top-level directory.
-#
-
-"""
-usage: mpdallexit (no args)
-causes all mpds in the ring to exit
-"""
-from time import ctime
-__author__ = "Ralph Butler and Rusty Lusk"
-__date__ = ctime()
-__version__ = "$Revision: 1.19 $"
-__credits__ = ""
-
-
-import sys, os
-
-from mpdlib import mpd_set_my_id, mpd_get_my_username, mpd_uncaught_except_tb, \
-                   mpd_print, MPDConClientSock, MPDParmDB
-
-
-def mpdallexit():
-    import sys    # to get access to excepthook in next line
-    sys.excepthook = mpd_uncaught_except_tb
-    if len(sys.argv) > 1  and  (sys.argv[1] == '-h'  or  sys.argv[1] == '--help') :
-        print __doc__
-        sys.exit(-1)
-    mpd_set_my_id(myid='mpdallexit')
-
-    parmdb = MPDParmDB(orderedSources=['cmdline','xml','env','rcfile','thispgm'])
-    parmsToOverride = {
-                        'MPD_USE_ROOT_MPD'            :  0,
-                        'MPD_SECRETWORD'              :  '',
-                      }
-    for (k,v) in parmsToOverride.items():
-        parmdb[('thispgm',k)] = v
-    parmdb.get_parms_from_env(parmsToOverride)
-    parmdb.get_parms_from_rcfile(parmsToOverride)
-    if (hasattr(os,'getuid')  and  os.getuid() == 0)  or  parmdb['MPD_USE_ROOT_MPD']:
-        fullDirName = os.path.abspath(os.path.split(sys.argv[0])[0])  # normalize
-        mpdroot = os.path.join(fullDirName,'mpdroot')
-        conSock = MPDConClientSock(mpdroot=mpdroot,secretword=parmdb['MPD_SECRETWORD'])
-    else:
-        conSock = MPDConClientSock(secretword=parmdb['MPD_SECRETWORD'])
-
-    msgToSend = { 'cmd' : 'mpdallexit' }
-    conSock.send_dict_msg(msgToSend)
-    msg = conSock.recv_dict_msg(timeout=8.0)
-    if not msg:
-        mpd_print(1,'no msg recvd from mpd before timeout')
-    elif msg['cmd'] != 'mpdallexit_ack':
-        mpd_print(1,'unexpected msg from mpd :%s:' % (msg) )
-        sys.exit(-1)
-    conSock.close()
-
-if __name__ == '__main__':
-    mpdallexit()
diff --git a/src/pm/mpd/mpdboot.py b/src/pm/mpd/mpdboot.py
deleted file mode 100755
index 7ee6eda..0000000
--- a/src/pm/mpd/mpdboot.py
+++ /dev/null
@@ -1,482 +0,0 @@
-#!/usr/bin/env python
-#
-#   (C) 2001 by Argonne National Laboratory.
-#       See COPYRIGHT in top-level directory.
-#
-
-"""
-usage:  mpdboot --totalnum=<n_to_start> [--file=<hostsfile>]  [--help]        \ 
-                [--rsh=<rshcmd>] [--user=<user>] [--mpd=<mpdcmd>]             \ 
-                [--loccons] [--remcons] [--shell] [--verbose] [-1]            \ 
-                [--ncpus=<ncpus>] [--ifhn=<ifhn>] [--chkup] [--chkuponly]     \ 
-                [--maxbranch=<maxbranch>]
- or, in short form, 
-        mpdboot -n n_to_start [-f <hostsfile>] [-h] [-r <rshcmd>] [-u <user>] \ 
-                [-m <mpdcmd>]  -s -v [-1] [-c]
-
---totalnum specifies the total number of mpds to start; at least
-  one mpd will be started locally, and others on the machines specified
-  by the file argument; by default, only one mpd per host will be
-  started even if the hostname occurs multiple times in the hosts file
--1 means remove the restriction of starting only one mpd per machine; 
-  in this case, at most the first mpd on a host will have a console
---file specifies the file of machines to start the rest of the mpds on;
-  it defaults to mpd.hosts
---mpd specifies the full path name of mpd on the remote hosts if it is
-  not in your path
---rsh specifies the name of the command used to start remote mpds; it
-  defaults to ssh; an alternative is rsh
---shell says that the Bourne shell is your default for rsh' 
---verbose shows the ssh attempts as they occur; it does not provide
-  confirmation that the sshs were successful
---loccons says you do not want a console available on local mpd(s)
---remcons says you do not want consoles available on remote mpd(s)
---ncpus indicates how many cpus you want to show for the local machine;
-  others are listed in the hosts file
---ifhn indicates the interface hostname to use for the local mpd; others
-  may be specified in the hostsfile
---chkup requests that mpdboot try to verify that the hosts in the host file
-  are up before attempting start mpds on any of them; it just checks the number
-  of hosts specified by -n
---chkuponly requests that mpdboot try to verify that the hosts in the host file
-  are up; it then terminates; it just checks the number of hosts specified by -n
---maxbranch indicates the maximum number of mpds to enter the ring under another;
-  the default is 4
-"""
-
-# workaround to suppress deprecated module warnings in python2.6
-# see https://trac.mpich.org/projects/mpich/ticket/362 for tracking
-import warnings
-warnings.filterwarnings('ignore', '.*the popen2 module is deprecated.*', DeprecationWarning)
-
-from time import ctime
-__author__ = "Ralph Butler and Rusty Lusk"
-__date__ = ctime()
-__version__ = "$Revision: 1.49 $"
-__credits__ = ""
-
-import re
-
-from os       import environ, path, kill, access, X_OK
-from sys      import argv, exit, stdout
-from popen2   import Popen4, Popen3, popen2
-from socket   import gethostname, gethostbyname_ex
-from select   import select, error
-from signal   import SIGKILL
-from commands import getoutput, getstatusoutput
-from mpdlib   import mpd_set_my_id, mpd_get_my_username, mpd_same_ips, \
-                     mpd_get_ranks_in_binary_tree, mpd_print, MPDSock, MPDParmDB
-
-global myHost, fullDirName, rshCmd, user, mpdCmd, debug, verbose
-
-def mpdboot():
-    global myHost, fullDirName, rshCmd, user, mpdCmd, debug, verbose
-    myHost = gethostname()
-    mpd_set_my_id('mpdboot_%s' % (myHost) )
-    fullDirName  = path.abspath(path.split(argv[0])[0])
-    rshCmd = 'ssh'
-    user = mpd_get_my_username()
-    mpdCmd = path.join(fullDirName,'mpd.py')
-    hostsFilename = 'mpd.hosts'
-    totalnumToStart = 1    # may get chgd below
-    debug = 0
-    verbose = 0
-    localConArg  = ''
-    remoteConArg = ''
-    oneMPDPerHost = 1
-    myNcpus = 1
-    myIfhn = ''
-    chkupIndicator = 0  # 1 -> chk and start ; 2 -> just chk
-    maxUnderOneRoot = 4
-    try:
-        shell = path.split(environ['SHELL'])[-1]
-    except:
-        shell = 'csh'
-
-    argidx = 1    # skip arg 0
-    while argidx < len(argv):
-        if   argv[argidx] == '-h' or argv[argidx] == '--help':
-            usage()
-        elif argv[argidx] == '-r':    # or --rsh=
-            rshCmd = argv[argidx+1]
-            argidx += 2
-        elif argv[argidx].startswith('--rsh'):
-            splitArg = argv[argidx].split('=')
-            try:
-                rshCmd = splitArg[1]
-            except:
-                print 'mpdboot: invalid argument:', argv[argidx]
-                usage()
-            argidx += 1
-        elif argv[argidx] == '-u':    # or --user=
-            user = argv[argidx+1]
-            argidx += 2
-        elif argv[argidx].startswith('--user'):
-            splitArg = argv[argidx].split('=')
-            try:
-                user = splitArg[1]
-            except:
-                print 'mpdboot: invalid argument:', argv[argidx]
-                usage()
-            argidx += 1
-        elif argv[argidx] == '-m':    # or --mpd=
-            mpdCmd = argv[argidx+1]
-            argidx += 2
-        elif argv[argidx].startswith('--mpd'):
-            splitArg = argv[argidx].split('=')
-            try:
-                mpdCmd = splitArg[1]
-            except:
-                print 'mpdboot: invalid argument:', argv[argidx]
-                usage()
-            argidx += 1
-        elif argv[argidx] == '-f':    # or --file=
-            hostsFilename = argv[argidx+1]
-            argidx += 2
-        elif argv[argidx].startswith('--file'):
-            splitArg = argv[argidx].split('=')
-            try:
-                hostsFilename = splitArg[1]
-            except:
-                print 'mpdboot: invalid argument:', argv[argidx]
-                usage()
-            argidx += 1
-        elif argv[argidx].startswith('--ncpus'):
-            splitArg = argv[argidx].split('=')
-            try:
-                myNcpus = int(splitArg[1])
-            except:
-                print 'mpdboot: invalid argument:', argv[argidx]
-                usage()
-            argidx += 1
-        elif argv[argidx].startswith('--ifhn'):
-            splitArg = argv[argidx].split('=')
-            myIfhn = splitArg[1]
-            myHost = splitArg[1]
-            argidx += 1
-        elif argv[argidx] == '-n':    # or --totalnum=
-            totalnumToStart = int(argv[argidx+1])
-            argidx += 2
-        elif argv[argidx].startswith('--totalnum'):
-            splitArg = argv[argidx].split('=')
-            try:
-                totalnumToStart = int(splitArg[1])
-            except:
-                print 'mpdboot: invalid argument:', argv[argidx]
-                usage()
-            argidx += 1
-        elif argv[argidx].startswith('--maxbranch'):
-            splitArg = argv[argidx].split('=')
-            try:
-                maxUnderOneRoot = int(splitArg[1])
-            except:
-                print 'mpdboot: invalid argument:', argv[argidx]
-                usage()
-            argidx += 1
-        elif argv[argidx] == '-d' or argv[argidx] == '--debug':
-            debug = 1
-            argidx += 1
-        elif argv[argidx] == '-s' or argv[argidx] == '--shell':
-            shell = 'bourne'
-            argidx += 1
-        elif argv[argidx] == '-v' or argv[argidx] == '--verbose':
-            verbose = 1
-            argidx += 1
-        elif argv[argidx] == '-c' or argv[argidx] == '--chkup':
-            chkupIndicator = 1
-            argidx += 1
-        elif argv[argidx] == '--chkuponly':
-            chkupIndicator = 2
-            argidx += 1
-        elif argv[argidx] == '-1':
-            oneMPDPerHost = 0
-            argidx += 1
-        elif argv[argidx] == '--loccons':
-            localConArg  = '-n'
-            argidx += 1
-        elif argv[argidx] == '--remcons':
-            remoteConArg = '-n'
-            argidx += 1
-        else:
-            print 'mpdboot: unrecognized argument:', argv[argidx]
-            usage()
-
-    # Fix for tt#662, make sure the config file is available to avoid some very
-    # confusing error messages.  We don't actually need these values here.
-    parmdb = MPDParmDB()
-    parmdb.get_parms_from_rcfile(parmsToOverride={}, errIfMissingFile=1)
-
-    if debug:
-        print 'debug: starting'
-
-    lines = []
-    if totalnumToStart > 1:
-        try:
-            f = open(hostsFilename,'r')
-            for line in f:
-                lines.append(line)
-        except:
-            print 'unable to open (or read) hostsfile %s' % (hostsFilename)
-            exit(-1)
-    hostsAndInfo = [ {'host' : myHost, 'ncpus' : myNcpus, 'ifhn' : myIfhn} ]
-    for line in lines:
-        line = line.strip()
-        if not line  or  line[0] == '#':
-            continue
-        splitLine = re.split(r'\s+',line)
-        host = splitLine[0]
-        ncpus = 1  # default
-        if ':' in host:
-            (host,ncpus) = host.split(':',1)
-            ncpus = int(ncpus)
-        ifhn = ''  # default
-        for kv in splitLine[1:]:
-            (k,v) = kv.split('=',1)
-            if k == 'ifhn':
-                ifhn = v
-        hostsAndInfo.append( {'host' : host, 'ncpus' : ncpus, 'ifhn' : ifhn} )
-    cachedIPs = {}
-    if oneMPDPerHost  and  totalnumToStart > 1:
-        oldHostsAndInfo = hostsAndInfo[:]
-        hostsAndInfo = []
-        for hostAndInfo in oldHostsAndInfo:
-            oldhost = hostAndInfo['host']
-            try:
-                ips = gethostbyname_ex(oldhost)[2]    # may fail if invalid host
-            except:
-                print 'unable to obtain IP for host:', oldhost
-                continue
-            uips = {}    # unique ips
-            for ip in ips:
-                uips[ip] = 1
-            keep = 1
-            for ip in uips.keys():
-                if cachedIPs.has_key(ip):
-                    keep = 0
-                    break
-            if keep:
-                hostsAndInfo.append(hostAndInfo)
-                cachedIPs.update(uips)
-    if len(hostsAndInfo) < totalnumToStart:    # one is local
-        print 'totalnum=%d  numhosts=%d' % (totalnumToStart,len(hostsAndInfo))
-        print 'there are not enough hosts on which to start all processes'
-        exit(-1)
-    if chkupIndicator:
-        hostsToCheck = [ hai['host'] for hai in hostsAndInfo[1:totalnumToStart] ]
-        (upList,dnList) = chkupdn(hostsToCheck)
-        if dnList:
-            print "these hosts are down; exiting"
-            print dnList
-            exit(-1)
-        print "there are %d hosts up (counting local)" % (len(upList)+1)
-        if chkupIndicator == 2:  # do the chkup and quit
-            exit(0)
-
-    try:
-        # stop current (if any) mpds; ignore the output
-        getoutput('%s/mpdallexit.py' % (fullDirName))
-        if verbose or debug:
-            print 'running mpdallexit on %s' % (myHost)
-    except:
-        pass
-
-    if environ.has_key('MPD_TMPDIR'):
-        tmpdir = environ['MPD_TMPDIR']
-    else:
-        tmpdir = ''
-    if myIfhn:
-        ifhn = '--ifhn=%s' % (myIfhn)
-    else:
-        ifhn = ''
-    hostsAndInfo[0]['entry_host'] = ''
-    hostsAndInfo[0]['entry_port'] = ''
-    mpdArgs = '%s %s --ncpus=%d' % (localConArg,ifhn,myNcpus)
-    if tmpdir:
-        mpdArgs += ' --tmpdir=%s' % (tmpdir)
-    (mpdPID,mpdFD) = launch_one_mpd(0,0,mpdArgs,hostsAndInfo)
-    fd2idx = {mpdFD : 0}
-
-    handle_mpd_output(mpdFD,fd2idx,hostsAndInfo)
-
-    try:
-        from os import sysconf
-        maxfds = sysconf('SC_OPEN_MAX')
-    except:
-        maxfds = 1024
-    maxAtOnce = min(128,maxfds-8)  # -8  for stdeout, etc. + a few more for padding
-
-    hostsSeen = { myHost : 1 }
-    fdsToSelect = []
-    numStarted = 1  # local already going
-    numStarting = 0
-    numUnderCurrRoot = 0
-    possRoots = []
-    currRoot = 0
-    idxToStart = 1  # local mpd already going
-    while numStarted < totalnumToStart:
-        if  numStarting < maxAtOnce  and  idxToStart < totalnumToStart:
-            if numUnderCurrRoot < maxUnderOneRoot:
-                entryHost = hostsAndInfo[currRoot]['host']
-                entryPort = hostsAndInfo[currRoot]['list_port']
-                hostsAndInfo[idxToStart]['entry_host'] = entryHost
-                hostsAndInfo[idxToStart]['entry_port'] = entryPort
-                if hostsSeen.has_key(hostsAndInfo[idxToStart]['host']):
-                    remoteConArg = '-n'
-                myNcpus = hostsAndInfo[idxToStart]['ncpus']
-                ifhn = hostsAndInfo[idxToStart]['ifhn']
-                if ifhn:
-                    ifhn = '--ifhn=%s' % (ifhn)
-                mpdArgs = '%s -h %s -p %s %s --ncpus=%d' % (remoteConArg,entryHost,entryPort,ifhn,myNcpus)
-                if tmpdir:
-                    mpdArgs += ' --tmpdir=%s' % (tmpdir)
-                (mpdPID,mpdFD) = launch_one_mpd(idxToStart,currRoot,mpdArgs,hostsAndInfo)
-                numStarting += 1
-                numUnderCurrRoot += 1
-                hostsAndInfo[idxToStart]['pid'] = mpdPID
-                hostsSeen[hostsAndInfo[idxToStart]['host']] = 1
-                fd2idx[mpdFD] = idxToStart
-                fdsToSelect.append(mpdFD)
-                idxToStart += 1
-            else:
-                if possRoots:
-                    currRoot = possRoots.pop()
-                    numUnderCurrRoot = 0
-            selectTime = 0.01
-        else:
-            selectTime = 0.1
-        try:
-            (readyFDs,unused1,unused2) = select(fdsToSelect,[],[],selectTime)
-        except error, errmsg:
-            mpd_print(1,'mpdboot: select failed: errmsg=:%s:' % (errmsg) )
-            exit(-1)
-        for fd in readyFDs:
-            handle_mpd_output(fd,fd2idx,hostsAndInfo)
-            numStarted += 1
-            numStarting -= 1
-            possRoots.append(fd2idx[fd])
-            fdsToSelect.remove(fd)
-            fd.close()
-
-def launch_one_mpd(idxToStart,currRoot,mpdArgs,hostsAndInfo):
-    global myHost, fullDirName, rshCmd, user, mpdCmd, debug, verbose
-    mpdHost = hostsAndInfo[idxToStart]['host']
-    if idxToStart == 0:
-        cmd = '%s %s -e -d' % (mpdCmd,mpdArgs)
-    else:
-        if rshCmd == 'ssh':
-            rshArgs = '-x -n -q'
-        else:
-            rshArgs = '-n'
-        mpdHost = hostsAndInfo[idxToStart]['host']
-        cmd = "%s %s %s '%s %s -e -d' " % \
-              (rshCmd,rshArgs,mpdHost,mpdCmd,mpdArgs)
-    if verbose:
-        entryHost = hostsAndInfo[idxToStart]['entry_host']
-        entryPort = hostsAndInfo[idxToStart]['entry_port']
-        # print "LAUNCHED mpd on %s  via  %s  %s" % (mpdHost,entryHost,str(entryPort))
-        print "LAUNCHED mpd on %s  via  %s" % (mpdHost,entryHost)
-    if debug:
-        print "debug: launch cmd=", cmd
-    mpd = Popen4(cmd,0)
-    mpdFD = mpd.fromchild
-    mpdPID = mpd.pid
-    return (mpdPID,mpdFD)
-
-def handle_mpd_output(fd,fd2idx,hostsAndInfo):
-    global myHost, fullDirName, rshCmd, user, mpdCmd, debug, verbose
-    idx = fd2idx[fd]
-    host = hostsAndInfo[idx]['host']
-    # port = fd.readline().strip()
-    port = 'no_port'
-    for line in fd.readlines():    # handle output from shells that echo stuff
-        line = line.strip()
-        splitLine = line.split('=')
-        if splitLine[0] == 'mpd_port':
-            port = splitLine[1]
-            break
-    if debug:
-        print "debug: mpd on %s  on port %s" % (host,port)
-    if port.isdigit():
-        hostsAndInfo[idx]['list_port'] = int(port)
-        tempSock = MPDSock(name='temp_to_mpd')
-        try:
-            tempSock.connect((host,int(port)))
-        except:
-            tempSock.close()
-            tempSock = 0
-        if tempSock:
-            msgToSend = { 'cmd' : 'ping', 'ifhn' : 'dummy', 'port' : 0}
-            tempSock.send_dict_msg(msgToSend)
-            msg = tempSock.recv_dict_msg()    # RMB: WITH TIMEOUT ??
-            if not msg  or  not msg.has_key('cmd')  or  msg['cmd'] != 'challenge':
-                mpd_print(1,'failed to handshake with mpd on %s; recvd output=%s' % \
-                          (host,msg) )
-                tempOut = tempSock.recv(1000)
-                print tempOut
-                try: getoutput('%s/mpdallexit.py' % (fullDirName))
-                except: pass
-                exit(-1)
-            tempSock.close()
-        else:
-            mpd_print(1,'failed to connect to mpd on %s' % (host) )
-            try: getoutput('%s/mpdallexit.py' % (fullDirName))
-            except: pass
-            exit(-1)
-    else:
-        mpd_print(1,'from mpd on %s, invalid port info:' % (host) )
-        print port
-        print fd.read()
-        try: getoutput('%s/mpdallexit.py' % (fullDirName))
-        except: pass
-        exit(-1)
-    if verbose:
-        print "RUNNING: mpd on", hostsAndInfo[fd2idx[fd]]['host']
-    if debug:
-        print "debug: info for running mpd:", hostsAndInfo[fd2idx[fd]]
-
-def chkupdn(hostList):
-    upList = []
-    dnList = []
-    for hostname in hostList:
-        print 'checking', hostname
-        if rshCmd == 'ssh':
-            rshArgs = '-x -n'
-        else:
-            rshArgs = '-n'
-        cmd = "%s %s %s /bin/echo hello" % (rshCmd,rshArgs,hostname)
-        runner = Popen3(cmd,1,0)
-        runout = runner.fromchild
-        runerr = runner.childerr
-        runin  = runner.tochild
-        runpid = runner.pid
-        up = 0
-        try:
-            # (readyFDs,unused1,unused2) = select([runout,runerr],[],[],9)
-            (readyFDs,unused1,unused2) = select([runout],[],[],9)
-        except:
-            print 'select failed'
-            readyFDs = []
-        for fd in readyFDs:  # may have runout and runerr sometimes
-            line = fd.readline()
-            if line and line.startswith('hello'):
-                up = 1
-            else:
-                pass
-        if up:
-            upList.append(hostname)
-        else:
-            dnList.append(hostname)
-        try:
-            kill(runpid,SIGKILL)
-        except:
-            pass
-    return(upList,dnList)
-
-def usage():
-    print __doc__
-    stdout.flush()
-    exit(-1)
-
-    
-if __name__ == '__main__':
-    mpdboot()
diff --git a/src/pm/mpd/mpdcheck.py b/src/pm/mpd/mpdcheck.py
deleted file mode 100755
index d8d2136..0000000
--- a/src/pm/mpd/mpdcheck.py
+++ /dev/null
@@ -1,583 +0,0 @@
-#!/usr/bin/env python
-#
-#   (C) 2001 by Argonne National Laboratory.
-#       See COPYRIGHT in top-level directory.
-#
-
-"""
-mpdcheck
-
-This script is a work in progress and may change frequently as we work
-with users and gain additional insights into how to improve it.
-
-This script prints useful information about the host on which it runs.
-It is here to help us help users detect problems with configurations of
-their computers.  For example, some computers are configured to think
-of themselves simply as 'localhost' with 127.0.0.1 as the IP address.
-This might present problems if a process on that computer wishes to
-identify itself by host and port to a process on another computer.
-The process on the other computer would try to contact 'localhost'.
-
-If you are having problems running parallel jobs via mpd on one or more
-hosts, you might try running this script once on each of those hosts.
-
-Any output with *** at the beginning indicates a potential problem
-that you may have to resolve before being able to run parallel jobs
-via mpd.
-
-For help:
-    mpdcheck -h (or --help)
-        prints this message
-
-In the following modes, the -v (verbose) option provides info about what
-mpdcheck is doing; the -l (long messages) option causes long informational
-messages to print in situations where problems are spotted.
-
-The three major modes of operation for this program are:
-
-    mpdcheck
-        looks for config problems on 'this' host; prints as nec
-
-    mpdcheck -pc
-        print config info about 'this' host, e.g. contents of /etc/hosts, etc.
-
-    mpdcheck -f some_file [-ssh]
-        prints info about 'this' host and locatability info about the ones
-        listed in some_file as well (note the file might be mpd.hosts);
-        the -ssh option can be used in conjunction with the -f option to
-        cause ssh tests to be run to each remote host
-
-    mpdcheck -s
-        runs this program as a server on one host
-    mpdcheck -c server_host server_port
-        runs a client on another (or same) host; connects to the specifed
-        host/port where you previously started the server
-"""
-
-# workaround to suppress deprecated module warnings in python2.6
-# see https://trac.mpich.org/projects/mpich/ticket/362 for tracking
-import warnings
-warnings.filterwarnings('ignore', '.*the popen2 module is deprecated.*', DeprecationWarning)
-
-from time import ctime
-__author__ = "Ralph Butler and Rusty Lusk"
-__date__ = ctime()
-__version__ = "$Revision: 1.19 $"
-__credits__ = ""
-
-import re
-
-from  sys      import argv, exit, stdout
-from  os       import path, kill, system
-from  signal   import SIGKILL
-from  socket   import gethostname, getfqdn, gethostbyname_ex, gethostbyaddr, socket
-from  popen2   import Popen3
-from  select   import select, error
-from  commands import getoutput
-
-
-if __name__ == '__main__':    # so I can be imported by pydoc
-    do_ssh = 0
-    fullDirName = path.abspath(path.split(argv[0])[0])  # normalize
-    hostsFromFile = []
-    verbose = 0
-    long_messages = 0
-    argidx = 1
-    while argidx < len(argv):
-        if argv[argidx] == '-h'  or argv[argidx] == '--help':
-            print __doc__
-            exit(0)
-        elif argv[argidx] == '-s':
-            lsock = socket()
-            lsock.bind(('',0)) # anonymous port
-            lsock.listen(5)
-            print "server listening at INADDR_ANY on: %s %s" % (gethostname(),lsock.getsockname()[1])
-            stdout.flush()
-            (tsock,taddr) = lsock.accept()
-            print "server has conn on %s from %s" % (tsock,taddr)
-            msg = tsock.recv(64)
-            if not msg:
-                print "*** server failed to recv msg from client"
-            else:
-                print "server successfully recvd msg from client: %s" % (msg)
-            tsock.sendall('ack_from_server_to_client')
-            tsock.close()
-            lsock.close()
-            exit(0)
-        elif argv[argidx] == '-c':
-            sock = socket()
-            sock.connect((argv[argidx+1],int(argv[argidx+2])))  # note double parens
-            sock.sendall('hello_from_client_to_server')
-            msg = sock.recv(64)
-            if not msg:
-                print "*** client failed to recv ack from server"
-            else:
-                print "client successfully recvd ack from server: %s" % (msg)
-                stdout.flush()
-            sock.close()
-            exit(0)
-        elif argv[argidx] == '-pc':
-            print "--- print results of: gethostbyname_ex(gethostname())"
-            print gethostbyname_ex(gethostname())
-            print "--- try to run /bin/hostname"
-            linesAsStr = getoutput("/bin/hostname")
-            print linesAsStr
-            print "--- try to run uname -a"
-            linesAsStr = getoutput("/bin/uname -a")
-            print linesAsStr
-            print "--- try to print /etc/hosts"
-            linesAsStr = getoutput("/bin/cat /etc/hosts")
-            print linesAsStr
-            print "--- try to print /etc/resolv.conf"
-            linesAsStr = getoutput("/bin/cat /etc/resolv.conf")
-            print linesAsStr
-            print "--- try to run /sbin/ifconfig -a"
-            linesAsStr = getoutput("/sbin/ifconfig -a")
-            print linesAsStr
-            print "--- try to print /etc/nsswitch.conf"
-            linesAsStr = getoutput("/bin/cat /etc/nsswitch.conf")
-            print linesAsStr
-            exit(0)
-        elif argv[argidx] == '-v':
-            verbose = 1
-            argidx += 1
-        elif argv[argidx] == '-l':
-            long_messages = 1
-            argidx += 1
-        elif argv[argidx] == '-f':
-            try:
-                hostsFile = open(argv[argidx+1])
-            except:
-                print 'unable to open file ', argv[argidx+1]
-                exit(-1)
-            for line in hostsFile:
-                line = line.rstrip()
-                if not line  or  line[0] == '#':
-                    continue
-                splitLine = re.split(r'\s+',line)
-                host = splitLine[0]
-                if ':' in host:
-                    (host,ncpus) = host.split(':')
-                hostsFromFile.append(host)
-            argidx += 2
-        elif argv[argidx] == '-ssh':
-            do_ssh = 1
-            argidx += 1
-        else:
-            print 'unrecognized arg:', argv[argidx]
-            exit(0)
-    
-    
-    # See if we can do gethostXXX, etc. for this host
-    if verbose:
-        print 'obtaining hostname via gethostname and getfqdn'
-    uqhn1 = gethostname()
-    fqhn1 = getfqdn()
-    if verbose:
-        print "gethostname gives ", uqhn1
-        print "getfqdn gives ", fqhn1
-    if verbose:
-        print 'checking out unqualified hostname; make sure is not "localhost", etc.'
-    if uqhn1.startswith('localhost'):
-        if long_messages:
-            msg = """
-            **********
-            The unqualified hostname seems to be localhost. This generally
-            means that the machine's hostname is not set. You may change
-            it by using the 'hostname' command, e.g.:
-                hostname mybox1
-            However, this will not remain after a reboot. To do this, you
-            will need to consult the operating system's documentation. On
-            Debian Linux systems, this can be done by:
-                echo "mybox1" > /etc/hostname
-            **********
-            """
-        else:
-            msg = "*** the uq hostname seems to be localhost"
-        print msg.strip().replace('        ','')
-    elif uqhn1 == '':
-        if long_messages:
-            msg = """
-            **********
-            The unqualified hostname seems to be blank. This generally
-            means that the machine's hostname is not set. You may change
-            it by using the 'hostname' command, e.g.:
-                hostname mybox1
-            However, this will not remain after a reboot. To do this, you
-            will need to consult the operating system's documentation. On
-            Debian Linux systems, this can be done by:
-                echo "mybox1" > /etc/hostname
-            **********
-            """
-        else:
-            msg = "*** the uq hostname seems to be localhost"
-        print msg.replace('        ','')
-    if verbose:
-        print 'checking out qualified hostname; make sure is not "localhost", etc.'
-    if fqhn1.startswith('localhost'):
-        if long_messages:
-            msg = """
-            **********
-            Your fully qualified hostname seems to be set to 'localhost'.
-            This generally means that your machine's /etc/hosts file contains a line
-            similar to this:
-                127.0.0.1 mybox1 localhost.localdomain localhost
-            You probably want to remove your hostname from this line and place it on
-            a line by itself with your ipaddress, like this:
-                $ipaddr mybox1
-            **********
-            """
-        else:
-            msg =  "*** the fq hostname seems to be localhost"
-        print msg.rstrip().replace('        ','')
-    elif fqhn1 == '':
-        if long_messages:
-            msg = """
-            **********
-            Your fully qualified hostname seems to be blank.
-            **********
-            """
-        else:
-            msg = "*** the fq hostname is blank"
-        print msg.replace('        ','')
-    
-    if verbose:
-        print 'obtain IP addrs via qualified and unqualified hostnames;',
-        print ' make sure other than 127.0.0.1'
-    uipaddr1 = 0
-    try:
-        ghbnu = gethostbyname_ex(uqhn1)
-        if verbose:
-            print "gethostbyname_ex: ", ghbnu
-        uipaddr1 = ghbnu[2][0]
-        if uipaddr1.startswith('127'):
-            if long_messages:
-                msg = """
-                **********
-                Your unqualified hostname resolves to 127.0.0.1, which is
-                the IP address reserved for localhost. This likely means that
-                you have a line similar to this one in your /etc/hosts file:
-                127.0.0.1   $uqhn
-                This should perhaps be changed to the following:
-                127.0.0.1   localhost.localdomain localhost
-                **********
-                """
-            else:
-                msg = "*** first ipaddr for this host (via %s) is: %s" % (uqhn1,uipaddr1)
-            print msg.replace('            ','')
-        try:
-            ghbau = gethostbyaddr(uipaddr1)
-        except:
-            print "*** gethostbyaddr failed for this hosts's IP %s" % (uipaddr1)
-    except:
-        if long_messages:
-            msg = """
-            **********
-            The system call gethostbyname(3) failed to resolve your
-            unqualified hostname, or $uqhn. This can be caused by
-            missing info from your /etc/hosts file or your system not
-            having correctly configured name resolvers, or by your IP 
-            address not existing in resolution services.
-            If you run DNS, you may wish to make sure that your
-            DNS server has the correct forward A set up for your machine's
-            hostname. If you are not using DNS and are only using hosts
-            files, please check that a line similar to the one below exists
-            in your /etc/hosts file:
-                $ipaddr $uqdn
-            If you plan to use DNS but you are not sure that it is
-            correctly configured, please check that the file /etc/resolv.conf
-            contains entries similar to the following:
-                nameserver 1.2.3.4
-            where 1.2.3.4 is an actual IP of one of your nameservers.
-            **********
-            """
-        else:
-            msg = "*** gethostbyname_ex failed for this host %s" % (uqhn1)
-        print msg.replace('        ','')
-    
-    fipaddr1 = 0
-    try:
-        ghbnf = gethostbyname_ex(fqhn1)
-        if verbose:
-            print "gethostbyname_ex: ", ghbnf
-        fipaddr1 = ghbnf[2][0]
-        if fipaddr1.startswith('127'):
-            msg = """
-            **********
-            Your fully qualified hostname resolves to 127.0.0.1, which
-            is the IP address reserved for localhost. This likely means
-            that you have a line similar to this one in your /etc/hosts file:
-                 127.0.0.1   $fqhn
-            This should be perhaps changed to the following:
-                 127.0.0.1   localhost.localdomain localhost
-            **********
-            """
-        try:
-            ghbaf = gethostbyaddr(fipaddr1)
-        except:
-            print "*** gethostbyaddr failed for this hosts's IP %s" % (uipaddr1)
-    except:
-        if long_messages:
-            msg = """
-            **********
-            The system call gethostbyname(3) failed to resolve your
-            fully qualified hostname, or $fqhn. This can be caused by
-            missing info from your /etc/hosts file or your system not
-            having correctly configured name resolvers, or by your IP 
-            address not existing in resolution services.
-            If you run DNS, please check and make sure that your
-            DNS server has the correct forward A record set up for your
-            machine's hostname. If you are not using DNS and are only using
-            hosts files, please check that a line similar to the one below
-            exists in your /etc/hosts file:
-                $ipaddr $fqhn
-            If you intend to use DNS but you are not sure that it is
-            correctly configured, please check that the file /etc/resolv.conf
-            contains entries similar to the following:
-                nameserver 1.2.3.4
-            where 1.2.3.4 is an actual IP of one of your nameservers.
-            **********
-            """
-        else:
-            msg = "*** gethostbyname_ex failed for host %s" % (fqhn1)
-        print msg.replace('        ','')
-    
-    if verbose:
-        print 'checking that IP addrs resolve to same host'
-    if uipaddr1 and fipaddr1 and uipaddr1 != fipaddr1:
-        msg = """
-            **********
-            Your fully qualified and unqualified names do not resolve to
-            the same IP. This likely means that your DNS domain name is not
-            set correctly.  This might be fixed by adding a line similar
-            to the following to your /etc/hosts:
-                 $ipaddr             $fqhn   $uqdn
-            **********
-            """
-        print msg.replace('        ','')
-    
-    
-    if verbose:
-        print 'now do some gethostbyaddr and gethostbyname_ex for machines in hosts file'
-    # See if we can do gethostXXX, etc. for hosts in hostsFromFile
-    for host in hostsFromFile:
-        uqhn2 = host
-        fqhn2 = getfqdn(uqhn2)
-        uipaddr2 = 0
-        if verbose:
-            print 'checking gethostbyXXX for unqualified %s' % (uqhn2)
-        try:
-            ghbnu = gethostbyname_ex(uqhn2)
-            if verbose:
-                print "gethostbyname_ex: ", ghbnu
-            uipaddr2 = ghbnu[2][0]
-            try:
-                ghbau = gethostbyaddr(uipaddr2)
-            except:
-                print "*** gethostbyaddr failed for remote hosts's IP %s" % (fipaddr2)
-        except:
-            print "*** gethostbyname_ex failed for host %s" % (fqhn2)
-        if verbose:
-            print 'checking gethostbyXXX for qualified %s' % (uqhn2)
-        try:
-            ghbnf = gethostbyname_ex(fqhn2)
-            if verbose:
-                print "gethostbyname_ex: ", ghbnf
-            fipaddr2 = ghbnf[2][0]
-            if uipaddr2  and  fipaddr2 != uipaddr2:
-                print "*** ipaddr via uqn (%s) does not match via fqn (%s)" % (uipaddr2,fipaddr2)
-            try:
-                ghbaf = gethostbyaddr(fipaddr2)
-            except:
-                print "*** gethostbyaddr failed for remote hosts's IP %s" % (fipaddr2)
-        except:
-            print "*** gethostbyname_ex failed for host %s" % (fqhn2)
-    
-    
-    # see if we can run /bin/date on remote hosts
-    if not do_ssh:
-        exit(0)
-    
-    for host in hostsFromFile:
-        cmd = "ssh %s -x -n /bin/echo hello" % (host)
-        if verbose:
-            print 'trying: %s' % (cmd)
-        runner = Popen3(cmd,1,0)
-        runout = runner.fromchild
-        runerr = runner.childerr
-        runin  = runner.tochild
-        runpid = runner.pid
-        try:
-            (readyFDs,unused1,unused2) = select([runout],[],[],9)
-        except Exception, data:
-            print 'select 1 error: %s ; %s' % ( data.__class__, data)
-            exit(-1)
-        if len(readyFDs) == 0:
-            print '** ssh timed out to %s' % (host)
-        line = ''
-        failed = 0
-        if runout in readyFDs:
-            line = runout.readline()
-            if not line.startswith('hello'):
-                failed = 1
-        else:
-            failed = 1
-        if failed:
-            print '** ssh failed to %s' % (host)
-            print '** here is the output:'
-            if line:
-                print line,
-            done = 0
-            fds = [runout,runerr]
-            while not done:
-                try:
-                    (readyFDs,unused1,unused2) = select(fds,[],[],1)
-                except Exception, data:
-                    print 'select 2 error: %s ; %s' % ( data.__class__, data)
-                    exit(-1)
-                if runout in readyFDs:
-                    line = runout.readline()
-                    if line:
-                        print line,
-                    else:
-                        fds.remove(runout)
-                elif runerr in readyFDs:
-                    line = runerr.readline()
-                    if line:
-                        print line,
-                    else:
-                        fds.remove(runerr)
-                else:
-                    done = 1
-        try:
-            kill(runpid,SIGKILL)
-            runout.close()
-            runerr.close()
-            runin.close()
-        except:
-            pass
-        if failed:
-            exit(-1)
-    
-    # see if we can run mpdcheck on remote hosts
-    for host in hostsFromFile:
-        cmd1 = path.join(fullDirName,'mpdcheck.py') + ' -s'
-        if verbose:
-            print 'starting server: %s' % (cmd1)
-        runner1 = Popen3(cmd1,1,0)
-        runout1 = runner1.fromchild
-        runerr1 = runner1.childerr
-        runin1  = runner1.tochild
-        runpid1 = runner1.pid
-        try:
-            (readyFDs,unused1,unused2) = select([runout1],[],[],9)
-        except Exception, data:
-            print 'select 3 error: %s ; %s' % ( data.__class__, data)
-            exit(-1)
-        if len(readyFDs) == 0:
-            print '** timed out waiting for local server to produce output'
-        line = ''
-        failed = 0
-        port = 0
-        if runout1 in readyFDs:
-            line = runout1.readline()
-            if line.startswith('server listening at '):
-                port = line.rstrip().split(' ')[-1]
-            else:
-                failed = 1
-        else:
-            failed = 1
-        if failed:
-            print 'could not start mpdcheck server'
-            print 'here is the output:'
-            if line:
-                print line,
-            done = 0
-            fds = [runout1,runerr1]
-            while not done:
-                try:
-                    (readyFDs,unused1,unused2) = select(fds,[],[],1)
-                except Exception, data:
-                    print 'select 4 error: %s ; %s' % ( data.__class__, data)
-                    exit(-1)
-                if runout in readyFDs:
-                    line = runout.readline()
-                    if line:
-                        print line,
-                    else:
-                        fds.remove(runout)
-                elif runerr in readyFDs:
-                    line = runerr.readline()
-                    if line:
-                        print line,
-                    else:
-                        fds.remove(runerr)
-                else:
-                    done = 1
-        if failed:
-            try:
-                kill(runpid1,SIGKILL)
-            except:
-                pass
-            exit(-1)
-        cmd2 = "ssh %s -x -n %s%smpdcheck.py -c %s %s" % (host,fullDirName,path.sep,fqhn1,port)
-        if verbose:
-            print 'starting client: %s' % (cmd2)
-        runner2 = Popen3(cmd2,1,0)
-        runout2 = runner2.fromchild
-        runerr2 = runner2.childerr
-        runin2  = runner2.tochild
-        runpid2 = runner2.pid
-        try:
-            (readyFDs,unused1,unused2) = select([runout2],[],[],9)
-        except Exception, data:
-            print 'select 3 error: %s ; %s' % ( data.__class__, data)
-            exit(-1)
-        if len(readyFDs) == 0:
-            print '** timed out waiting for client on %s to produce output' % (host)
-        line = ''
-        failed = 0
-        port = 0
-        if runout2 in readyFDs:
-            line = runout2.readline()
-            if not line.startswith('client successfully recvd'):
-                failed = 1
-        else:
-            failed = 1
-        if failed:
-            print 'client on %s failed to access the server' % (host)
-            print 'here is the output:'
-            if line:
-                print line,
-            done = 0
-            fds = [runout2,runerr2]
-            while not done:
-                try:
-                    (readyFDs,unused1,unused2) = select(fds,[],[],1)
-                except Exception, data:
-                    print 'select 4 error: %s ; %s' % ( data.__class__, data)
-                    exit(-1)
-                if runout2 in readyFDs:
-                    line = runout2.readline()
-                    if line:
-                        print line,
-                    else:
-                        fds.remove(runout2)
-                elif runerr2 in readyFDs:
-                    line = runerr2.readline()
-                    if line:
-                        print line,
-                    else:
-                        fds.remove(runerr2)
-                else:
-                    done = 1
-        try:
-            kill(runpid2,SIGKILL)
-        except:
-            pass
-        if failed:
-            try:
-                kill(runpid1,SIGKILL)
-            except:
-                pass
-            exit(-1)
diff --git a/src/pm/mpd/mpdchkpyver.py b/src/pm/mpd/mpdchkpyver.py
deleted file mode 100644
index 773ba68..0000000
--- a/src/pm/mpd/mpdchkpyver.py
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/usr/bin/env python
-#
-#   (C) 2001 by Argonne National Laboratory.
-#       See COPYRIGHT in top-level directory.
-#
-
-"""
-This program is not to be executed from the command line.  It is 
-exec'd by mpdroot to verify the version of python before executing
-a 'regular' mpd pgm, e.g. mpdallexit.
-"""
-
-from sys import version, exit
-if version[0] == '1' and version[1] == '.':
-    print "mpdchkpyver: your python version must be >= 2.2 ;"
-    print "  current version is:", version
-    exit(-1)
-
-##  These must be after 1.x version check
-from time import ctime
-__author__ = "Ralph Butler and Rusty Lusk"
-__date__ = ctime()
-__version__ = "$Revision: 1.4 $"
-__credits__ = ""
-
-from sys     import argv, exit
-from os      import environ, execvpe
-from mpdlib  import mpd_check_python_version
-
-if __name__ == '__main__':
-    if len(argv) == 1  or  argv[1] == '-h'  or  argv[1] == '--help':
-        print __doc__
-	exit(-1)
-    else:
-        vinfo = mpd_check_python_version()
-        if vinfo:
-            print "mpdchkpyver: your python version must be >= 2.2 ; current version is:", vinfo
-            exit(-1)
-        if len(argv) > 1:
-            mpdpgm = argv[1] + '.py'
-            # print "CHKPYVER: PGM=:%s: ARGV[1:]=:%s:" % (mpdpgm,argv[1:])
-            try:
-                execvpe(mpdpgm,argv[1:],environ)    # client
-            except Exception, errinfo:
-                print 'mpdchkpyver: failed to exec %s; info=%s' % (mpdpgm,errinfo)
-                exit(-1)
diff --git a/src/pm/mpd/mpdcleanup.py b/src/pm/mpd/mpdcleanup.py
deleted file mode 100755
index ee92ba4..0000000
--- a/src/pm/mpd/mpdcleanup.py
+++ /dev/null
@@ -1,122 +0,0 @@
-#!/usr/bin/env python
-#
-#   (C) 2001 by Argonne National Laboratory.
-#       See COPYRIGHT in top-level directory.
-#
-
-## NOTE: we do NOT allow this pgm to run via mpdroot
-
-"""
-usage: mpdcleanup [-h] [-v] [-f <hostsfile>] [-r <rshcmd>] [-u <user>] [-c <cleancmd>] [-k 'killcmd'] [-n <num_from_hostsfile>]
-   or: mpdcleanup [--help] [--verbose] [--file=<hostsfile>] [--rsh=<rshcmd>] [--user=<user>]
-                  [--clean=<cleancmd>] [--kill="killcmd"]
-Removes the Unix socket on local (the default) and remote machines
-This is useful in case the mpd crashed badly and did not remove it, which it normally does
-"""
-from time import ctime
-__author__ = "Ralph Butler and Rusty Lusk"
-__date__ = ctime()
-__version__ = "$Revision: 1.11 $"
-__credits__ = ""
-
-
-import sys, os, socket
-
-from getopt import getopt
-from mpdlib import mpd_get_my_username, mpd_same_ips, mpd_set_tmpdir
-
-def mpdcleanup():
-    rshCmd    = 'ssh'
-    user      = mpd_get_my_username()
-    killCmd   = ''  # perhaps '~/bin/kj mpd'  (in quotes)
-    cleanCmd  = 'rm -f '
-    hostsFile = ''
-    verbose = 0
-    numFromHostsFile = 0  # chgd below
-    try:
-	(opts, args) = getopt(sys.argv[1:], 'hvf:r:u:c:k:n:',
-                              ['help', 'verbose', 'file=', 'rsh=', 'user=', 'clean=','kill='])
-    except:
-        print 'invalid arg(s) specified'
-	usage()
-    else:
-	for opt in opts:
-	    if opt[0] == '-r' or opt[0] == '--rsh':
-		rshCmd = opt[1]
-	    elif opt[0] == '-u' or opt[0] == '--user':
-		user   = opt[1]
-	    elif opt[0] == '-f' or opt[0] == '--file':
-		hostsFile = opt[1]
-	    elif opt[0] == '-h' or opt[0] == '--help':
-		usage()
-	    elif opt[0] == '-v' or opt[0] == '--verbose':
-		verbose = 1
-	    elif opt[0] == '-n':
-		numFromHostsFile = int(opt[1])
-	    elif opt[0] == '-c' or opt[0] == '--clean':
-		cleanCmd = opt[1]
-	    elif opt[0] == '-k' or opt[0] == '--kill':
-		killCmd = opt[1]
-    if args:
-        print 'invalid arg(s) specified: ' + ' '.join(args)
-	usage()
-
-    if os.environ.has_key('MPD_CON_EXT'):
-        conExt = '_' + os.environ['MPD_CON_EXT']
-    else:
-        conExt = ''
-    if os.environ.has_key('MPD_TMPDIR'):
-        tmpdir = os.environ['MPD_TMPDIR']
-    else:
-        tmpdir = '/tmp'
-    cleanFile = tmpdir + '/mpd2.console_' + user + conExt
-    if rshCmd == 'ssh':
-	xOpt = '-x'
-    else:
-	xOpt = ''
-    try: localIP = socket.gethostbyname_ex(socket.gethostname())[2]
-    except: localIP = 'unknownlocal'
-
-    if hostsFile:
-        try:
-	    f = open(hostsFile,'r')
-        except:
-	    print 'Not cleaning up on remote hosts; file %s not found' % hostsFile
-	    sys.exit(0)
-        hosts = f.readlines()
-        if numFromHostsFile:
-            hosts = hosts[0:numFromHostsFile]
-        for host in hosts:
-	    host = host.strip()
-	    if host[0] != '#':
-                try: remoteIP = socket.gethostbyname_ex(host)[2]
-                except: remoteIP = 'unknownremote'
-                if localIP == remoteIP:  # local machine handled last below loop
-                    continue
-	        cmd = '%s %s -n %s %s %s &' % (rshCmd, xOpt, host, cleanCmd, cleanFile)
-                if verbose:
-	            print 'cmd=:%s:' % (cmd)
-	        os.system(cmd)
-                if killCmd:
-	            cmd = "%s %s -n %s \"/bin/sh -c '%s' &\"" % (rshCmd, xOpt, host, killCmd)
-                    if verbose:
-	                print "cmd=:%s:" % (cmd)
-	            os.system(cmd)
-
-    ## clean up local machine last
-    cmd = '%s %s' % (cleanCmd,cleanFile)
-    if verbose:
-        print 'cmd=:%s:' % (cmd)
-    os.system(cmd)
-    if killCmd:
-        if verbose:
-            print 'cmd=:%s:' % (killCmd)
-        os.system(killCmd)
-
-def usage():
-    print __doc__
-    sys.exit(-1)
-
-
-if __name__ == '__main__':
-    mpdcleanup()
diff --git a/src/pm/mpd/mpdexit.py b/src/pm/mpd/mpdexit.py
deleted file mode 100755
index 2d97e20..0000000
--- a/src/pm/mpd/mpdexit.py
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/usr/bin/env python
-#
-#   (C) 2001 by Argonne National Laboratory.
-#       See COPYRIGHT in top-level directory.
-#
-
-"""
-usage: mpdexit mpdid
-    mpdid may be obtained via mpdtrace -l (or may be "localmpd")
-Causes a single mpd to exit (and thus exit the ring).
-Note that this may cause other mpds to become 'isolated' if they
-entered the ring through the exiting one.
-"""
-from time import ctime
-__author__ = "Ralph Butler and Rusty Lusk"
-__date__ = ctime()
-__version__ = "$Revision: 1.15 $"
-__credits__ = ""
-
-
-import sys, os, signal
-
-from  mpdlib  import  mpd_set_my_id, mpd_uncaught_except_tb, mpd_print, \
-                      mpd_handle_signal, mpd_get_my_username, \
-                      MPDConClientSock, MPDParmDB
-
-def mpdexit():
-    import sys    # to get access to excepthook in next line
-    sys.excepthook = mpd_uncaught_except_tb
-    if (len(sys.argv) > 1  and  (sys.argv[1] == '-h'  or  sys.argv[1] == '--help')) or \
-       (len(sys.argv) < 2):
-	print __doc__
-        sys.exit(-1)
-    signal.signal(signal.SIGINT, sig_handler)
-    mpd_set_my_id(myid='mpdexit')
-
-    parmdb = MPDParmDB(orderedSources=['cmdline','xml','env','rcfile','thispgm'])
-    parmsToOverride = {
-                        'MPD_USE_ROOT_MPD'            :  0,
-                        'MPD_SECRETWORD'              :  '',
-                      }
-    for (k,v) in parmsToOverride.items():
-        parmdb[('thispgm',k)] = v
-    parmdb.get_parms_from_env(parmsToOverride)
-    parmdb.get_parms_from_rcfile(parmsToOverride)
-    if (hasattr(os,'getuid')  and  os.getuid() == 0)  or  parmdb['MPD_USE_ROOT_MPD']:
-        fullDirName = os.path.abspath(os.path.split(sys.argv[0])[0])  # normalize
-        mpdroot = os.path.join(fullDirName,'mpdroot')
-        conSock = MPDConClientSock(mpdroot=mpdroot,secretword=parmdb['MPD_SECRETWORD'])
-    else:
-        conSock = MPDConClientSock(secretword=parmdb['MPD_SECRETWORD'])
-
-    msgToSend = { 'cmd' : 'mpdexit', 'mpdid' : sys.argv[1] }
-    conSock.send_dict_msg(msgToSend)
-    msg = conSock.recv_dict_msg(timeout=5.0)
-    if not msg:
-        mpd_print(1,'no msg recvd from mpd before timeout')
-        sys.exit(-1)
-    elif msg['cmd'] == 'already_have_a_console':
-        mpd_print(1,'mpd already has a console (e.g. for long ringtest); try later')
-        sys.exit(-1)
-    if not msg.has_key('cmd'):
-        mpd_print(1,'mpdexit: INVALID msg=:%s:' % (msg))
-        sys.exit(-1)
-    if msg['cmd'] != 'mpdexit_ack':
-        mpd_print(1,'mpdexit failed; may have wrong mpdid')
-        sys.exit(-1)
-
-def sig_handler(signum,frame):
-    mpd_handle_signal(signum,frame)  # not nec since I exit next
-    sys.exit(-1)
-
-def usage():
-    print __doc__
-    sys.exit(-1)
-
-if __name__ == '__main__':
-    mpdexit()
diff --git a/src/pm/mpd/mpdgdbdrv.py b/src/pm/mpd/mpdgdbdrv.py
deleted file mode 100755
index e4bf3d9..0000000
--- a/src/pm/mpd/mpdgdbdrv.py
+++ /dev/null
@@ -1,232 +0,0 @@
-#!/usr/bin/env python
-#
-#   (C) 2001 by Argonne National Laboratory.
-#       See COPYRIGHT in top-level directory.
-#
-
-"""
-This program is not to be executed from the command line.  It is 
-exec'd by mpdman to support mpigdb.
-"""
-
-# workaround to suppress deprecated module warnings in python2.6
-# see https://trac.mpich.org/projects/mpich/ticket/362 for tracking
-import warnings
-warnings.filterwarnings('ignore', '.*the popen2 module is deprecated.*', DeprecationWarning)
-
-from time import ctime
-__author__ = "Ralph Butler and Rusty Lusk"
-__date__ = ctime()
-__version__ = "$Revision: 1.17 $"
-__credits__ = ""
-
-
-from sys    import argv, exit, stdin, stdout, stderr
-from os     import kill, getpid, write, strerror
-from popen2 import Popen4
-from signal import signal, SIGUSR1, SIGINT, SIGKILL
-from errno  import EINTR
-from select import select, error
-from re     import findall, sub
-from mpdlib import mpd_set_my_id, mpd_print
-
-global appPid, gdbPID
-
-
-def sig_handler(signum,frame):
-    global appPid, gdbPID
-    if signum == SIGINT:
-        try:
-            kill(appPid,SIGINT)
-        except:
-            pass
-    elif signum == SIGUSR1:
-        try:
-            kill(gdbPid,SIGKILL)
-        except:
-            pass
-        try:
-            kill(appPid,SIGKILL)
-        except:
-            pass
-
-
-if __name__ == '__main__':    # so I can be imported by pydoc
-    signal(SIGINT,sig_handler)
-    signal(SIGUSR1,sig_handler)
-    mpd_set_my_id('mpdgdbdrv')
-    
-    ## mpd_print(1,"RMB:GDBDRV: ARGS=%s" % argv)
-    if argv[1] == '-attach':
-        gdb_args = '%s %s' % (argv[2],argv[3])  # userpgm and userpid
-    else:
-        if len(argv) > 2:
-            mpd_print(1, "when using gdb, pass cmd-line args to user pgms via the 'run' cmd")
-            exit(-1)
-        gdb_args = argv[1]
-    gdb_info = Popen4('gdb -q %s' % (gdb_args), 0 )
-    gdbPid = gdb_info.pid
-    # print "PID=%d GDBPID=%d" % (getpid(),gdbPid) ; stdout.flush()
-    gdb_sin = gdb_info.tochild
-    gdb_sin_fileno = gdb_sin.fileno()
-    gdb_sout_serr = gdb_info.fromchild
-    gdb_sout_serr_fileno = gdb_sout_serr.fileno()
-    write(gdb_sin_fileno,'set prompt (gdb)\\n\n')
-    gdb_line = gdb_sout_serr.readline() 
-    # check if gdb reports any errors
-    if findall(r'.*: No such file or directory.',gdb_line) != []:
-        print gdb_line, ; stdout.flush()
-        exit(-1)
-    mpd_print(0000, "LINE1=|%s|" % (gdb_line.rstrip()))
-    write(gdb_sin_fileno,'set confirm off\n')
-    gdb_line = gdb_sout_serr.readline() 
-    mpd_print(0000, "LINE2=|%s|" % (gdb_line.rstrip()))
-    write(gdb_sin_fileno,'handle SIGUSR1 nostop noprint\n')
-    gdb_line = gdb_sout_serr.readline() 
-    mpd_print(0000, "LINE3=|%s|" % (gdb_line.rstrip()))
-    write(gdb_sin_fileno,'handle SIGPIPE nostop noprint\n')
-    gdb_line = gdb_sout_serr.readline() 
-    mpd_print(0000, "LINE4=|%s|" % (gdb_line.rstrip()))
-    write(gdb_sin_fileno,'set confirm on\n')
-    gdb_line = gdb_sout_serr.readline() 
-    mpd_print(0000, "LINE5=|%s|" % (gdb_line.rstrip()))
-    write(gdb_sin_fileno,'echo hi1\n')
-    gdb_line = gdb_sout_serr.readline() 
-    # mpd_print(0000, "LINE6=|%s|" % (gdb_line.rstrip()))
-    # gdb_line = ''
-    while not gdb_line.startswith('hi1'):
-        gdb_line = gdb_sout_serr.readline() 
-        mpd_print(0000, "LINEx=|%s|" % (gdb_line.rstrip()))
-
-    if argv[1] != '-attach':
-        write(gdb_sin_fileno,'b main\n')
-        gdb_line = ''
-        while not gdb_line.startswith('Breakpoint'):
-            try:
-                (readyFDs,unused1,unused2) = select([gdb_sout_serr_fileno],[],[],10)
-            except error, data:
-                if data[0] == EINTR:    # interrupted by timeout for example
-                    continue
-                else:
-                    print 'mpdgdb_drv: main loop: select error: %s' % strerror(data[0])
-            if not readyFDs:
-                mpd_print(1, 'timed out waiting for initial Breakpoint response')
-                exit(-1)
-            gdb_line = gdb_sout_serr.readline()  # drain breakpoint response
-            gdb_line = gdb_line.strip()
-            mpd_print(0000, "gdb_line=|%s|" % (gdb_line.rstrip()))
-        if not gdb_line.startswith('Breakpoint'):
-            mpd_print(1, 'expecting "Breakpoint", got :%s:' % (gdb_line) )
-            exit(-1)
-        gdb_line = gdb_sout_serr.readline()  # drain prompt
-        mpd_print(0000, "gdb_line=|%s|" % (gdb_line.rstrip()))
-        if not gdb_line.startswith('(gdb)'):
-            mpd_print(1, 'expecting "(gdb)", got :%s:' % (gdb_line) )
-            exit(-1)
-    
-    print '(gdb)\n', ; stdout.flush()    # initial prompt to user
-    
-    user_fileno = stdin.fileno()
-    while 1:
-        try:
-            (readyFDs,unused1,unused2) = select([user_fileno,gdb_sout_serr_fileno],[],[],1)
-        except error, data:
-            if data[0] == EINTR:    # interrupted by timeout for example
-                continue
-            else:
-                mpd_print(1, 'mpdgdbdrv: main loop: select error: %s' % strerror(data[0]))
-        # print "READY=", readyFDs ; stdout.flush()
-        for readyFD in readyFDs:
-            if readyFD == gdb_sout_serr_fileno:
-                gdb_line = gdb_sout_serr.readline()
-                if not gdb_line:
-                    print "MPIGDB ENDING" ; stdout.flush()
-                    exit(0)
-                # print "LINE |%s|" % (gdb_line.rstrip()) ; stdout.flush()
-                print gdb_line, ; stdout.flush()
-            elif readyFD == user_fileno:
-                user_line = stdin.readline()
-                # print "USERLINE=", user_line, ; stdout.flush()
-                if not user_line:
-                    mpd_print(1, 'mpdgdbdrv: problem: expected user input but got none')
-                    exit(-1)
-                if user_line.startswith('r'):
-                    write(gdb_sin_fileno,'show prompt\n')
-                    gdb_line = gdb_sout_serr.readline()
-                    gdb_prompt = findall(r'Gdb\'s prompt is "(.+)"\.',gdb_line)
-                    if gdb_prompt == []:
-                        mpd_print(1, 'expecting gdb\'s prompt, got :%s:' % (gdb_line))
-                        exit(-1)
-                    gdb_prompt = gdb_prompt[0]
-                    # cut everything after first escape character (including it)
-                    p = gdb_prompt.find("\\")
-                    if p > 0:
-                        gdb_prompt = gdb_prompt[0:p]
-                    gdb_line = gdb_sout_serr.readline() # drain one line
-
-                    write(gdb_sin_fileno,'show confirm\n')
-                    gdb_line = gdb_sout_serr.readline()
-                    gdb_confirm = findall(r'Whether to confirm potentially dangerous operations is (on|off)\.',gdb_line)
-                    if gdb_confirm == []:
-                        mpd_print(1, 'expecting gdb\'s confirm state, got :%s:' % (gdb_line))
-                        exit(-1)
-                    gdb_confirm = gdb_confirm[0]
-                    gdb_line = gdb_sout_serr.readline() # drain one line
-
-                    # set confirm to 'on' to get 'Starting program' message
-                    write(gdb_sin_fileno,'set confirm on\n')
-                    gdb_line = gdb_sout_serr.readline()
-
-                    # we have already set breakpoint 1 in main
-                    write(gdb_sin_fileno,user_line)
-                    # ignore any warnings befor starting msg
-                    while 1:
-                        gdb_line = gdb_sout_serr.readline()  # drain one line
-                        if not gdb_line.startswith('warning:'):
-                            break
-                        else:
-                            print gdb_line, ; stdout.flush()
-                    # drain starting msg
-                    if not gdb_line.startswith('Starting program'):
-                        mpd_print(1, 'expecting "Starting program", got :%s:' % \
-                                  (gdb_line))
-                        exit(-1)
-                    while 1:    # drain to a prompt
-                        gdb_line = gdb_sout_serr.readline()  # drain one line
-                        if gdb_line.startswith(gdb_prompt):
-                            break
-                    # try to get the pid
-                    write(gdb_sin_fileno,'info pid\n')  # macosx
-                    gdb_line = gdb_sout_serr.readline().lstrip()
-                    if gdb_line.find('process ID') >= 0:  # macosx
-                        appPid = findall(r'.* has process ID (\d+)',gdb_line)
-                        appPid = int(appPid[0])
-                    else:
-                        while 1:    # drain to a prompt
-                            gdb_line = gdb_sout_serr.readline()  # drain one line
-                            if gdb_line.startswith(gdb_prompt):
-                                break
-                        write(gdb_sin_fileno,'info program\n')
-                        gdb_line = gdb_sout_serr.readline().lstrip()
-                        if gdb_line.startswith('Using'):
-                            if gdb_line.find('process') >= 0:
-                                appPid = findall(r'Using .* image of child process (\d+)',gdb_line)
-                            elif gdb_line.find('Thread') >= 0:  # solaris
-                                appPid = findall(r'Using .* image of child .* \(LWP (\d+)\).',gdb_line)
-                            else:
-                                mpd_print(1, 'expecting process or thread line, got :%s:' % \
-                                          (gdb_line))
-                                exit(-1)
-                            appPid = int(appPid[0])
-                        else:
-                            mpd_print(1, 'expecting line with "Using"; got :%s:' % (gdb_line))
-                            exit(-1)
-                    while 1:    # drain to a prompt
-                        gdb_line = gdb_sout_serr.readline()  # drain one line
-                        if gdb_line.startswith(gdb_prompt):
-                            break
-                    write(gdb_sin_fileno,'c\n')
-                    # set confirm back to original state
-                    write(gdb_sin_fileno,'set confirm %s\n' % (gdb_confirm))
-                else:
-                    write(gdb_sin_fileno,user_line)
diff --git a/src/pm/mpd/mpdhelp.py b/src/pm/mpd/mpdhelp.py
deleted file mode 100755
index eb5a442..0000000
--- a/src/pm/mpd/mpdhelp.py
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env python
-#
-#   (C) 2001 by Argonne National Laboratory.
-#       See COPYRIGHT in top-level directory.
-#
-
-"""
-The following mpd commands are available.  For usage of any specific one,
-invoke it with the single argument --help .
-
-mpd           start an mpd daemon
-mpdtrace      show all mpd's in ring
-mpdboot       start a ring of daemons all at once
-mpdringtest   test how long it takes for a message to circle the ring 
-mpdexit       remove one mpd from the ring
-mpdallexit    take down all daemons in ring
-mpdcleanup    repair local Unix socket if ring crashed badly
-mpdlistjobs   list processes of jobs (-a or --all: all jobs for all users)
-mpdkilljob    kill all processes of a single job
-mpdsigjob     deliver a specific signal to the application processes of a job
-mpiexec       start a parallel job
-
-Each command can be invoked with the --help argument, which prints usage
-information for the command without running it.
-"""
-from time import ctime
-__author__ = "Ralph Butler and Rusty Lusk"
-__date__ = ctime()
-__version__ = "$Revision: 1.8 $"
-__credits__ = ""
-
-
-if __name__ == '__main__':
-    print __doc__
diff --git a/src/pm/mpd/mpdkilljob.py b/src/pm/mpd/mpdkilljob.py
deleted file mode 100755
index 752e1af..0000000
--- a/src/pm/mpd/mpdkilljob.py
+++ /dev/null
@@ -1,88 +0,0 @@
-#!/usr/bin/env python
-#
-#   (C) 2001 by Argonne National Laboratory.
-#       See COPYRIGHT in top-level directory.
-#
-
-"""
-usage: mpdkilljob  jobnum  [mpdid]  # as obtained from mpdlistjobs
-   or: mpdkilljob  -a jobalias      # as obtained from mpdlistjobs
-    mpdid is mpd where process with 'rank' 0 starts
-    mpdid of form 1 at linux02_32996 (may need \@ in csh)
-"""
-from time import ctime
-__author__ = "Ralph Butler and Rusty Lusk"
-__date__ = ctime()
-__version__ = "$Revision: 1.17 $"
-__credits__ = ""
-
-
-import sys, os, signal
-
-from  mpdlib  import  mpd_set_my_id, mpd_uncaught_except_tb, mpd_print, \
-                      mpd_handle_signal, mpd_get_my_username, MPDConClientSock, MPDParmDB
-
-
-def mpdkilljob():
-    import sys    # to get access to excepthook in next line
-    sys.excepthook = mpd_uncaught_except_tb
-    if len(sys.argv) < 2  or  sys.argv[1] == '-h'  or  sys.argv[1] == '--help':
-        usage()
-    signal.signal(signal.SIGINT, sig_handler)
-    mpd_set_my_id(myid='mpdkilljob')
-    mpdid = ''
-    if sys.argv[1] == '-a':
-        jobalias = sys.argv[2]
-        jobnum = '0'
-    else:
-        jobalias = ''
-        jobid = sys.argv[1]
-        sjobid = jobid.split('@')
-        jobnum = sjobid[0]
-        if len(sjobid) > 1:
-            mpdid = sjobid[1]
-
-    parmdb = MPDParmDB(orderedSources=['cmdline','xml','env','rcfile','thispgm'])
-    parmsToOverride = {
-                        'MPD_USE_ROOT_MPD'            :  0,
-                        'MPD_SECRETWORD'              :  '',
-                      }
-    for (k,v) in parmsToOverride.items():
-        parmdb[('thispgm',k)] = v
-    parmdb.get_parms_from_env(parmsToOverride)
-    parmdb.get_parms_from_rcfile(parmsToOverride)
-    if (hasattr(os,'getuid')  and  os.getuid() == 0)  or  parmdb['MPD_USE_ROOT_MPD']:
-        fullDirName = os.path.abspath(os.path.split(sys.argv[0])[0])  # normalize
-        mpdroot = os.path.join(fullDirName,'mpdroot')
-        conSock = MPDConClientSock(mpdroot=mpdroot,secretword=parmdb['MPD_SECRETWORD'])
-    else:
-        conSock = MPDConClientSock(secretword=parmdb['MPD_SECRETWORD'])
-
-    msgToSend = { 'cmd':'mpdkilljob', 'jobnum' : jobnum, 'mpdid' : mpdid,
-                  'jobalias' : jobalias, 'username' : mpd_get_my_username() }
-    conSock.send_dict_msg(msgToSend)
-    msg = conSock.recv_dict_msg(timeout=5.0)
-    if not msg:
-        mpd_print(1,'no msg recvd from mpd before timeout')
-        sys.exit(-1)
-    if msg['cmd'] != 'mpdkilljob_ack':
-        if msg['cmd'] == 'already_have_a_console':
-            print 'mpd already has a console (e.g. for long ringtest); try later'
-        else:
-            print 'unexpected message from mpd: %s' % (msg)
-        sys.exit(-1)
-    if not msg['handled']:
-        print 'job not found'
-        sys.exit(-1)
-    conSock.close()
-
-def sig_handler(signum,frame):
-    mpd_handle_signal(signum,frame)  # not nec since I exit next
-    sys.exit(-1)
-
-def usage():
-    print __doc__
-    sys.exit(-1)
-
-if __name__ == '__main__':
-    mpdkilljob()
diff --git a/src/pm/mpd/mpdlib.py b/src/pm/mpd/mpdlib.py
deleted file mode 100644
index 9793fb8..0000000
--- a/src/pm/mpd/mpdlib.py
+++ /dev/null
@@ -1,1595 +0,0 @@
-#!/usr/bin/env python
-#
-#   (C) 2001 by Argonne National Laboratory.
-#       See COPYRIGHT in top-level directory.
-#
-
-# workaround to suppress deprecated module warnings in python2.6
-# see https://trac.mpich.org/projects/mpich/ticket/362 for tracking
-import warnings
-warnings.filterwarnings('ignore', '.*the md5 module is deprecated.*', DeprecationWarning)
-warnings.filterwarnings('ignore', '.*the popen2 module is deprecated.*', DeprecationWarning)
-
-import sys, os, signal, popen2, socket, select, inspect
-
-from  cPickle   import  dumps, loads
-from  types     import  TupleType
-from  traceback import  extract_tb, extract_stack, format_list
-from  re        import  sub, split
-from  errno     import  EINTR, ECONNRESET, EISCONN, ECONNREFUSED, EPIPE
-from  md5       import  new as md5new
-from  time      import  sleep
-from  random    import  randrange, random
-
-try:
-    import pwd
-    pwd_module_available = 1
-except:
-    pwd_module_available = 0
-try:
-    import grp
-    grp_module_available = 1
-except:
-    grp_module_available = 0
-try:
-    import  syslog
-    syslog_module_available = 1
-except:
-    syslog_module_available = 0
-try:
-    import subprocess
-    subprocess_module_available = 1
-except:
-    subprocess_module_available = 0
-
-
-# some global vars for some utilities
-global mpd_my_id, mpd_signum, mpd_my_hostname, mpd_procedures_to_trace
-global mpd_cli_app  # for debug during mpich nightly tests
-global mpd_tmpdir
-mpd_cli_app = ''
-mpd_my_id = ''
-mpd_procedures_to_trace = []
-mpd_my_hostname = ''
-# mpd_signum can be set by mpd_handle_signal to indicate which signal was recently caught;
-# this can be useful below to pop out of loops that ordinarily continue after sigs
-# NOTE: mpd_handle_signal must be called by the user, e.g. in his own signal handler
-mpd_signum = 0
-mpd_zc = 0
-if os.environ.has_key('MPD_TMPDIR'):
-    mpd_tmpdir = os.environ['MPD_TMPDIR']
-else:
-    mpd_tmpdir = '/tmp'
-
-# For easier debugging, we provide this variable that is used in the
-# mpd_print calls.  This makes it a little easier to debug problems involving
-# communication with other processes, such as handling EINTR from signals.
-global mpd_dbg_level
-mpd_dbg_level = 0
-
-def mpd_set_dbg_level(flag):
-    global mpd_dbg_level
-    mpd_dbg_level = flag
-
-def mpd_set_my_id(myid=''):
-    global mpd_my_id
-    mpd_my_id = myid
-
-def mpd_set_tmpdir(tmpdir):
-    global mpd_tmpdir
-    mpd_tmpdir = tmpdir
-
-def mpd_get_my_id():
-    global mpd_my_id
-    return(mpd_my_id)
-
-def mpd_set_cli_app(app):    # for debug during mpich nightly tests
-    global mpd_cli_app
-    mpd_cli_app = app
-
-def mpd_handle_signal(signum,frame):
-    global mpd_signum
-    mpd_signum = signum
-
-def mpd_print(*args):
-    global mpd_my_id
-    if not args[0]:
-        return
-    stack = extract_stack()
-    callingProc = stack[-2][2]
-    callingLine = stack[-2][1]
-    printLine = '%s (%s %d): ' % (mpd_my_id,callingProc,callingLine)
-    for arg in args[1:]:
-        printLine = printLine + str(arg)
-    # We've seen an EINTR on the flush here
-    while 1:
-        try:
-            print printLine
-            break
-        except os.error, errinfo:
-            if errinfo[0] != EINTR:
-                raise os.error, errinfo
-    # end of while
-    while 1:
-        try:
-            sys.stdout.flush()
-            break
-        except os.error, errinfo:
-	    if errinfo[0] != EINTR:
-                raise os.error, errinfo
-    # end of while
-    if syslog_module_available:
-        syslog.syslog(syslog.LOG_INFO,printLine)
-
-def mpd_print_tb(*args):
-    global mpd_my_id
-    if not args[0]:
-        return
-    stack = extract_stack()
-    callingProc = stack[-2][2]
-    callingLine = stack[-2][1]
-    stack = extract_stack()
-    stack.reverse()
-    stack = stack[1:]
-    printLine = '%s (%s %d):' % (mpd_my_id,callingProc,callingLine)
-    for arg in args[1:]:
-        printLine = printLine + str(arg)
-    printLine += '\n  mpdtb:\n'
-    for line in format_list(stack):
-        line = sub(r'\n.*','',line)
-        splitLine = split(',',line)
-        splitLine[0] = sub('  File "(.*)"',lambda mo: mo.group(1),splitLine[0])
-        splitLine[1] = sub(' line ','',splitLine[1])
-        splitLine[2] = sub(' in ','',splitLine[2])
-        printLine = printLine + '    %s,  %s,  %s\n' % tuple(splitLine)
-    if mpd_cli_app:    # debug mpich apps in nightly tests
-        printLine += '    mpd_cli_app=%s\n' % (mpd_cli_app)
-        printLine += '    cwd=%s' % (os.getcwd())
-    print printLine
-    sys.stdout.flush()
-    if syslog_module_available:
-        syslog.syslog(syslog.LOG_INFO,printLine)
-
-def mpd_uncaught_except_tb(arg1,arg2,arg3):
-    global mpd_my_id
-    global mpd_cli_id
-    if mpd_my_id:
-        errstr = '%s: ' % (mpd_my_id)
-    else:
-        errstr = ''
-    errstr += 'mpd_uncaught_except_tb handling:\n'
-    errstr += '  %s: %s\n' % (arg1,arg2)
-    tb = extract_tb(arg3)
-    tb.reverse()
-    for tup in tb:
-        # errstr += '    file %s  line# %i  procedure %s\n        %s\n' % (tup)
-        errstr += '    %s  %i  %s\n        %s\n' % (tup)
-    if mpd_cli_app:    # debug mpich apps in nightly tests
-        errstr += '    mpd_cli_app=%s\n' % (mpd_cli_app)
-        errstr += '    cwd=%s' % (os.getcwd())
-    print errstr,
-    if syslog_module_available:
-        syslog.syslog(syslog.LOG_ERR, errstr)
-
-def mpd_set_procedures_to_trace(procs):
-    global mpd_procedures_to_trace
-    mpd_procedures_to_trace = procs
-
-def mpd_trace_calls(frame,event,args):
-    global mpd_my_id, mpd_procedures_to_trace
-    if frame.f_code.co_name not in mpd_procedures_to_trace:
-        return None
-    args_info = apply(inspect.formatargvalues,inspect.getargvalues(frame))
-    # Be VERY careful here; under AIX, it looked like EINTR is 
-    # possible within print (!).  
-    while (1):
-        try:
-            print '%s: ENTER %s in %s at line %d; ARGS=%s' % \
-          (mpd_my_id,frame.f_code.co_name,frame.f_code.co_filename,frame.f_lineno,args_info)
-            break
-        except os.error, errinfo:
-            if errinfo[0] != EINTR:
-                raise os.error, errinfo
-    # end of while
-    return mpd_trace_returns
-
-def mpd_trace_returns(frame,event,args):
-    global mpd_my_id
-    if event == 'return':
-        # Be VERY careful here; under AIX, it looked like EINTR is 
-        # possible within print (!).  
-        while (1):
-            try:
-                print '%s: EXIT %s at line %d ' % (mpd_my_id,frame.f_code.co_name,frame.f_lineno)
-                break
-            except os.error, errinfo:
-                if errinfo[0] != EINTR:
-                    raise os.error, errinfo
-        # end of while
-        return None
-    else:
-        return mpd_trace_returns
-
-def mpd_sockpair():
-    sock1 = MPDSock()
-    rc = sock1.sock.bind(('',0))
-    rc = sock1.sock.listen(5)
-    port1 = sock1.sock.getsockname()[1]
-    sock2 = MPDSock()
-    #
-    # We have encountered situations where the connection fails; as this is
-    # a connection to this process, we retry a few times in that case 
-    # (seen on AIX)
-    #
-    try:
-        connAttempts = 0
-        while (1):
-            try:
-                rc = sock2.sock.connect(('localhost',port1))
-                break
-            except socket.error, errinfo:
-                # In some cases, connect will return EINTR and then on the
-                # next iteration, returns EISCONN.
-                if errinfo[0] == EISCONN:
-                    break
-                if errinfo[0] == ECONNREFUSED and connAttempts < 10:
-                    mpd_print(mpd_dbg_level,"Retrying on connection refused")
-                    connAttempts += 1
-                    sleep(random())
-                elif errinfo[0] != EINTR:
-                    mpd_print(1,"connect %d %s" % (errinfo[0],errinfo[1]))
-                    raise socket.error, errinfo
-	# End of the while
-    except socket.error, errinfo:
-        # we have seen at least one machine that needs it this way
-        # We've seen a failure here; it could be EINPROGRESS, EALREADY, 
-        # or EADDRINUSE.  In that case, we may need to do something else
-	mpd_print(1,"connect error with %d %s" % (errinfo[0],errinfo[1]))
-        # Should this only attempt on ECONNREFUSED, ENETUNREACH, EADDRNOTAVAIL
-        # FIXME: Does this need a try/except?
-        while 1:
-            try:  
-                rc = sock2.sock.connect(('',port1))
-                break
-            except socket.error, errinfo:
-                if errinfo[0] == EISCONN:
-                    break
-                elif errinfo[0] != EINTR:
-                    mpd_print(1,"connect %d %s" % (errinfo[0],errinfo[1]))
-                    raise socket.error, errinfo
-        # end of while
-    # Accept can fail on EINTR, so we handle that here
-    while (1):
-        try:
-            (sock3,addr) = sock1.sock.accept()
-            break
-        except socket.error, errinfo:
-            if errinfo[0] != EINTR:
-                mpd_print(1,"connect %d %s" % (errinfo[0],errinfo[1]))
-                raise socket.error, errinfo
-    # end of while
-    sock3 = MPDSock(sock=sock3)
-    sock1.close()
-    return (sock2,sock3)
-
-def mpd_which(execName,user_path=None):
-    if not user_path:
-        if os.environ.has_key('PATH'):
-            user_path = os.environ['PATH']
-        else:
-            return ''
-    for d in user_path.split(os.pathsep):
-        fpn = os.path.join(d,execName)
-        if os.path.isdir(fpn):  # follows symlinks; dirs can have execute permission
-            continue
-        if os.access(fpn,os.X_OK):    # NOTE access works based on real uid (not euid)
-            return fpn
-    return ''
-
-def mpd_check_python_version():
-    # version_info: (major,minor,micro,releaselevel,serial)
-    if (sys.version_info[0] < 2)  or  \
-       (sys.version_info[0] == 2 and sys.version_info[1] < 2):
-        return sys.version_info
-    return 0
-
-def mpd_version():
-    return (1,0,1,'July, 2006 release')  # major, minor, micro, special
-
-def mpd_get_my_username():
-    if pwd_module_available:
-        username = pwd.getpwuid(os.getuid())[0]    # favor this over env
-    elif os.environ.has_key('USER'):
-        username = os.environ['USER']
-    elif os.environ.has_key('USERNAME'):
-        username = os.environ['USERNAME']
-    else:
-        username = 'unknown_username'
-    return username
-
-def mpd_get_ranks_in_binary_tree(myRank,nprocs):
-    if myRank == 0:
-        parent = -1;
-    else:   
-        parent = (myRank - 1) / 2; 
-    lchild = (myRank * 2) + 1
-    if lchild > (nprocs - 1):
-        lchild = -1;
-    rchild = (myRank * 2) + 2
-    if rchild > (nprocs - 1):
-        rchild = -1;
-    return (parent,lchild,rchild)
-
-def mpd_same_ips(host1,host2):    # hosts may be names or IPs
-    try:
-        ips1 = socket.gethostbyname_ex(host1)[2]    # may fail if invalid host
-        ips2 = socket.gethostbyname_ex(host2)[2]    # may fail if invalid host
-    except:
-        return 0
-    for ip1 in ips1:
-        for ip2 in ips2:
-            if ip1 == ip2:
-                return 1
-    return 0
-
-def mpd_read_nbytes(fd,nbytes):
-    global mpd_signum
-    rv = 0
-    while 1:
-        try:
-            mpd_signum = 0
-            rv = os.read(fd,nbytes)
-            break
-        except os.error, errinfo:
-            if errinfo[0] == EINTR:
-                if mpd_signum == signal.SIGINT  or  mpd_signum == signal.SIGALRM:
-                    break
-                else:
-                    continue
-            elif errinfo[0] == ECONNRESET:   # connection reset (treat as eof)
-                break
-            else:
-                mpd_print(1, 'read error: %s' % os.strerror(errinfo[0]))
-                break
-        except KeyboardInterrupt, errinfo:
-            break
-        except Exception, errinfo:
-            mpd_print(1, 'other error after read %s :%s:' % ( errinfo.__class__, errinfo) )
-            break
-    return rv
-
-def mpd_get_groups_for_username(username):
-    if pwd_module_available  and  grp_module_available:
-        userGroups = [pwd.getpwnam(username)[3]]  # default group for the user
-        allGroups = grp.getgrall();
-        for group in allGroups:
-            if username in group[3]  and  group[2] not in userGroups:
-                userGroups.append(group[2])
-    else:
-        userGroups = []
-    return userGroups
-
-
-class MPDSock(object):
-    def __init__(self,family=socket.AF_INET,socktype=socket.SOCK_STREAM,proto=0,
-                 sock=None,name=''):
-        if sock:
-            self.sock = sock
-        else:
-            self.sock = socket.socket(family=family,type=socktype,proto=proto)
-        self.name = name
-        self.type = socktype
-        self.family = family
-        ## used this when inherited from socket.socket (only works with py 2.3+)
-        ## socket.socket.__init__(self,family=family,type=socktype,proto=proto,_sock=sock)
-    def close(self):
-        self.sock.close()
-    def sendall(self,data):
-        self.sock.sendall(data)
-    def getsockname(self):
-        return self.sock.getsockname()
-    def fileno(self):
-        return self.sock.fileno()
-
-    def connect(self,*args):
-        # We handle EINTR in this method, unless it appears that a
-        # SIGINT or SIGALRM are delivered.  In that case, we do not
-        # complete the connection (FIXME: make sure that all uses of this
-        # do the right thing in that case).
-        while 1:
-            try:
-                mpd_signum = 0
-                self.sock.connect(*args)
-                break
-            except socket.error, errinfo:
-                if errinfo[0] == EINTR:   # sigchld, sigint, etc.
-                    if mpd_signum == signal.SIGINT  or  mpd_signum == signal.SIGALRM:
-                        break
-                    else:
-                        continue
-                else:
-                    raise socket.error, errinfo
-        # end of while
-
-    def accept(self,name='accepter'):
-        global mpd_signum
-        newsock = 0
-        newaddr = 0
-        while 1:
-            try:
-                mpd_signum = 0
-                (newsock,newaddr) = self.sock.accept()
-                break
-            except socket.error, errinfo:
-                if errinfo[0] == EINTR:   # sigchld, sigint, etc.
-                    if mpd_signum == signal.SIGINT  or  mpd_signum == signal.SIGALRM:
-                        break
-                    else:
-                        continue
-                elif errinfo[0] == ECONNRESET:   # connection reset (treat as eof)
-                    break
-                else:
-                    print '%s: accept error: %s' % (mpd_my_id,os.strerror(errinfo[0]))
-                    break
-            except Exception, errinfo:
-                print '%s: failure doing accept : %s : %s' % \
-                      (mpd_my_id,errinfo.__class__,errinfo)
-                break
-        if newsock:
-            newsock = MPDSock(sock=newsock,name=name)    # turn new socket into an MPDSock
-        return (newsock,newaddr)
-    def recv(self,nbytes):
-        global mpd_signum
-        data = 0
-        while 1:
-            try:
-                mpd_signum = 0
-                data = self.sock.recv(nbytes)
-                break
-            except socket.error, errinfo:
-                if errinfo[0] == EINTR:   # sigchld, sigint, etc.
-                    if mpd_signum == signal.SIGINT  or  mpd_signum == signal.SIGALRM:
-                        break
-                    else:
-                        continue
-                elif errinfo[0] == ECONNRESET:   # connection reset (treat as eof)
-                    break
-                else:
-                    print '%s: recv error: %s' % (mpd_my_id,os.strerror(errinfo[0]))
-                    break
-            except Exception, errinfo:
-                print '%s: failure doing recv %s :%s:' % \
-                      (mpd_my_id,errinfo.__class__,errinfo)
-                break
-        return data
-    def recv_dict_msg(self,timeout=None):
-        global mpd_signum
-        global mpd_dbg_level
-
-        mpd_print(mpd_dbg_level, \
-                  "Entering recv_dict_msg with timeout=%s" % (str(timeout)))
-        msg = {}
-        readyToRecv = 0
-        if timeout:
-            try:
-		# Loop while we get EINTR.
-                # FIXME: In some cases, we may want to exit if 
-	        # the signal was SIGINT.  We need to restart if 
-                # we see SIGCLD
-                while 1:
-                    try:
-		        mpd_signum = 0
-                        if timeout == -1:
-                            # use -1 to indicate indefinite timeout
-                            (readyToRecv,unused1,unused2) = select.select([self.sock],[],[])
-                        else:
-                            (readyToRecv,unused1,unused2) = select.select([self.sock],[],[],timeout)
-                        break;
-                    except os.error, errinfo:
-                        if errinfo[0] == EINTR:
-                            # Retry interrupted system calls
-                            pass
-                        else:
-                            raise os.error, errinfo
-                # End of the while(1)
-            except select.error, errinfo:
-                if errinfo[0] == EINTR:
-                    if mpd_signum == signal.SIGINT  or  mpd_signum == signal.SIGALRM:
-                        mpd_print(0,"sigint/alrm check");
-                        pass   # assume timedout; returns {} below
-                    elif mpd_signum == signal.SIGCLD:
-                        mpd_print_tb(1,"mishandling sigchild in recv_dict_msg, errinfo=:%s" % (errinfo) )
-                    else:
-                        mpd_print_tb(1,"Unhandled EINTR: errinfo=%s" % (errinfo) )
-                else:
-                    mpd_print(1, '%s: select error: %s' % (mpd_my_id,os.strerror(errinfo[0])))
-            except KeyboardInterrupt, errinfo:
-                # print 'recv_dict_msg: keyboard interrupt during select'
-                mpd_print(0,"KeyboardInterrupt");
-                return msg
-            except Exception, errinfo:
-                mpd_print(1, 'recv_dict_msg: exception during select %s :%s:' % \
-                      ( errinfo.__class__, errinfo))
-                return msg
-        else:
-            readyToRecv = 1
-        if readyToRecv:
-            mpd_print(mpd_dbg_level,"readyToRecv");
-            try:
-                pickledLen = ''
-                tempRecvd = ''
-                lenLeft = 8
-                while lenLeft:
-                    while (1):
-                        try:
-                            tempRecvd = self.sock.recv(lenLeft)
-                            # FIXME: Shouldn't this block until there is a
-                            # message unless it raises an exception.
-                            # Is no message an EOF, and in that case, 
-                            # do we really want to immediately delete
-                            # the corresponding entry?
-                            #if not pickledLen:
-                            #    mpd_print(1,"continuing because recv failed")
-                            #    continue
-                            break
-                        except socket.error,errinfo:
-                            if errinfo[0] == EINTR:
-                                mpd_print(mpd_dbg_level,"Saw EINTR")
-                                pass
-                            elif errinfo[0] == ECONNRESET:
-                                mpd_print(mpd_dbg_level,"Saw ECONNRESET, ignore (return null msg)")
-                                return msg;
-                            else:
-                                mpd_print_tb(1,"recv_dict_msg: sock.recv(8): errinfo=:%s:" % (errinfo))
-                                raise socket.error,errinfo
-                    # end of while(1)
-                    if not tempRecvd:
-                         break
-                    pickledLen += tempRecvd
-                    lenLeft -= len(tempRecvd)
-                if not pickledLen:
-                    mpd_print(mpd_dbg_level,"no pickeled len")
-                if pickledLen:
-                    pickledLen = int(pickledLen)
-                    pickledMsg = ''
-                    lenLeft = pickledLen
-                    while lenLeft:
-                        while (1):
-                            try:
-                                recvdMsg = self.sock.recv(lenLeft)
-                                break
-                            except socket.error,errinfo:
-                                if errinfo[0] == EINTR:
-                                    pass
-                                else:
-                                    mpd_print_tb(1,"recv_dict_msg: sock.recv(8): errinfo=:%s:" % (errinfo))
-                                    raise socket.error,errinfo
-                        # end of while(1)            
-
-                        pickledMsg += recvdMsg
-                        lenLeft -= len(recvdMsg)
-                    msg = loads(pickledMsg)
-            except socket.error, errinfo:
-                if errinfo[0] == EINTR:
-                    mpd_print(1, "Unhandled EINTR on sock.recv")
-                    return msg
-                elif errinfo[0] == ECONNRESET:   # connection reset (treat as eof)
-                    mpd_print(mpd_dbg_level,"Connection reset")
-                    pass   # socket.error: (104, 'Connection reset by peer')
-                else:
-                    mpd_print_tb(1,'recv_dict_msg: socket error: errinfo=:%s:' % (errinfo))
-            except StandardError, errmsg:    # any built-in exceptions
-                mpd_print_tb(1, 'recv_dict_msg: errmsg=:%s:' % (errmsg) )
-            except Exception, errmsg:
-                mpd_print_tb(1, 'recv_dict_msg failed on sock %s errmsg=:%s:' % \
-                             (self.name,errmsg) )
-        if mpd_dbg_level:
-            if msg:
-                mpd_print(1,"Returning with non-null msg, length = %d, head = %s" % (pickledLen,pickledMsg[0:32].replace('\n','<NL>') ) )
-	    else:
-                mpd_print(1,"Returning with null msg" )
-        return msg
-    def recv_char_msg(self):
-        return self.recv_one_line()  # use leading len later
-    def recv_one_line(self):
-        msg = ''
-	# A failure with EINTR was observed here, so a loop to retry on 
-        # EINTR has been added
-        try:
-            while 1:
-                try:
-                    c = self.sock.recv(1)
-                    break
-                except socket.error, errinfo:
-                    if errinfo[0] != EINTR:
-                        raise socket.error, errinfo
-            # end of while
-        except socket.error, errinfo:
-            if errinfo[0] == EINTR:   # sigchld, sigint, etc.
-                # This should no longer happen (handled above)
-                mpd_print_tb( 1,  "Unhandled EINTR in sock.recv" );
-                return msg
-            elif errinfo[0] == ECONNRESET:   # connection reset (treat as eof)
-                return msg
-            else:
-                print '%s: recv error: %s' % (mpd_my_id,os.strerror(errinfo[0]))
-                sys.exit(-1)
-        except Exception, errmsg:
-            c = ''
-            msg = ''
-            mpd_print_tb(1, 'recv_char_msg: errmsg=:%s:' % (errmsg) )
-        if c:
-            while c != '\n':
-                msg += c
-                try:
-                    c = self.sock.recv(1)
-                except socket.error, errinfo:
-                    if errinfo[0] == EINTR:   # sigchld, sigint, etc.
-                        return msg
-                    elif errinfo[0] == ECONNRESET:   # connection reset (treat as eof)
-                        return msg
-                    else:
-                        print '%s: recv error: %s' % (mpd_my_id,os.strerror(errinfo[0]))
-                        sys.exit(-1)
-                except Exception, errmsg:
-                    c = ''
-                    msg = ''
-                    mpd_print_tb(1, 'recv_char_msg: errmsg=:%s:' % (errmsg) )
-                    break
-            msg += c
-        return msg
- 
-    # The default behavior on an error needs to be to handle and/or report
-    # it.  Otherwise, we all waste time trying to figure out why 
-    # the code is silently failing.  I've set the default for errprint 
-    # to YES rather than NO.
-    def send_dict_msg(self,msg,errprint=1):
-        pickledMsg = dumps(msg) 
-        # FIXME: Does this automatically handle EINTR, or does it need an
-        # except os.error, errinfo: and check on errinfo[0] == EINTR
-        try:
-            while 1:
-                try:
-                    self.sendall( "%08d%s" % (len(pickledMsg),pickledMsg) )
-                    break
-                except socket.error, errmsg:
-		    if errmsg[0] == EPIPE  \
-                    or errmsg[0] == ECONNRESET \
-                    or errmsg[0] == EINTR:
-			# silent failure on pipe failure, as we usually
-                        # just want to discard messages in this case 
-                        # (We need to plan error handling more thoroughly)
-                        break  ## RMB: chgd from pass
-                    else:
-                        raise socket.error, errmsg
-            # end of While
-        except Exception, errmsg:
-            mpd_print_tb(errprint,'send_dict_msg: sock=%s errmsg=:%s:' % (self.name,errmsg))
-    def send_char_msg(self,msg,errprint=1):
-        try:
-            while 1:
-                try:
-                    self.sock.sendall(msg)
-                    break
-                except socket.error, errmsg:
-		    if errmsg[0] == EPIPE:
-			# silent failure on pipe failure, as we usually
-                        # just want to discard messages in this case 
-                        # (We need to plan error handling more thoroughly)
-                        pass
-                    if errmsg[0] != EINTR:
-                        raise socket.error, errmsg
-            # end of While
-        except Exception, errmsg:
-            mpd_print_tb(errprint,'send_char_msg: sock=%s errmsg=:%s:' % (self.name,errmsg))
-
-class MPDListenSock(MPDSock):
-    def __init__(self,host='',port=0,filename='',listen=5,name='listener',**kargs):
-        MPDSock.__init__(self,name=name,**kargs)
-        self.sock.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)
-        if filename:
-            self.sock.bind(filename)
-            self.sock.listen(listen)
-            return
-        # see if we have a PORT_RANGE environment variable
-        try:
-            port_range = os.environ['MPIEXEC_PORT_RANGE']
-            (low_port, high_port) = map(int, port_range.split(':'))
-        except:
-            try:
-                port_range = os.environ['MPICH_PORT_RANGE']
-                (low_port, high_port) = map(int, port_range.split(':'))
-            except:
-                (low_port,high_port) = (0,0)
-        if low_port < 0  or  high_port < low_port:
-            (low_port,high_port) = (0,0)
-        if low_port != 0  and  high_port != 0:
-            if port == 0:
-                port = low_port
-                while 1:
-                    try:
-                        self.sock.bind((host,port))
-                        self.sock.listen(listen)
-                        break
-                    except socket.error, e:
-                        port += 1
-                        if port <= high_port:
-                            self.sock.close()
-                            MPDSock.__init__(self,name=name,**kargs)
-                            self.sock.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)
-                            continue
-                        else:
-                            mpd_print_tb(1,'** no free ports in MPICH_PORT_RANGE')
-                            sys.exit(-1)
-            else:  # else use the explicitly specified port
-                if port < low_port  or  port > high_port:
-                    mpd_print_tb(1,'** port %d is outside MPICH_PORT_RANGE' % port)
-                    sys.exit(-1)
-                self.sock.bind((host,port))  # go ahead and bind
-                self.sock.listen(listen)
-        else:
-            self.sock.bind((host,port))  # no port range set, so just bind as usual
-            self.sock.listen(listen)
-
-class MPDStreamHandler(object):
-    def __init__(self):
-        self.activeStreams = {}
-    def set_handler(self,stream,handler,args=()):
-        self.activeStreams[stream] = (handler,args)
-    def del_handler(self,stream):
-        if self.activeStreams.has_key(stream):
-            del self.activeStreams[stream]
-    def close_all_active_streams(self):
-        for stream in self.activeStreams.keys():
-            del self.activeStreams[stream]
-            stream.close()
-    def handle_active_streams(self,streams=None,timeout=0.1):
-        global mpd_signum
-        while 1:
-            if streams:
-                streamsToSelect = streams
-            else:
-                streamsToSelect = self.activeStreams.keys()
-            readyStreams = []
-            try:
-                mpd_signum = 0
-                (readyStreams,u1,u2) = select.select(streamsToSelect,[],[],timeout)
-                break
-            except select.error, errinfo:
-                if errinfo[0] == EINTR:
-                    if mpd_signum == signal.SIGCHLD:
-                        break
-                    if mpd_signum == signal.SIGINT  or  mpd_signum == signal.SIGALRM:
-                        break
-                    else:
-                        continue
-                else:
-                    print '%s: handle_active_streams: select error: %s' % \
-                          (mpd_my_id,os.strerror(errinfo[0]))
-                    return (-1,os.strerror(errinfo[0]))
-            except KeyboardInterrupt, errinfo:
-                # print 'handle_active_streams: keyboard interrupt during select'
-                return (-1,errinfo.__class__,errinfo)
-            except Exception, errinfo:
-                print 'handle_active_streams: exception during select %s :%s:' % \
-                      ( errinfo.__class__, errinfo)
-                return (-1,errinfo.__class__,errinfo)
-        for stream in readyStreams:
-            if self.activeStreams.has_key(stream):
-                (handler,args) = self.activeStreams[stream]
-                handler(stream,*args)
-            else:
-                # this is not nec bad; an active stream (handler) may
-                # have been deleted by earlier handler in this loop
-                print '*** OOPS, unknown stream in handle_active_streams'
-        return (len(readyStreams),0)  #  len >= 0
-
-class MPDRing(object):
-    def __init__(self,listenSock=None,streamHandler=None,secretword='',
-                 myIfhn='',entryIfhn='',entryPort=0,zcMyLevel=0):
-        if not streamHandler:
-            mpd_print(1, "must supply handler for new conns in ring")
-            sys.exit(-1)
-        if not listenSock:
-            mpd_print(1, "must supply listenSock for new ring")
-            sys.exit(-1)
-        if not myIfhn:
-            mpd_print(1, "must supply myIfhn for new ring")
-            sys.exit(-1)
-        self.secretword = secretword
-        self.myIfhn     = myIfhn
-        self.generation = 0
-        self.listenSock = listenSock
-        self.listenPort = self.listenSock.sock.getsockname()[1]
-        self.streamHandler = streamHandler
-        self.streamHandler.set_handler(self.listenSock,self.handle_ring_listener_connection)
-        self.entryIfhn = entryIfhn
-        self.entryPort = entryPort
-        self.lhsIfhn = ''
-        self.lhsPort = 0
-        self.rhsIfhn = ''
-        self.rhsPort = 0
-        self.lhsSock = 0
-        self.rhsSock = 0
-        self.lhsHandler = None
-        self.rhsHandler = None
-        self.zcMyLevel = zcMyLevel
-        if self.zcMyLevel:
-            mpd_init_zc(self.myIfhn,self.zcMyLevel)
-    def create_single_mem_ring(self,ifhn='',port=0,lhsHandler=None,rhsHandler=None):
-        self.lhsSock,self.rhsSock = mpd_sockpair()
-        self.lhsIfhn = ifhn
-        self.lhsPort = port
-        self.rhsIfhn = ifhn
-        self.rhsPort = port
-        self.lhsHandler = lhsHandler
-        self.streamHandler.set_handler(self.lhsSock,lhsHandler)
-        self.rhsHandler = rhsHandler
-        self.streamHandler.set_handler(self.rhsSock,rhsHandler)
-    def reenter_ring(self,entryIfhn='',entryPort=0,lhsHandler='',rhsHandler='',ntries=5):
-        if mpd_zc:
-            mpd_close_zc()
-            mpd_init_zc(self.myIfhn,self.zcMyLevel)
-        rc = -1
-        numTries = 0
-	self.generation += 1
-        while rc < 0  and  numTries < ntries:
-            numTries += 1
-            rc = self.enter_ring(entryIfhn=entryIfhn,entryPort=entryPort,
-                                 lhsHandler=lhsHandler,rhsHandler=rhsHandler,
-				 ntries=1)
-	    sleepTime = random() * 1.5  # a single random is between 0 and 1
-            sleep(sleepTime)
-        mpd_print(1,'reenter_ring rc=%d after numTries=%d' % (rc,numTries) )
-        return rc
-    def enter_ring(self,entryIfhn='',entryPort=0,lhsHandler='',rhsHandler='',ntries=1):
-        if not lhsHandler  or  not rhsHandler:
-            print 'missing handler for enter_ring'
-            sys.exit(-1)
-        if not entryIfhn:
-            entryIfhn = self.entryIfhn
-        if not entryPort:
-            entryPort = self.entryPort
-        if not entryIfhn  and  mpd_zc:
-            if self.zcMyLevel == 1:
-                (entryHost,entryPort) = ('',0)
-            else:
-                (entryIfhn,entryPort) = mpd_find_zc_peer(self.zcMyLevel-1)
-                if not entryPort:
-                    print "FAILED TO FIND A PEER AT LEVEL", self.zcMyLevel-1
-                    sys.exit(-1)
-            print "ENTRY INFO", (entryIfhn,entryPort)
-        if not entryIfhn:
-            self.create_single_mem_ring(ifhn=self.myIfhn,
-                                        port=self.listenPort,
-                                        lhsHandler=lhsHandler,
-                                        rhsHandler=rhsHandler)
-        else:
-            rv = self.connect_lhs(lhsIfhn=entryIfhn,
-                                  lhsPort=entryPort,
-                                  lhsHandler=lhsHandler,
-                                  numTries=ntries)
-            if rv[0] <= 0:  # connect failed with problem
-                mpd_print(1,"lhs connect failed")
-                return -1
-            if rv[1]:  # rhsifhn and rhsport
-                rhsIfhn = rv[1][0]
-                rhsPort = rv[1][1]
-            else:
-                mpd_print(1,"did not recv rhs host&port from lhs")
-                return -1
-            rv = self.connect_rhs(rhsIfhn=rhsIfhn,
-                                  rhsPort=rhsPort,
-                                  rhsHandler=rhsHandler,
-                                  numTries=ntries)
-            if rv[0] <=  0:  # connect did not succeed; may try again
-                mpd_print(1,"rhs connect failed")
-                return -1
-        if mpd_zc:
-            mpd_register_zc(self.myIfhn,self.zcMyLevel)
-        return 0
-    def connect_lhs(self,lhsIfhn='',lhsPort=0,lhsHandler=None,numTries=1):
-        if not lhsHandler:
-            mpd_print(1, "must supply handler for lhs in ring")
-            return (-1,None)
-        if not lhsIfhn:
-            mpd_print(1, "must supply host for lhs in ring")
-            return (-1,None)
-        self.lhsIfhn = lhsIfhn
-        if not lhsPort:
-            mpd_print(1, "must supply port for lhs in ring")
-            return (-1,None)
-        self.lhsPort = lhsPort
-        numConnTries = 0
-        while numConnTries < numTries:
-            numConnTries += 1
-            self.lhsSock = MPDSock(name='lhs')
-            try:
-                self.lhsSock.connect((self.lhsIfhn,self.lhsPort))
-            except socket.error, errinfo:
-                print '%s: conn error in connect_lhs: %s' % \
-                      (mpd_my_id,os.strerror(errinfo[0]))
-                self.lhsSock.close()
-                self.lhsSock = 0
-                sleep(random())
-                continue
-            break
-        if not self.lhsSock  or  numConnTries > numTries:
-            mpd_print(1,'failed to connect to lhs at %s %d' % (self.lhsIfhn,self.lhsPort))
-            return (0,None)
-        msgToSend = { 'cmd' : 'request_to_enter_as_rhs', 'ifhn' : self.myIfhn,
-                      'port' : self.listenPort,
-                      'mpd_version' : mpd_version() }
-        self.lhsSock.send_dict_msg(msgToSend)
-        msg = self.lhsSock.recv_dict_msg()
-        if (not msg) \
-        or (not msg.has_key('cmd')) \
-        or (not msg['cmd'] == 'challenge') \
-        or (not msg.has_key('randnum')) \
-        or (not msg.has_key('generation')):
-            mpd_print(1,'invalid challenge from %s %d: %s' % \
-                      (self.lhsIfhn,self.lhsPort,msg) )
-            return (-1,None)
-        if msg['generation'] < self.generation:
-            mpd_print(1,'bad generation from lhs; lhsgen=%d mygen=%d' % (msg['generation'],self.generation))
-            return(-1,'bad_generation')  # RMB: try again here later
-        response = md5new(''.join([self.secretword,msg['randnum']])).digest()
-        msgToSend = { 'cmd' : 'challenge_response', 'response' : response,
-                      'ifhn' : self.myIfhn, 'port' : self.listenPort }
-        self.lhsSock.send_dict_msg(msgToSend)
-        msg = self.lhsSock.recv_dict_msg()
-        if (not msg) \
-        or (not msg.has_key('cmd')) \
-        or (not msg['cmd'] == 'OK_to_enter_as_rhs'):
-            mpd_print(1,'NOT OK to enter ring; one likely cause: mismatched secretwords')
-            return (-1,None)
-        self.lhsHandler = lhsHandler
-        self.streamHandler.set_handler(self.lhsSock,lhsHandler)
-        if msg.has_key('rhsifhn') and msg.has_key('rhsport'):
-            return (1,(msg['rhsifhn'],msg['rhsport']))
-        else:
-            return (1,None)
-    def connect_rhs(self,rhsIfhn='',rhsPort=0,rhsHandler=None,numTries=1):
-        if not rhsHandler:
-            mpd_print(1, "must supply handler for rhs in ring")
-            return (-1,None)
-        if not rhsIfhn:
-            mpd_print(1, "must supply host for rhs in ring")
-            return (-1,None)
-        self.rhsIfhn = rhsIfhn
-        if not rhsPort:
-            mpd_print(1, "must supply port for rhs in ring")
-            return (-1,None)
-        self.rhsPort = rhsPort
-        numConnTries = 0
-        while numConnTries < numTries:
-            numConnTries += 1
-            self.rhsSock = MPDSock(name='rhs')
-            try:
-                self.rhsSock.connect((self.rhsIfhn,self.rhsPort))
-            except socket.error, errinfo:
-                print '%s: conn error in connect_rhs: %s' % \
-                      (mpd_my_id,os.strerror(errinfo[0]))
-                self.rhsSock.close()
-                self.rhsSock = 0
-                sleep(random())
-                continue
-            break
-        if not self.rhsSock or numConnTries > numTries:
-            mpd_print(1,'failed to connect to rhs at %s %d' % (self.rhsIfhn,self.rhsPort))
-            return (0,None)
-        msgToSend = { 'cmd' : 'request_to_enter_as_lhs', 'ifhn' : self.myIfhn,
-                      'port' : self.listenPort,
-                      'mpd_version' : mpd_version() }
-        self.rhsSock.send_dict_msg(msgToSend)
-        msg = self.rhsSock.recv_dict_msg()
-        if (not msg) \
-        or (not msg.has_key('cmd')) \
-        or (not msg['cmd'] == 'challenge') \
-        or (not msg.has_key('randnum')) \
-        or (not msg.has_key('generation')):
-            mpd_print(1,'invalid challenge from %s %d: %s' % (self.rhsIfhn,rhsPort,msg) )
-            return (-1,None)
-        if msg['generation'] < self.generation:
-            mpd_print(1,'bad generation from rhs; lhsgen=%d mygen=%d' % (msg['generation'],self.generation))
-            return(-1,'bad_generation')  # RMB: try again here later
-        response = md5new(''.join([self.secretword,msg['randnum']])).digest()
-        msgToSend = { 'cmd' : 'challenge_response', 'response' : response,
-                      'ifhn' : self.myIfhn, 'port' : self.listenPort }
-        self.rhsSock.send_dict_msg(msgToSend)
-        msg = self.rhsSock.recv_dict_msg()
-        if (not msg) \
-        or (not msg.has_key('cmd')) \
-        or (not msg['cmd'] == 'OK_to_enter_as_lhs'):
-            mpd_print(1,'NOT OK to enter ring; one likely cause: mismatched secretwords')
-            return (-1,None)
-        self.rhsHandler = rhsHandler
-        self.streamHandler.set_handler(self.rhsSock,rhsHandler)
-        if msg.has_key('lhsifhn') and msg.has_key('lhsport'):
-            return (1,(msg['lhsifhn'],msg['lhsport']))
-        else:
-            return (1,None)
-    def accept_lhs(self,lhsHandler=None):
-        self.lhsHandler = lhsHandler
-        newsock = self.handle_ring_listener_connection(self.listenSock)
-        self.handle_lhs_challenge_response(newsock)
-        self.streamHandler.set_handler(self.lhsSock,lhsHandler)
-    def accept_rhs(self,rhsHandler=None):
-        self.rhsHandler = rhsHandler
-        newsock = self.handle_ring_listener_connection(self.listenSock)
-        self.handle_rhs_challenge_response(newsock)
-        self.streamHandler.set_handler(self.rhsSock,rhsHandler)
-    def handle_ring_listener_connection(self,sock):
-        randHiRange = 10000
-        (newsock,newaddr) = sock.accept()
-        newsock.name = 'candidate_to_enter_ring'
-        msg = newsock.recv_dict_msg()
-        if (not msg) or \
-           (not msg.has_key('cmd')) or (not msg.has_key('ifhn')) or  \
-           (not msg.has_key('port')):
-            mpd_print(1, 'INVALID msg from new connection :%s: msg=:%s:' % (newaddr,msg) )
-            newsock.close()
-            return None
-        if msg.has_key('mpd_version'):  # ping, etc may not have one
-            if msg['mpd_version'] != mpd_version():
-                msgToSend = { 'cmd' : 'entry_rejected_bad_mpd_version',
-                              'your_version' : msg['mpd_version'],
-                              'my_version' : mpd_version() }
-                newsock.send_dict_msg(msgToSend)
-                newsock.close()
-                return None
-        randNumStr = '%04d' % (randrange(1,randHiRange))  # 0001-(hi-1), inclusive
-        newsock.correctChallengeResponse = \
-                         md5new(''.join([self.secretword,randNumStr])).digest()
-        msgToSend = { 'cmd' : 'challenge', 'randnum' : randNumStr,
-                      'generation' : self.generation }
-        newsock.send_dict_msg(msgToSend)
-        if msg['cmd'] == 'request_to_enter_as_lhs':
-            self.streamHandler.set_handler(newsock,self.handle_lhs_challenge_response)
-            newsock.name = 'candidate_for_lhs_challenged'
-            return newsock
-        elif msg['cmd'] == 'request_to_enter_as_rhs':
-            self.streamHandler.set_handler(newsock,self.handle_rhs_challenge_response)
-            newsock.name = 'candidate_for_rhs_challenged'
-            return newsock
-        elif msg['cmd'] == 'ping':
-            # already sent challenge instead of ack
-            newsock.close()
-            return None
-        else:
-            mpd_print(1, 'INVALID msg from new connection :%s:  msg=:%s:' % (newaddr,msg) )
-            newsock.close()
-            return None
-        return None
-    def handle_lhs_challenge_response(self,sock):
-        msg = sock.recv_dict_msg()
-        if (not msg)   or  \
-           (not msg.has_key('cmd'))   or  (not msg.has_key('response'))  or  \
-           (not msg.has_key('ifhn'))  or  (not msg.has_key('port'))  or  \
-           (not msg['response'] == sock.correctChallengeResponse):
-            mpd_print(1, 'INVALID msg for lhs response msg=:%s:' % (msg) )
-            msgToSend = { 'cmd' : 'invalid_response' }
-            sock.send_dict_msg(msgToSend)
-            self.streamHandler.del_handler(sock)
-            sock.close()
-        else:
-            msgToSend = { 'cmd' : 'OK_to_enter_as_lhs' }
-            sock.send_dict_msg(msgToSend)
-            if self.lhsSock:
-                self.streamHandler.del_handler(self.lhsSock)
-                self.lhsSock.close()
-            self.lhsSock = sock
-            self.lhsIfhn = msg['ifhn']
-            self.lhsPort = int(msg['port'])
-            self.streamHandler.set_handler(self.lhsSock,self.lhsHandler)
-            self.lhsSock.name = 'lhs'
-    def handle_rhs_challenge_response(self,sock):
-        msg = sock.recv_dict_msg()
-        if (not msg)   or  \
-           (not msg.has_key('cmd'))   or  (not msg.has_key('response'))  or  \
-           (not msg.has_key('ifhn'))  or  (not msg.has_key('port')):
-            mpd_print(1, 'INVALID msg for rhs response msg=:%s:' % (msg) )
-            msgToSend = { 'cmd' : 'invalid_response' }
-            sock.send_dict_msg(msgToSend)
-            self.streamHandler.del_handler(sock)
-            sock.close()
-        elif msg['response'] != sock.correctChallengeResponse:
-            mpd_print(1, 'INVALID response in rhs response msg=:%s:' % (msg) )
-            msgToSend = { 'cmd' : 'invalid_response' }
-            sock.send_dict_msg(msgToSend)
-            self.streamHandler.del_handler(sock)
-            sock.close()
-        elif msg['response'] == 'bad_generation':
-            mpd_print(1, 'someone failed entering my ring gen=%d msg=%s' % \
-                      (self.generation,msg) )
-            self.streamHandler.del_handler(sock)
-            sock.close()
-        else:
-            msgToSend = { 'cmd' : 'OK_to_enter_as_rhs', 'rhsifhn' : self.rhsIfhn,
-                          'rhsip' : self.rhsIfhn, 'rhsport' : self.rhsPort }
-            sock.send_dict_msg(msgToSend)
-            if self.rhsSock:
-                self.streamHandler.del_handler(self.rhsSock)
-                self.rhsSock.close()
-            self.rhsSock = sock
-            self.rhsIfhn   = msg['ifhn']
-            self.rhsPort = int(msg['port'])
-            self.streamHandler.set_handler(self.rhsSock,self.rhsHandler)
-            self.rhsSock.name = 'rhs'
-
-class MPDConListenSock(MPDListenSock):
-    def __init__(self,name='console_listen',secretword='',**kargs):
-        if os.environ.has_key('MPD_CON_EXT'):
-            self.conExt = '_'  + os.environ['MPD_CON_EXT']
-        else:
-            self.conExt = ''
-        self.conFilename = mpd_tmpdir + '/mpd2.console_' + mpd_get_my_username() + self.conExt
-        self.secretword = secretword
-        consoleAlreadyExists = 0
-        if hasattr(socket,'AF_UNIX'):
-            sockFamily = socket.AF_UNIX
-        else:
-            sockFamily = socket.AF_INET
-        if os.environ.has_key('MPD_CON_INET_HOST_PORT'):
-            sockFamily = socket.AF_INET    # override above-assigned value
-            (conHost,conPort) = os.environ['MPD_CON_INET_HOST_PORT'].split(':')
-            conPort = int(conPort)
-        else:
-            (conHost,conPort) = ('',0)
-        if os.access(self.conFilename,os.R_OK):    # if console there, see if mpd listening
-            if hasattr(socket,'AF_UNIX')  and  sockFamily == socket.AF_UNIX:
-                tempSock = MPDSock(family=socket.AF_UNIX)
-                try:
-                    tempSock.connect(self.conFilename)
-                    consoleAlreadyExists = 1
-                except Exception, errmsg:
-                    os.unlink(self.conFilename)
-                tempSock.close()
-            else:
-                if not conPort:
-                    conFile = open(self.conFilename)
-                    for line in conFile:
-                        line = line.strip()
-                        (k,v) = line.split('=')
-                        if k == 'port':
-                            conPort = int(v)
-                    conFile.close()
-                tempSock = MPDSock()
-                try:
-                    tempSock.sock.connect(('localhost',conPort))
-                    consoleAlreadyExists = 1
-                except Exception, errmsg:
-                    os.unlink(self.conFilename)
-                tempSock.close()
-        if consoleAlreadyExists:
-            print 'An mpd is already running with console at %s on %s. ' % \
-                  (self.conFilename, socket.gethostname())
-            print 'Start mpd with the -n option for a second mpd on same host.'
-            if syslog_module_available:
-                syslog.syslog(syslog.LOG_ERR,
-                              "%s: exiting; an mpd is already using the console" % \
-                              (mpd_my_id))
-            sys.exit(-1)
-        if hasattr(socket,'AF_UNIX')  and  sockFamily == socket.AF_UNIX:
-            MPDListenSock.__init__(self,family=sockFamily,socktype=socket.SOCK_STREAM,
-                                   filename=self.conFilename,listen=1,name=name)
-        else:
-            MPDListenSock.__init__(self,family=sockFamily,socktype=socket.SOCK_STREAM,
-                                   port=conPort,listen=1,name=name)
-            conFD = os.open(self.conFilename,os.O_CREAT|os.O_WRONLY|os.O_EXCL,0600)
-            self.port = self.sock.getsockname()[1]
-            os.write(conFD,'port=%d\n' % (self.port) )
-            os.close(conFD)
-
-class MPDConClientSock(MPDSock):
-    def __init__(self,name='console_to_mpd',mpdroot='',secretword='',**kargs):
-        MPDSock.__init__(self)
-        self.sock = 0
-        if os.environ.has_key('MPD_CON_EXT'):
-            self.conExt = '_'  + os.environ['MPD_CON_EXT']
-        else:
-            self.conExt = ''
-        self.secretword = secretword
-        if mpdroot:
-            self.conFilename = mpd_tmpdir + '/mpd2.console_root' + self.conExt
-            self.sock = MPDSock(family=socket.AF_UNIX,name=name)
-            rootpid = os.fork()
-            if rootpid == 0:
-                os.execvpe(mpdroot,[mpdroot,self.conFilename,str(self.sock.fileno())],{})
-                mpd_print(1,'failed to exec mpdroot (%s)' % mpdroot )
-                sys.exit(-1)
-            else:
-                (pid,status) = os.waitpid(rootpid,0)
-                if os.WIFSIGNALED(status):
-                    status = status & 0x007f  # AND off core flag
-                else:
-                    status = os.WEXITSTATUS(status)
-                if status != 0:
-                    mpd_print(1,'forked process failed; status=%s' % status)
-                    sys.exit(-1)
-        else:
-            self.conFilename = mpd_tmpdir + '/mpd2.console_' + mpd_get_my_username() + self.conExt
-            if hasattr(socket,'AF_UNIX'):
-                sockFamily = socket.AF_UNIX
-            else:
-                sockFamily = socket.AF_INET
-            if os.environ.has_key('MPD_CON_INET_HOST_PORT'):
-                sockFamily = socket.AF_INET    # override above-assigned value
-                (conHost,conPort) = os.environ['MPD_CON_INET_HOST_PORT'].split(':')
-                conPort = int(conPort)
-            else:
-                (conHost,conPort) = ('',0)
-            self.sock = MPDSock(family=sockFamily,socktype=socket.SOCK_STREAM,name=name)
-            if hasattr(socket,'AF_UNIX')  and  sockFamily == socket.AF_UNIX:
-                if hasattr(signal,'alarm'):
-                    oldAlarmTime = signal.alarm(8)
-                else:    # assume python2.3 or later
-                    oldTimeout = socket.getdefaulttimeout()
-                    socket.setdefaulttimeout(8)
-                try:
-                    self.sock.connect(self.conFilename)
-                except Exception, errmsg:
-                    self.sock.close()
-                    self.sock = 0
-                if hasattr(signal,'alarm'):
-                    signal.alarm(oldAlarmTime)
-                else:    # assume python2.3 or later
-                    socket.setdefaulttimeout(oldTimeout)
-                if self.sock:
-                    # this is done by mpdroot otherwise
-                    msgToSend = 'realusername=%s secretword=UNUSED\n' % \
-                                mpd_get_my_username()
-                    self.sock.send_char_msg(msgToSend)
-            else:
-                if not conPort:
-                    conFile = open(self.conFilename)
-                    for line in conFile:
-                        line = line.strip()
-                        (k,v) = line.split('=')
-                        if k == 'port':
-                            conPort = int(v)
-                    conFile.close()
-                if conHost:
-                    conIfhn = socket.gethostbyname_ex(conHost)[2][0]
-                else:
-                    conIfhn = 'localhost'
-                self.sock = MPDSock(name=name)
-                if hasattr(signal,'alarm'):
-                    oldAlarmTime = signal.alarm(8)
-                else:    # assume python2.3 or later
-                    oldTimeout = socket.getdefaulttimeout()
-                    socket.setdefaulttimeout(8)
-                try:
-                    self.sock.connect((conIfhn,conPort))
-                except Exception, errmsg:
-                    mpd_print(1,"failed to connect to host %s port %d" % \
-                              (conIfhn,conPort) )
-                    self.sock.close()
-                    self.sock = 0
-                if hasattr(signal,'alarm'):
-                    signal.alarm(oldAlarmTime)
-                else:    # assume python2.3 or later
-                    socket.setdefaulttimeout(oldTimeout)
-                if not self.sock:
-                    print '%s: cannot connect to local mpd (%s); possible causes:' % \
-                          (mpd_my_id,self.conFilename)
-                    print '  1. no mpd is running on this host'
-                    print '  2. an mpd is running but was started without a "console" (-n option)'
-                    print 'In case 1, you can start an mpd on this host with:'
-                    print '    mpd &'
-                    print 'and you will be able to run jobs just on this host.'
-                    print 'For more details on starting mpds on a set of hosts, see'
-                    print 'the MPICH Installation Guide.'
-                    sys.exit(-1)
-                msgToSend = { 'cmd' : 'con_init' }
-                self.sock.send_dict_msg(msgToSend)
-                msg = self.sock.recv_dict_msg()
-                if not msg:
-                    mpd_print(1,'expected con_challenge from mpd; got eof')
-                    sys.exit(-1)
-                if msg['cmd'] != 'con_challenge':
-                    mpd_print(1,'expected con_challenge from mpd; got msg=:%s:' % (msg) )
-                    sys.exit(-1)
-                randVal = self.secretword + str(msg['randnum'])
-                response = md5new(randVal).digest()
-                msgToSend = { 'cmd' : 'con_challenge_response', 'response' : response,
-                              'realusername' : mpd_get_my_username() }
-                self.sock.send_dict_msg(msgToSend)
-                msg = self.sock.recv_dict_msg()
-                if not msg  or  msg['cmd'] != 'valid_response':
-                    mpd_print(1,'expected valid_response from mpd; got msg=:%s:' % (msg) )
-                    sys.exit(-1)
-        if not self.sock:
-            print '%s: cannot connect to local mpd (%s); possible causes:' % \
-                  (mpd_my_id,self.conFilename)
-            print '  1. no mpd is running on this host'
-            print '  2. an mpd is running but was started without a "console" (-n option)'
-            print 'In case 1, you can start an mpd on this host with:'
-            print '    mpd &'
-            print 'and you will be able to run jobs just on this host.'
-            print 'For more details on starting mpds on a set of hosts, see'
-            print 'the MPICH Installation Guide.'
-            sys.exit(-1)
-
-class MPDParmDB(dict):
-    def __init__(self,orderedSources=[]):
-        dict.__init__(self)
-        self.orderedSources = orderedSources
-        self.db = {}
-        for src in orderedSources:  # highest to lowest
-            self.db[src] = {}
-    def __setitem__(self,sk_tup,val):
-        if type(sk_tup) != TupleType  or  len(sk_tup) != 2:
-            mpd_print_tb(1,"must use a 2-tuple as key in a parm db; invalid: %s" % (sk_tup) )
-            sys.exit(-1)
-        s,k = sk_tup
-        for src in self.orderedSources:
-            if src == s:
-                self.db[src][k] = val
-                break
-        else:
-            mpd_print_tb(1,"invalid src specified for insert into parm db; src=%s" % (src) )
-            sys.exit(-1)
-    def __getitem__(self,key):
-        for src in self.orderedSources:
-            if self.db[src].has_key(key):
-                return self.db[src][key]
-        raise KeyError, "key %s not found in parm db" % (key)
-    def has_key(self,key):
-        for src in self.orderedSources:
-            if self.db[src].has_key(key):
-                return 1
-        return 0
-    def printall(self):
-        print "MPDRUN's PARMDB; values from all sources:"
-        for src in self.orderedSources:
-            print '  %s (source)' % (src)
-            for key in self.db[src].keys():
-                print '    %s = %s' % (key,self.db[src][key])
-    def printdef(self):
-        print "MPDRUN's PARMDB; default values only:"
-        printed = {}
-        for src in self.orderedSources:
-            for key in self.db[src]:
-                if not printed.has_key(key):
-                    printed[key] = 1
-                    print '  %s  %s = %s' % (src,key,self.db[src][key])
-    def get_parms_from_env(self,parmsToOverride):
-        for k in parmsToOverride.keys():
-            if os.environ.has_key(k):
-                self[('env',k)] = os.environ[k]
-    def get_parms_from_rcfile(self,parmsToOverride,errIfMissingFile=0):
-        if os.environ.has_key('MPD_CONF_FILE') and os.access(os.environ['MPD_CONF_FILE'], os.R_OK):
-            parmsRCFilename = os.environ['MPD_CONF_FILE']
-        elif hasattr(os,'getuid')  and  os.getuid() == 0:    # if ROOT
-            parmsRCFilename = os.path.abspath('/etc/mpd.conf')
-        elif os.environ.has_key('HOME') and os.access(os.path.join(os.environ['HOME'], '.mpd.conf'), os.R_OK):
-            parmsRCFilename = os.path.join(os.environ['HOME'],'.mpd.conf')
-        elif os.environ.has_key('HOMEPATH'):    # e.g. win32
-            parmsRCFilename = os.path.join(os.environ['HOMEPATH'],'.mpd.conf')
-        else:
-            print 'unable to find mpd.conf file'
-            sys.exit(-1)
-        if sys.platform == 'win32':
-            mode = 0x80   # fake it
-        else:
-            try:
-                mode = os.stat(parmsRCFilename)[0]
-            except:
-                mode = ''
-	# sometimes a missing file is OK, e.g. when user running with root's mpd
-        if not mode  and  not errIfMissingFile:
-            return
-        if not mode:
-            print 'configuration file %s not found' % (parmsRCFilename)
-            print 'A file named .mpd.conf file must be present in the user\'s home'
-            print 'directory (/etc/mpd.conf if root) with read and write access'
-            print 'only for the user, and must contain at least a line with:'
-            print 'MPD_SECRETWORD=<secretword>'
-            print 'One way to safely create this file is to do the following:'
-            print '  cd $HOME'
-            print '  touch .mpd.conf'
-            print '  chmod 600 .mpd.conf'
-            print 'and then use an editor to insert a line like'
-            print '  MPD_SECRETWORD=mr45-j9z'
-            print 'into the file.  (Of course use some other secret word than mr45-j9z.)' 
-            sys.exit(-1)
-        if  (mode & 0x3f):
-            print 'configuration file %s is accessible by others' % (parmsRCFilename)
-            print 'change permissions to allow read and write access only by you'
-            sys.exit(-1)
-        parmsRCFile = open(parmsRCFilename)
-        for line in parmsRCFile:
-            lineWithoutComments = line.split('#')[0]    # will at least be ''
-            lineWithoutComments = lineWithoutComments.strip()
-            if not lineWithoutComments:
-                continue
-            splitLine = lineWithoutComments.split('=')
-            if not splitLine[0]:    # ['']
-                print 'warning: unrecognized (null) key in %s' % (parmsRCFilename)
-                continue
-            if len(splitLine) == 2:
-                (k,v) = splitLine
-                origKey = k
-                if k == 'secretword':    # for bkwd-compat
-                    k = 'MPD_SECRETWORD'
-                if k in parmsToOverride.keys():
-                    if k != 'MPD_SECRETWORD'  and  v.isdigit():
-                        v = int(v)
-                    self[('rcfile',k)] = v
-            else:
-                mpd_print(1, 'line in mpd conf is not key=val pair; line=:%s:' % (line) )
-
-class MPDTest(object):
-    def __init__(self):
-        pass
-    def run(self,cmd='',expIn = '',chkEC=0,expEC=0,chkOut=0,expOut='',ordOut=0,
-            grepOut=0, exitOnFail=1):
-        rv = {}
-        if chkOut and grepOut:
-            print "grepOut and chkOut are mutually exclusive"
-            sys.exit(-1)
-        outLines = []
-        if subprocess_module_available:
-            import re
-            cmd = re.split(r'\s+',cmd)
-            runner = subprocess.Popen(cmd,bufsize=0,env=os.environ,close_fds=True,
-                                      stdin=subprocess.PIPE,stdout=subprocess.PIPE,
-                                      stderr=subprocess.PIPE)
-            if expIn:
-                runner.stdin.write(expIn)
-            runner.stdin.close()
-            for line in runner.stdout:
-                outLines.append(line[:-1])    # strip newlines
-            for line in runner.stderr:
-                outLines.append(line[:-1])    # strip newlines
-            rv['pid'] = runner.pid
-            rv['EC'] = runner.wait()
-        elif hasattr(popen2,'Popen4'):    # delete when python2.4+ is common
-            runner = popen2.Popen4(cmd)
-            if expIn:
-                runner.tochild.write(expIn)
-            runner.tochild.close()
-            for line in runner.fromchild:
-                outLines.append(line[:-1])    # strip newlines
-            rv['pid'] = runner.pid
-            rv['EC'] = runner.wait()
-        else:
-            mpd_print(1,'can not run with either subprocess or popen2-Popen4')
-            sys.exit(-1)
-        rv['OUT'] = outLines[:]
-        if chkEC  and  expEC != rv['EC']:
-            print "bad exit code from test: %s" % (cmd)
-            print "   expected exitcode=%d ; got %d" % (expEC,rv['EC'])
-            print "output from cmd:"
-            for line in outLines:
-                print line
-            if exitOnFail:
-                sys.exit(-1)
-        if chkOut:
-            orderOK = 1
-            expOut = expOut.split('\n')[:-1]  # leave off trailing ''
-            for line in outLines[:]:    # copy of outLines
-                if line in expOut:
-                    if ordOut and line != expOut[0]:
-                        orderOK = 0
-                        break  # count rest of outLines as bad
-                    expOut.remove(line)
-                    outLines.remove(line)
-            if not orderOK:
-                print "lines out of order in output for test: %s" % (cmd)
-                for line in outLines:
-                    print line
-                if exitOnFail:
-                    sys.exit(-1)
-            if expOut:
-                print "some required lines not found in output for test: %s" % (cmd)
-                for line in outLines:
-                    print line
-                if exitOnFail:
-                    sys.exit(-1)
-            if outLines:
-                print "extra lines in output for test: %s" % (cmd)
-                for line in outLines:
-                    print line
-                if exitOnFail:
-                    sys.exit(-1)
-        elif grepOut:
-            foundCnt = 0
-            for expLine in expOut:
-                for outLine in outLines:
-                    if outLine.find(expLine) >= 0:
-                        foundCnt += 1
-            if foundCnt < len(expOut):
-                print "some lines not matched for test: %s" % (cmd)
-                for line in outLines:
-                     print line
-                if exitOnFail:
-                    sys.exit(-1)
-        return rv
-
-#### experimental code for zeroconf
-def mpd_init_zc(ifhn,my_level):
-    import threading, Zeroconf
-    global mpd_zc
-    mpd_zc = Zeroconf.Zeroconf()
-    class ListenerForPeers(object):
-        def __init__(self):
-            mpd_zc.peers = {}
-            mpd_zc.peersLock = threading.Lock()
-            mpd_zc.peers_available_event = threading.Event()
-        def removeService(self, zc, service_type, name):
-            mpd_zc.peersLock.acquire()
-            del mpd_zc.peers[name]
-            print "removed", name ; sys.stdout.flush()
-            mpd_zc.peersLock.release()
-        def addService(self, zc, service_type, name):
-            info = zc.getServiceInfo(service_type, name)
-            if info:
-                if info.properties['username'] != mpd_get_my_username():
-                    return
-                mpd_zc.peersLock.acquire()
-                mpd_zc.peers[name] = info
-                print "added peer:", name, info.properties ; sys.stdout.flush()
-                mpd_zc.peersLock.release()
-                mpd_zc.peers_available_event.set()
-            else:
-                print "OOPS NO INFO FOR", name ; sys.stdout.flush()
-    service_type = "_mpdzc._tcp.local."
-    listenerForPeers = ListenerForPeers()
-    browser = Zeroconf.ServiceBrowser(mpd_zc,service_type,listenerForPeers)
-    ##  sleep(1.5)  # give browser a chance to find some peers
-def mpd_find_zc_peer(peer_level):
-    print "finding a peer at level %d..." % (peer_level) ; sys.stdout.flush()
-    mpd_zc.peers_available_event.wait(5)
-    for (peername,info) in mpd_zc.peers.items():
-        if info.properties['mpdid'] == mpd_my_id:
-            continue
-        if info.properties['level'] != peer_level:
-            continue
-        peerAddr = str(socket.inet_ntoa(info.getAddress()))
-        peerPort = info.getPort()
-        return(peerAddr,peerPort)
-    return ('',0)
-def mpd_register_zc(ifhn,level):
-    import Zeroconf
-    service_type = "_mpdzc._tcp.local."
-    service_ifhn = socket.inet_aton(ifhn)
-    service_host = socket.gethostname()
-    service_port = int(mpd_my_id.split('_')[1])
-    svc = Zeroconf.ServiceInfo(service_type,
-                               mpd_my_id + service_type,
-                               address = service_ifhn,
-                               port = service_port,
-                               weight = 0, priority = 0,
-                               properties = { 'description': 'mpd',
-                                              'mpdid' : mpd_my_id,
-                                              'level' : level,
-                                              'username' : mpd_get_my_username() }
-                               )
-    mpd_zc.registerService(svc)
-def mpd_close_zc():
-    if mpd_zc:
-        mpd_zc.close()
-
-
-# code for testing
-
-def _handle_msg(sock):
-    msg = sock.recv_dict_msg()
-    print 'recvd msg=:%s:' % (msg)
-
-if __name__ == '__main__':
-    sh = MPDStreamHandler()
-    (tsock1,tsock2) = mpd_sockpair()
-    tsock1.name = 'tsock1_connected_to_tsock2'
-    sh.set_handler(tsock1,_handle_msg)
-    tsock2.send_dict_msg( {'msgtype' : 'hello'} )
-    sh.handle_active_streams()
-    # just to demo a listen sock
-    lsock = MPDListenSock('',9999,name='listen_sock')
-    print lsock.name, lsock.getsockname()[1]
-
-    ### import sys
-    ### sys.excepthook = mpd_uncaught_except_tb
-    ### i = 1/0
diff --git a/src/pm/mpd/mpdlistjobs.py b/src/pm/mpd/mpdlistjobs.py
deleted file mode 100755
index 1b71c44..0000000
--- a/src/pm/mpd/mpdlistjobs.py
+++ /dev/null
@@ -1,159 +0,0 @@
-#!/usr/bin/env python
-#
-#   (C) 2001 by Argonne National Laboratory.
-#       See COPYRIGHT in top-level directory.
-#
-
-"""
-usage: mpdlistjobs [-u | --user=username] [-a | --alias=jobalias] [-j | --jobid=jobid]
-    (only use one of jobalias or jobid)'
-lists jobs being run by an mpd ring, all by default, or filtered'
-    by user, mpd job id, or alias assigned when the job was submitted'
-"""
-from time import ctime
-__author__ = "Ralph Butler and Rusty Lusk"
-__date__ = ctime()
-__version__ = "$Revision: 1.21 $"
-__credits__ = ""
-
-
-import sys, os, signal, socket
-
-from  mpdlib  import  mpd_set_my_id, mpd_uncaught_except_tb, mpd_print, \
-                      mpd_handle_signal, mpd_get_my_username, MPDConClientSock, MPDParmDB
-
-def mpdlistjobs():
-    import sys    # to get access to excepthook in next line
-    sys.excepthook = mpd_uncaught_except_tb
-    signal.signal(signal.SIGINT, sig_handler)
-    mpd_set_my_id(myid='mpdlistjobs')
-    uname    = ''
-    jobid    = ''
-    sjobid   = ''
-    jobalias = ''
-    sssPrintFormat = 0
-    if len(sys.argv) > 1:
-        aidx = 1
-        while aidx < len(sys.argv):
-            if sys.argv[aidx] == '-h'  or  sys.argv[aidx] == '--help':
-                usage()
-            if sys.argv[aidx] == '-u':    # or --user=
-                uname = sys.argv[aidx+1]
-                aidx += 2
-            elif sys.argv[aidx].startswith('--user'):
-                splitArg = sys.argv[aidx].split('=')
-                try:
-                    uname = splitArg[1]
-                except:
-                    print 'mpdlistjobs: invalid argument:', sys.argv[aidx]
-                    usage()
-                aidx += 1
-            elif sys.argv[aidx] == '-j':    # or --jobid=
-                jobid = sys.argv[aidx+1]
-                aidx += 2
-                sjobid = jobid.split('@')    # jobnum and originating host
-            elif sys.argv[aidx].startswith('--jobid'):
-                splitArg = sys.argv[aidx].split('=')
-                try:
-                    jobid = splitArg[1]
-                    sjobid = jobid.split('@')    # jobnum and originating host
-                except:
-                    print 'mpdlistjobs: invalid argument:', sys.argv[aidx]
-                    usage()
-                aidx += 1
-            elif sys.argv[aidx] == '-a':    # or --alias=
-                jobalias = sys.argv[aidx+1]
-                aidx += 2
-            elif sys.argv[aidx].startswith('--alias'):
-                splitArg = sys.argv[aidx].split('=')
-                try:
-                    jobalias = splitArg[1]
-                except:
-                    print 'mpdlistjobs: invalid argument:', sys.argv[aidx]
-                    usage()
-                aidx += 1
-            elif sys.argv[aidx] == '--sss':
-                sssPrintFormat = 1
-                aidx +=1
-            else:
-                print 'unrecognized arg: %s' % sys.argv[aidx]
-                sys.exit(-1)
-
-    parmdb = MPDParmDB(orderedSources=['cmdline','xml','env','rcfile','thispgm'])
-    parmsToOverride = {
-                        'MPD_USE_ROOT_MPD'            :  0,
-                        'MPD_SECRETWORD'              :  '',
-                      }
-    for (k,v) in parmsToOverride.items():
-        parmdb[('thispgm',k)] = v
-    parmdb.get_parms_from_env(parmsToOverride)
-    parmdb.get_parms_from_rcfile(parmsToOverride)
-    if (hasattr(os,'getuid')  and  os.getuid() == 0)  or  parmdb['MPD_USE_ROOT_MPD']:
-        fullDirName = os.path.abspath(os.path.split(sys.argv[0])[0])  # normalize
-        mpdroot = os.path.join(fullDirName,'mpdroot')
-        conSock = MPDConClientSock(mpdroot=mpdroot,secretword=parmdb['MPD_SECRETWORD'])
-    else:
-        conSock = MPDConClientSock(secretword=parmdb['MPD_SECRETWORD'])
-
-    msgToSend = { 'cmd' : 'mpdlistjobs' }
-    conSock.send_dict_msg(msgToSend)
-    msg = conSock.recv_dict_msg(timeout=5.0)
-    if not msg:
-        mpd_print(1,'no msg recvd from mpd before timeout')
-    if msg['cmd'] != 'local_mpdid':     # get full id of local mpd for filters later
-        mpd_print(1,'did not recv local_mpdid msg from local mpd; instead, recvd: %s' % msg)
-    else:
-        if len(sjobid) == 1:
-            sjobid.append(msg['id'])
-    done = 0
-    while not done:
-        msg = conSock.recv_dict_msg()
-        if not msg.has_key('cmd'):
-            mpd_print(1,'mpdlistjobs: INVALID msg=:%s:' % (msg) )
-            sys.exit(-1)
-        if msg['cmd'] == 'mpdlistjobs_info':
-            smjobid = msg['jobid'].split('  ')  # jobnum, mpdid, and alias (if present)
-            if len(smjobid) < 3:
-                smjobid.append('')
-            print_based_on_uname    = 0    # default
-            print_based_on_jobid    = 0    # default
-            print_based_on_jobalias = 0    # default
-            if not uname  or  uname == msg['username']:
-                print_based_on_uname = 1
-            if not jobid  and  not jobalias:
-                print_based_on_jobid = 1
-                print_based_on_jobalias = 1
-            else:
-                if sjobid  and  sjobid[0] == smjobid[0]  and  sjobid[1] == smjobid[1]:
-                    print_based_on_jobid = 1
-                if jobalias  and  jobalias == smjobid[2]:
-                    print_based_on_jobalias = 1
-            if not smjobid[2]:
-                smjobid[2] = '          '  # just for printing
-            if print_based_on_uname and (print_based_on_jobid or print_based_on_jobalias):
-                if sssPrintFormat:
-                    print "%s %s %s"%(msg['host'],msg['clipid'],msg['sid'])
-                else:
-                    print 'jobid    = %s@%s' % (smjobid[0],smjobid[1])
-                    print 'jobalias = %s'    % (smjobid[2])
-                    print 'username = %s'    % (msg['username'])
-                    print 'host     = %s'    % (msg['host'])
-                    print 'pid      = %s'    % (msg['clipid'])
-                    print 'sid      = %s'    % (msg['sid'])
-                    print 'rank     = %s'    % (msg['rank'])
-                    print 'pgm      = %s'    % (msg['pgm'])
-                    print
-        else:  # mpdlistjobs_trailer
-            done = 1
-    conSock.close()
-
-def sig_handler(signum,frame):
-    mpd_handle_signal(signum,frame)  # not nec since I exit next
-    sys.exit(-1)
-
-def usage():
-    print __doc__
-    sys.exit(-1)
-
-if __name__ == '__main__':
-    mpdlistjobs()
diff --git a/src/pm/mpd/mpdman.py b/src/pm/mpd/mpdman.py
deleted file mode 100644
index d63926b..0000000
--- a/src/pm/mpd/mpdman.py
+++ /dev/null
@@ -1,1656 +0,0 @@
-#!/usr/bin/env python
-#
-#   (C) 2001 by Argonne National Laboratory.
-#       See COPYRIGHT in top-level directory.
-#
-
-"""
-mpdman does NOT run as a standalone console program;
-    it is only exec'd (or imported) by mpd
-"""
-from time import ctime
-__author__ = "Ralph Butler and Rusty Lusk"
-__date__ = ctime()
-__version__ = "$Revision: 1.160 $"
-__credits__ = ""
-
-
-import sys, os, signal, socket
-
-from types    import ClassType
-from re       import findall, sub
-from cPickle  import loads
-from time     import sleep
-from urllib   import quote
-from mpdlib   import mpd_set_my_id, mpd_print, mpd_read_nbytes,  \
-                     mpd_sockpair, mpd_get_ranks_in_binary_tree, \
-                     mpd_get_my_username, mpd_set_cli_app,       \
-                     mpd_dbg_level, mpd_handle_signal,           \
-                     MPDSock, MPDListenSock, MPDStreamHandler, MPDRing
-
-try:
-    import  syslog  
-    syslog_module_available = 1
-except:
-    syslog_module_available = 0
-try:
-    import  subprocess
-    subprocess_module_available = 1
-except:
-    subprocess_module_available = 0
-
-
-global clientPid, clientExited, clientExitStatus, clientExitStatusSent
-
-class MPDMan(object):
-    def __init__(self):
-        pass
-    def run(self):
-        global clientPid, clientExited, clientExitStatus, clientExitStatusSent
-        clientExited = 0
-        clientExitStatusSent = 0
-        if hasattr(signal,'SIGCHLD'):
-            signal.signal(signal.SIGCHLD,sigchld_handler)
-        self.myHost    = os.environ['MPDMAN_MYHOST']
-        self.myIfhn    = os.environ['MPDMAN_MYIFHN']
-        self.myRank    = int(os.environ['MPDMAN_RANK'])
-        self.posInRing = int(os.environ['MPDMAN_POS_IN_RING'])
-        self.myId      = self.myHost + '_mpdman_' + str(self.myRank)
-        self.spawned   = int(os.environ['MPDMAN_SPAWNED'])
-        self.spawnInProgress = 0
-        if self.spawned:
-            self.myId = self.myId + '_s'
-        # Note that in the spawned process case, this id for the mpdman
-        # will not be unique (it needs something like the world number
-        # or the pid of the mpdman process itself)
-        mpd_set_my_id(myid=self.myId)
-        self.clientPgm = os.environ['MPDMAN_CLI_PGM']
-        mpd_set_cli_app(self.clientPgm)
-        try:
-            os.chdir(os.environ['MPDMAN_CWD'])
-        except Exception, errmsg:
-            errmsg =  '%s: invalid dir: %s' % (self.myId,os.environ['MPDMAN_CWD'])
-            # print errmsg    ## may syslog it in some cases ?
-        if os.environ['MPDMAN_HOW_LAUNCHED'] == 'FORK':
-            self.listenRingPort = int(os.environ['MPDMAN_MY_LISTEN_PORT'])
-            listenRingFD = int(os.environ['MPDMAN_MY_LISTEN_FD'])  # closed in loop below
-            self.listenRingSock = socket.fromfd(listenRingFD,socket.AF_INET,socket.SOCK_STREAM)
-            self.listenRingSock = MPDSock(sock=self.listenRingSock)
-            mpdFD = int(os.environ['MPDMAN_TO_MPD_FD'])  # closed in loop below
-            self.mpdSock = socket.fromfd(mpdFD,socket.AF_INET,socket.SOCK_STREAM)
-            self.mpdSock = MPDSock(sock=self.mpdSock)
-        elif os.environ['MPDMAN_HOW_LAUNCHED'] == 'SUBPROCESS':
-            self.listenRingSock = MPDListenSock()
-            self.listenRingPort = self.listenRingSock.getsockname()[1]
-            mpdPort = int(os.environ['MPDMAN_MPD_PORT'])
-            self.mpdSock = MPDSock()
-            self.mpdSock.connect((self.myIfhn,mpdPort))
-            self.mpdSock.send_dict_msg( {'man_listen_port' : self.listenRingPort} )
-        else:
-            mpd_print(1,'I cannot figure out how I was launched')
-            sys.exit(-1)
-        self.pos0Ifhn = os.environ['MPDMAN_POS0_IFHN']
-        self.pos0Port = int(os.environ['MPDMAN_POS0_PORT'])
-        # close unused fds before I grab any more
-        # NOTE: this will also close syslog's fd inherited from mpd; re-opened below
-        try:     max_fds = os.sysconf('SC_OPEN_MAX')
-        except:  max_fds = 1024
-        # FIXME This snippet causes problems on Fedora Core 12.  FC12's python
-        # opens a file object to /etc/abrt/pyhook.conf.  Closing the fd out from
-        # under the higher level object causes problems at exit time when the
-        # higher level object is garbage collected.  See MPICH ticket #902 for
-        # more information.
-        #for fd in range(3,max_fds):
-        #    if fd == self.mpdSock.fileno()  or  fd == self.listenRingSock.fileno():
-        #        continue
-        #    try:    os.close(fd)
-        #    except: pass
-        if syslog_module_available:
-            syslog.openlog("mpdman",0,syslog.LOG_DAEMON)
-            syslog.syslog(syslog.LOG_INFO,"mpdman starting new log; %s" % (self.myId) )
-        self.umask = os.environ['MPDMAN_UMASK']
-        if self.umask.startswith('0x'):
-            self.umask = int(self.umask,16)
-        elif self.umask.startswith('0'):
-            self.umask = int(self.umask,8)
-        else:
-            self.umask = int(self.umask)
-        self.oldumask = os.umask(self.umask)
-        self.clientPgmArgs = loads(os.environ['MPDMAN_PGM_ARGS'])
-        self.clientPgmEnv = loads(os.environ['MPDMAN_PGM_ENVVARS'])
-        self.clientPgmLimits = loads(os.environ['MPDMAN_PGM_LIMITS'])
-        self.jobid = os.environ['MPDMAN_JOBID']
-        self.nprocs = int(os.environ['MPDMAN_NPROCS'])
-        self.mpdPort = int(os.environ['MPDMAN_MPD_LISTEN_PORT'])
-        self.mpdConfPasswd = os.environ['MPDMAN_MPD_CONF_SECRETWORD']
-        os.environ['MPDMAN_MPD_CONF_SECRETWORD'] = ''  ## do NOT pass it on to clients
-        self.kvs_template_from_env = os.environ['MPDMAN_KVS_TEMPLATE']
-        self.conIfhn  = os.environ['MPDMAN_CONIFHN']
-        self.conPort  = int(os.environ['MPDMAN_CONPORT'])
-        self.lhsIfhn  = os.environ['MPDMAN_LHS_IFHN']
-        self.lhsPort  = int(os.environ['MPDMAN_LHS_PORT'])
-        self.stdinDest = os.environ['MPDMAN_STDIN_DEST']
-        self.totalview = int(os.environ['MPDMAN_TOTALVIEW'])
-        self.gdb = int(os.environ['MPDMAN_GDB'])
-        self.gdba = os.environ['MPDMAN_GDBA']
-        self.lineLabelFmt = os.environ['MPDMAN_LINE_LABELS_FMT']
-        self.startStdoutLineLabel = 1
-        self.startStderrLineLabel = 1
-        self.singinitPID  = int(os.environ['MPDMAN_SINGINIT_PID'])
-        self.singinitPORT = int(os.environ['MPDMAN_SINGINIT_PORT'])
-        self.doingBNR = int(os.environ['MPDMAN_DOING_BNR'])
-        self.listenNonRingSock = MPDListenSock('',0,name='nonring_listen_sock')
-        self.listenNonRingPort = self.listenNonRingSock.getsockname()[1]
-        self.streamHandler = MPDStreamHandler()
-        self.streamHandler.set_handler(self.mpdSock,self.handle_mpd_input)
-        self.streamHandler.set_handler(self.listenNonRingSock,
-                                       self.handle_nonring_connection)
-
-        # set up pmi stuff early in case I was spawned
-        self.universeSize = -1
-        self.appnum = -1
-        self.pmiVersion = 1
-        self.pmiSubversion = 1
-        self.KVSs = {}
-        if self.singinitPID:
-            # self.kvsname_template = 'singinit_kvs_'
-            self.kvsname_template = 'singinit_kvs_' + str(os.getpid())
-        else:
-            self.kvsname_template = 'kvs_' + self.kvs_template_from_env + '_'
-        self.default_kvsname = self.kvsname_template + '0'
-        self.default_kvsname = sub('\.','_',self.default_kvsname)  # magpie.cs to magpie_cs
-        self.default_kvsname = sub('\-','_',self.default_kvsname)  # chg node-0 to node_0
-        self.KVSs[self.default_kvsname] = {}
-        cli_env = {}
-        cli_env['MPICH_INTERFACE_HOSTNAME'] = os.environ['MPICH_INTERFACE_HOSTNAME']
-        cli_env['MPICH_INTERFACE_HOSTNAME_R%d' % self.myRank] = os.environ['MPICH_INTERFACE_HOSTNAME']
-        for k in self.clientPgmEnv.keys():
-            if k.startswith('MPI_APPNUM'):
-                self.appnum = self.clientPgmEnv[k]    # don't put in application env
-            elif k.startswith('MPICH_INTERFACE_HOSTNAME'):
-                continue    ## already put it in above
-            else:
-                cli_env[k] = self.clientPgmEnv[k]
-        self.kvs_next_id = 1
-        self.jobEndingEarly = 0
-        self.pmiCollectiveJob = 0
-        self.spawnedCnt = 0
-        self.pmiSock = 0   # obtained later
-        self.ring = MPDRing(listenSock=self.listenRingSock,
-                            streamHandler=self.streamHandler,
-                            myIfhn=self.myIfhn)
-        if self.nprocs == 1:
-            self.ring.create_single_mem_ring(ifhn=self.myIfhn,
-                                             port=self.listenRingPort,
-                                             lhsHandler=self.handle_lhs_input,
-                                             rhsHandler=self.handle_rhs_input)
-        else:
-            if self.posInRing == 0:    # one 'end'
-                self.ring.accept_rhs(rhsHandler=self.handle_rhs_input)
-                self.ring.accept_lhs(lhsHandler=self.handle_lhs_input)
-            elif self.posInRing == (self.nprocs-1):  # the other 'end'
-                rv = self.ring.connect_lhs(lhsIfhn=self.lhsIfhn,
-                                           lhsPort=self.lhsPort,
-                                           lhsHandler=self.handle_lhs_input,
-                                           numTries=8)
-                if rv[0] <= 0:
-                    mpd_print(1,"lhs connect failed")
-                    sys.exit(-1)
-                self.rhsIfhn = self.pos0Ifhn
-                self.rhsPort = self.pos0Port
-                rv = self.ring.connect_rhs(rhsIfhn=self.rhsIfhn,
-                                           rhsPort=self.rhsPort,
-                                           rhsHandler=self.handle_rhs_input,
-                                           numTries=8)
-                if rv[0] <=  0:  # connect did not succeed; may try again
-                    mpd_print(1,"rhs connect failed")
-                    sys.exit(-1)
-            else:  # ring members 'in the middle'
-                rv = self.ring.connect_lhs(lhsIfhn=self.lhsIfhn,
-                                           lhsPort=self.lhsPort,
-                                           lhsHandler=self.handle_lhs_input,
-                                           numTries=8)
-                if rv[0] <= 0:
-                    mpd_print(1,"lhs connect failed")
-                    sys.exit(-1)
-                self.ring.accept_rhs(rhsHandler=self.handle_rhs_input)
-
-        if self.myRank == 0:
-            self.conSock = MPDSock(name='to_console')
-            self.conSock.connect((self.conIfhn,self.conPort))
-            self.streamHandler.set_handler(self.conSock,self.handle_console_input)
-            if self.spawned:
-                msgToSend = { 'cmd' : 'spawned_man0_is_up',
-                              'spawned_id' : os.environ['MPDMAN_SPAWNED'] }
-                self.conSock.send_dict_msg(msgToSend)
-                msg = self.conSock.recv_dict_msg()
-                # If there is a failure in the connection, this
-                # receive will fail and if not handled, cause mpdman 
-                # to fail.  For now, we just check on a empty or unexpected
-                # message
-                if not msg or msg['cmd'] != 'preput_info_for_child':
-                    mpd_print(1,'invalid msg from parent :%s:' % msg)
-                    sys.exit(-1)
-                try:
-                    for k in msg['kvs'].keys():
-                        self.KVSs[self.default_kvsname][k] = msg['kvs'][k]
-                except:
-                    mpd_print(1,'failed to insert preput_info')
-                    sys.exit(-1)
-                msg = self.conSock.recv_dict_msg()
-                if not msg  or  not msg.has_key('cmd')  or  msg['cmd'] != 'ringsize':
-                    mpd_print(1,'spawned: bad msg from con; got: %s' % (msg) )
-                    sys.exit(-1)
-                self.universeSize = msg['ring_ncpus']
-                # if the rshSock is closed, we'll get an AttributeError 
-                # exception about 'int' has no attribute 'send_dict_msg'
-                # FIXME: Does every use of a sock on which send_dict_msg
-                # is used need an "if xxxx.rhsSock:" test first?
-                # Is there an else for those cases?
-                self.ring.rhsSock.send_dict_msg(msg)  # forward it on
-            else:
-                msgToSend = { 'cmd' : 'man_checking_in' }
-                self.conSock.send_dict_msg(msgToSend)
-                msg = self.conSock.recv_dict_msg()
-                if not msg  or  not msg.has_key('cmd')  or  msg['cmd'] != 'ringsize':
-                    mpd_print(1,'invalid msg from con; expected ringsize got: %s' % (msg) )
-                    sys.exit(-1)
-                if self.clientPgmEnv.has_key('MPI_UNIVERSE_SIZE'):
-                    self.universeSize = int(self.clientPgmEnv['MPI_UNIVERSE_SIZE'])
-                else:
-                    self.universeSize = msg['ring_ncpus']
-                self.ring.rhsSock.send_dict_msg(msg)
-            ## NOTE: if you spawn a non-MPI job, it may not send this msg
-            ## in which case the pgm will hang; the reason for this is that
-            ## mpich does an Accept after the PMI_Spawn_multiple and a non-mpi
-            ## pgm will never do the expected Connect.
-            self.stdoutToConSock = MPDSock(name='stdout_to_console')
-            self.stdoutToConSock.connect((self.conIfhn,self.conPort))
-            if self.spawned:
-                msgToSend = { 'cmd' : 'child_in_stdout_tree', 'from_rank' : self.myRank }
-                self.stdoutToConSock.send_dict_msg(msgToSend)
-            self.stderrToConSock = MPDSock(name='stderr_to_console')
-            self.stderrToConSock.connect((self.conIfhn,self.conPort))
-            if self.spawned:
-                msgToSend = { 'cmd' : 'child_in_stderr_tree', 'from_rank' : self.myRank }
-                self.stderrToConSock.send_dict_msg(msgToSend)
-        else:
-            self.conSock = 0
-        if self.myRank == 0:
-            self.parentStdoutSock = self.stdoutToConSock
-            self.parentStderrSock = self.stderrToConSock
-        else:
-            self.parentStdoutSock = 0
-            self.parentStderrSock = 0
-        msg = self.ring.lhsSock.recv_dict_msg()    # recv msg containing ringsize
-        if not msg  or  not msg.has_key('cmd')  or  msg['cmd'] != 'ringsize':
-            mpd_print(1,'invalid msg from lhs; expecting ringsize got: %s' % (msg) )
-            sys.exit(-1)
-        if self.myRank != 0:
-            self.ring.rhsSock.send_dict_msg(msg)
-            if self.clientPgmEnv.has_key('MPI_UNIVERSE_SIZE'):
-                self.universeSize = int(self.clientPgmEnv['MPI_UNIVERSE_SIZE'])
-            else:
-                self.universeSize = msg['ring_ncpus']
-        if self.doingBNR:
-            (self.pmiSock,self.cliBNRSock) = mpd_sockpair()
-            self.streamHandler.set_handler(self.pmiSock,self.handle_pmi_input)
-            cli_env['MAN_MSGS_FD'] = str(self.cliBNRSock.fileno())       ## BNR
-        self.numDone = 0
-        self.numWithIO = 2    # stdout and stderr so far
-        self.numConndWithIO = 2
-        # FIXME: This is the old singleton approach, which didn't allow 
-        # for more than one process to be a singleton
-        if self.singinitPORT:
-            self.pmiListenSock = 0
-            self.pmiSock = MPDSock(name='pmi')
-            self.pmiSock.connect((self.myIfhn,self.singinitPORT))
-            self.streamHandler.set_handler(self.pmiSock,self.handle_pmi_input)
-            self.pmiSock.send_char_msg('cmd=singinit authtype=none\n')
-            line = self.pmiSock.recv_char_msg()
-            charMsg = 'cmd=singinit_info rc=0 versionok=yes stdio=yes kvsname=%s\n' % (self.default_kvsname)
-            self.pmiSock.send_char_msg(charMsg)
-
-            sock_write_cli_stdin = MPDSock(name='write_cli_stdin')
-            sock_write_cli_stdin.connect((self.myIfhn,self.singinitPORT))
-            self.fd_write_cli_stdin = sock_write_cli_stdin.fileno()
-
-            sock_read_cli_stdout = MPDSock(name='read_cli_stdout')
-            sock_read_cli_stdout.connect((self.myIfhn,self.singinitPORT))
-            self.fd_read_cli_stdout = sock_read_cli_stdout.fileno()
-            
-            sock_read_cli_stderr = MPDSock(name='read_cli_stderr')
-            sock_read_cli_stderr.connect((self.myIfhn,self.singinitPORT))
-            self.fd_read_cli_stderr = sock_read_cli_stderr.fileno()
-        else:
-            self.cliListenSock = MPDListenSock('',0,name='cli_listen_sock')  ## BNR
-            self.cliListenPort = self.cliListenSock.getsockname()[1]         ## BNR
-            self.pmiListenSock = MPDListenSock('',0,name='pmi_listen_sock')
-            self.pmiListenPort = self.pmiListenSock.getsockname()[1]
-        self.subproc = 0    # default; use fork instead of subprocess
-        if self.singinitPID:
-            clientPid = self.singinitPID
-        else:
-            cli_env['PATH']      = os.environ['MPDMAN_CLI_PATH']
-            cli_env['PMI_PORT']  = '%s:%s' % (self.myIfhn,self.pmiListenPort)
-            cli_env['PMI_SIZE']  = str(self.nprocs)
-            cli_env['PMI_RANK']  = str(self.myRank)
-            cli_env['PMI_DEBUG'] = str(0)
-            cli_env['PMI_TOTALVIEW'] = str(self.totalview)
-            if self.spawned:
-                cli_env['PMI_SPAWNED'] = '1'
-            else:
-                cli_env['PMI_SPAWNED'] = '0'
-            if self.doingBNR:
-                cli_env['MPD_TVDEBUG'] = str(0)                                   ## BNR
-                cli_env['MPD_JID'] = os.environ['MPDMAN_JOBID']                   ## BNR
-                cli_env['MPD_JSIZE'] = str(self.nprocs)                           ## BNR
-                cli_env['MPD_JRANK'] = str(self.myRank)                           ## BNR
-                cli_env['CLIENT_LISTENER_FD'] = str(self.cliListenSock.fileno())  ## BNR
-            if hasattr(os,'fork'):
-                (self.fd_read_cli_stdin, self.fd_write_cli_stdin ) = os.pipe()
-                (self.fd_read_cli_stdout,self.fd_write_cli_stdout) = os.pipe()
-                (self.fd_read_cli_stderr,self.fd_write_cli_stderr) = os.pipe()
-                (self.handshake_sock_man_end,self.handshake_sock_cli_end) = mpd_sockpair()
-                clientPid = self.launch_client_via_fork_exec(cli_env)
-                if clientPid < 0:
-                    print '**** mpdman: launch_client_via_fork_exec failed; exiting'
-                    sys.exit(-1)
-                elif clientPid > 0:
-                    self.handshake_sock_cli_end.close()
-                else:  # 0
-                    self.handshake_sock_man_end.close()
-            elif subprocess_module_available:
-                clientPid = self.launch_client_via_subprocess(cli_env)  # may chg self.subproc
-            else:
-                mpd_print(1,'neither fork nor subprocess is available')
-                sys.exit(-1)
-        # if not initially a recvr of stdin (e.g. gdb) then give immediate eof to client
-        if not in_stdinRcvrs(self.myRank,self.stdinDest):
-            if self.subproc:    # must close subproc's file (not just the fd)
-                self.subproc.stdin.close()
-            else:
-                os.close(self.fd_write_cli_stdin)
-        if self.doingBNR:
-            self.cliBNRSock.close()
-        msgToSend = { 'cmd' : 'client_info', 'jobid' : self.jobid, 'clipid' : clientPid,
-                      'manpid' : os.getpid(), 'rank' : self.myRank,
-                      'spawner_manpid' : int(os.environ['MPDMAN_SPAWNER_MANPID']),
-                      'spawner_mpd' : os.environ['MPDMAN_SPAWNER_MPD'] }
-        self.mpdSock.send_dict_msg(msgToSend)
-
-        if not self.subproc:
-            self.streamHandler.set_handler(self.fd_read_cli_stdout,
-                                           self.handle_cli_stdout_input)
-            self.streamHandler.set_handler(self.fd_read_cli_stderr,
-                                           self.handle_cli_stderr_input)
-        self.waitPids = [clientPid]
-
-        if self.pmiListenSock:
-            self.streamHandler.set_handler(self.pmiListenSock,self.handle_pmi_connection)
-
-        # begin setup of stdio tree
-        (parent,lchild,rchild) = mpd_get_ranks_in_binary_tree(self.myRank,self.nprocs)
-        self.spawnedChildSocks = []
-        self.childrenStdoutTreeSocks = []
-        self.childrenStderrTreeSocks = []
-        if lchild >= 0:
-            self.numWithIO += 2    # stdout and stderr from child
-            msgToSend = { 'cmd' : 'info_from_parent_in_tree',
-                          'to_rank' : str(lchild),
-                          'parent_ifhn'   : self.myIfhn,
-                          'parent_port' : self.listenNonRingPort }
-            self.ring.rhsSock.send_dict_msg(msgToSend)
-        if rchild >= 0:
-            self.numWithIO += 2    # stdout and stderr from child
-            msgToSend = { 'cmd' : 'info_from_parent_in_tree',
-                          'to_rank' : str(rchild),
-                          'parent_ifhn'   : self.myIfhn,
-                          'parent_port' : self.listenNonRingPort }
-            self.ring.rhsSock.send_dict_msg(msgToSend)
-
-        if os.environ.has_key('MPDMAN_RSHIP'):
-            rship = os.environ['MPDMAN_RSHIP']
-            # (rshipSock,rshipPort) = mpd_get_inet_listen_sock('',0)
-            rshipPid = os.fork()
-            if rshipPid == 0:
-                os.environ['MPDCP_MSHIP_HOST'] = os.environ['MPDMAN_MSHIP_HOST']
-                os.environ['MPDCP_MSHIP_PORT'] = os.environ['MPDMAN_MSHIP_PORT']
-                os.environ['MPDCP_MSHIP_NPROCS'] = str(self.nprocs)
-                os.environ['MPDCP_CLI_PID'] = str(clientPid)
-                try:
-                    os.execvpe(rship,[rship],os.environ)
-                except Exception, errmsg:
-                    # make sure my error msgs get to console
-                    os.dup2(self.parentStdoutSock.fileno(),1)  # closes fd 1 (stdout) if open
-                    os.dup2(self.parentStderrSock.fileno(),2)  # closes fd 2 (stderr) if open
-                    mpd_print(1,'execvpe failed for copgm %s; errmsg=:%s:' % (rship,errmsg) )
-                    sys.exit(-1)
-                sys.exit(0)
-            # rshipSock.close()
-            self.waitPids.append(rshipPid)
-
-        if not self.spawned:
-            # receive the final process mapping from our MPD overlords
-            msg = self.mpdSock.recv_dict_msg(timeout=-1)
-
-            # a few defensive checks now to make sure that the various parts of the
-            # code are all on the same page
-            if not msg.has_key('cmd') or msg['cmd'] != 'process_mapping':
-                mpd_print(1,'expected cmd="process_mapping", got cmd="%s" instead' % (msg.get('cmd','**not_present**')))
-                sys.exit(-1)
-            if msg['jobid'] != self.jobid:
-                mpd_print(1,'expected jobid="%s", got jobid="%s" instead' % (self.jobid,msg['jobid']))
-                sys.exit(-1)
-            if not msg.has_key('process_mapping'):
-                mpd_print(1,'expected msg to contain a process_mapping key')
-                sys.exit(-1)
-            self.KVSs[self.default_kvsname]['PMI_process_mapping'] = msg['process_mapping']
-
-
-        self.tvReady = 0
-        self.pmiBarrierInRecvd = 0
-        self.holdingPMIBarrierLoop1 = 0
-        if self.myRank == 0:
-            self.holdingEndBarrierLoop1 = 1
-            self.holdingJobgoLoop1 = { 'cmd' : 'jobgo_loop_1', 'procinfo' : [] }
-        else:
-            self.holdingEndBarrierLoop1 = 0
-            self.holdingJobgoLoop1 = 0
-        self.jobStarted = 0
-        self.endBarrierDone = 0
-        # Main Loop
-        while not self.endBarrierDone:
-            if self.numDone >= self.numWithIO  and  (self.singinitPID or self.subproc):
-                clientExited = 1
-                clientExitStatus = 0
-            if self.holdingJobgoLoop1 and self.numConndWithIO >= self.numWithIO:
-                msgToSend = self.holdingJobgoLoop1
-                self.ring.rhsSock.send_dict_msg(msgToSend)
-                self.holdingJobgoLoop1 = 0
-            rv = self.streamHandler.handle_active_streams(timeout=5.0)
-            if rv[0] < 0:
-                if type(rv[1]) == ClassType  and  rv[1] == KeyboardInterrupt: # ^C
-                    sys.exit(-1)
-            if clientExited:
-                if self.jobStarted  and  not clientExitStatusSent:
-                    msgToSend = { 'cmd' : 'client_exit_status', 'man_id' : self.myId,
-                                  'cli_status' : clientExitStatus, 'cli_host' : self.myHost,
-                                  'cli_ifhn' : self.myIfhn, 'cli_pid' : clientPid,
-                                  'cli_rank' : self.myRank }
-                    if self.myRank == 0:
-                        if self.conSock:
-                            try:
-                                self.conSock.send_dict_msg(msgToSend)
-                            except:
-                                pass
-                    else:
-                        if self.ring.rhsSock:
-                            self.ring.rhsSock.send_dict_msg(msgToSend)
-                    clientExitStatusSent = 1
-                if self.holdingEndBarrierLoop1 and self.numDone >= self.numWithIO:
-                    self.holdingEndBarrierLoop1 = 0
-                    msgToSend = {'cmd' : 'end_barrier_loop_1'}
-                    self.ring.rhsSock.send_dict_msg(msgToSend)
-        mpd_print(0000, "out of loop")
-        # may want to wait for waitPids here
-    def handle_nonring_connection(self,sock):
-        (tempSock,tempConnAddr) = self.listenNonRingSock.accept()
-        msg = tempSock.recv_dict_msg()
-        if msg  and  msg.has_key('cmd'):
-            if msg['cmd'] == 'child_in_stdout_tree':
-                self.streamHandler.set_handler(tempSock,self.handle_child_stdout_tree_input)
-                self.childrenStdoutTreeSocks.append(tempSock)
-                self.numConndWithIO += 1
-            elif msg['cmd'] == 'child_in_stderr_tree':
-                self.streamHandler.set_handler(tempSock,self.handle_child_stderr_tree_input)
-                self.childrenStderrTreeSocks.append(tempSock)
-                self.numConndWithIO += 1
-            elif msg['cmd'] == 'spawned_man0_is_up':
-                self.streamHandler.set_handler(tempSock,self.handle_spawned_child_input)
-                self.spawnedChildSocks.append(tempSock)
-                tempID = msg['spawned_id']
-                spawnedKVSname = 'mpdman_kvs_for_spawned_' + tempID
-                msgToSend = { 'cmd' : 'preput_info_for_child',
-                              'kvs' : self.KVSs[spawnedKVSname] }
-                tempSock.send_dict_msg(msgToSend)
-                msgToSend = { 'cmd' : 'ringsize', 'ring_ncpus' : self.universeSize }
-                tempSock.send_dict_msg(msgToSend)
-            else:
-                mpd_print(1, 'unknown msg recvd on listenNonRingSock :%s:' % (msg) )
-    def handle_lhs_input(self,sock):
-        msg = self.ring.lhsSock.recv_dict_msg()
-        if not msg:
-            mpd_print(0000, 'lhs died' )
-            self.streamHandler.del_handler(self.ring.lhsSock)
-            self.ring.lhsSock.close()
-        elif msg['cmd'] == 'jobgo_loop_1':
-            if self.myRank == 0:
-                if self.totalview:
-                    msg['procinfo'].insert(0,(socket.gethostname(),self.clientPgm,clientPid))
-                # let console pgm proceed
-                msgToSend = { 'cmd' : 'job_started', 'jobid' : self.jobid,
-                              'procinfo' : msg['procinfo'] }
-                self.conSock.send_dict_msg(msgToSend,errprint=0)
-                msgToSend = { 'cmd' : 'jobgo_loop_2' }
-                self.ring.rhsSock.send_dict_msg(msgToSend)
-            else:
-                if self.totalview:
-                    msg['procinfo'].append((socket.gethostname(),self.clientPgm,clientPid))
-                if self.numConndWithIO >= self.numWithIO:
-                    self.ring.rhsSock.send_dict_msg(msg)  # forward it on
-                else:
-                    self.holdingJobgoLoop1 = msg
-        elif msg['cmd'] == 'jobgo_loop_2':
-            if self.myRank != 0:
-                self.ring.rhsSock.send_dict_msg(msg)  # forward it on
-            if not self.singinitPID:
-                self.handshake_sock_man_end.send_char_msg('go\n')
-                self.handshake_sock_man_end.close()
-            self.jobStarted = 1
-        elif msg['cmd'] == 'info_from_parent_in_tree':
-            if int(msg['to_rank']) == self.myRank:
-                self.parentIfhn = msg['parent_ifhn']
-                self.parentPort = msg['parent_port']
-                self.parentStdoutSock = MPDSock(name='stdout_ro_parent')
-                self.parentStdoutSock.connect((self.parentIfhn,self.parentPort))
-                msgToSend = { 'cmd' : 'child_in_stdout_tree', 'from_rank' : self.myRank }
-                self.parentStdoutSock.send_dict_msg(msgToSend)
-                self.parentStderrSock = MPDSock(name='stderr_ro_parent')
-                self.parentStderrSock.connect((self.parentIfhn,self.parentPort))
-                msgToSend = { 'cmd' : 'child_in_stderr_tree', 'from_rank' : self.myRank }
-                self.parentStderrSock.send_dict_msg(msgToSend)
-            else:
-                self.ring.rhsSock.send_dict_msg(msg)
-        elif msg['cmd'] == 'end_barrier_loop_1':
-            if self.myRank == 0:
-                msgToSend = { 'cmd' : 'end_barrier_loop_2' }
-                self.ring.rhsSock.send_dict_msg(msgToSend)
-            else:
-                if self.numDone >= self.numWithIO:
-                    if self.ring.rhsSock:
-                        self.ring.rhsSock.send_dict_msg(msg)
-                else:
-                    self.holdingEndBarrierLoop1 = 1
-        elif msg['cmd'] == 'end_barrier_loop_2':
-            self.endBarrierDone = 1
-            if self.myRank != 0:
-                self.ring.rhsSock.send_dict_msg(msg)
-        elif msg['cmd'] == 'pmi_barrier_loop_1':
-            if self.myRank == 0:
-                msgToSend = { 'cmd' : 'pmi_barrier_loop_2' }
-                self.ring.rhsSock.send_dict_msg(msgToSend)
-                if self.doingBNR:    ## BNR
-                    pmiMsgToSend = 'cmd=client_bnr_fence_out\n'
-                    self.pmiSock.send_char_msg(pmiMsgToSend)
-                    sleep(0.1)  # minor pause before intr
-                    os.kill(clientPid,signal.SIGUSR1)
-                else:
-                    if self.pmiSock:
-                        pmiMsgToSend = 'cmd=barrier_out\n'
-                        self.pmiSock.send_char_msg(pmiMsgToSend)
-            else:
-                self.holdingPMIBarrierLoop1 = 1
-                if self.pmiBarrierInRecvd:
-                    self.ring.rhsSock.send_dict_msg(msg)
-        elif msg['cmd'] == 'pmi_barrier_loop_2':
-            self.pmiBarrierInRecvd = 0
-            self.holdingPMIBarrierLoop1 = 0
-            if self.myRank != 0:
-                self.ring.rhsSock.send_dict_msg(msg)
-                if self.doingBNR:    ## BNR
-                    pmiMsgToSend = 'cmd=client_bnr_fence_out\n'
-                    self.pmiSock.send_char_msg(pmiMsgToSend)
-                    sleep(0.1)  # minor pause before intr
-                    os.kill(clientPid,signal.SIGUSR1)
-                else:
-                    if self.pmiSock:
-                        pmiMsgToSend = 'cmd=barrier_out\n'
-                        self.pmiSock.send_char_msg(pmiMsgToSend)
-        elif msg['cmd'] == 'pmi_get':
-            if msg['from_rank'] == self.myRank:
-                if self.pmiSock:  # may have disappeared in early shutdown
-                    pmiMsgToSend = 'cmd=get_result rc=-1 key="%s"\n' % msg['key']
-                    self.pmiSock.send_char_msg(pmiMsgToSend)
-            else:
-                key = msg['key']
-                kvsname = msg['kvsname']
-                if self.KVSs.has_key(kvsname)  and  self.KVSs[kvsname].has_key(key):
-                    value = self.KVSs[kvsname][key]
-                    msgToSend = { 'cmd' : 'response_to_pmi_get', 'key' : key,
-                                  'kvsname' : kvsname, 'value' : value,
-                                  'to_rank' : msg['from_rank'] }
-                    self.ring.rhsSock.send_dict_msg(msgToSend)
-                else:
-                    self.ring.rhsSock.send_dict_msg(msg)
-        elif msg['cmd'] == 'pmi_getbyidx':
-            if msg['from_rank'] == self.myRank:
-                if self.pmiSock:  # may have disappeared in early shutdown
-                    self.KVSs[self.default_kvsname].update(msg['kvs'])
-                    if self.KVSs[self.default_kvsname].keys():
-                        key = self.KVSs[self.default_kvsname].keys()[0]
-                        val = self.KVSs[self.default_kvsname][key]
-                        pmiMsgToSend = 'cmd=getbyidx_results rc=0 nextidx=1 key=%s val=%s\n' % \
-                                       (key,val)
-                    else:
-                        pmiMsgToSend = 'cmd=getbyidx_results rc=-2 reason=no_more_keyvals\n'
-                    self.pmiSock.send_char_msg(pmiMsgToSend)
-            else:
-                msg['kvs'].update(self.KVSs[self.default_kvsname])
-                self.ring.rhsSock.send_dict_msg(msg)
-        elif msg['cmd'] == 'response_to_pmi_get':
-            # [goodell@ 2009-05-05] The next few lines add caching in to the kvs
-            # gets to improve lookup performance and reduce MPI_Init times.
-            # Note that this doesn't handle consistency correctly if PMI is ever
-            # changed to permit overwriting keyvals.
-            if msg['kvsname'] not in self.KVSs.keys():
-                self.KVSs[msg['kvsname']] = dict()
-            self.KVSs[msg['kvsname']][msg['key']] = msg['value']
-
-            if msg['to_rank'] == self.myRank:
-                if self.pmiSock:  # may have disappeared in early shutdown
-                    pmiMsgToSend = 'cmd=get_result rc=0 value=%s\n' % (msg['value'])
-                    self.pmiSock.send_char_msg(pmiMsgToSend)
-            else:
-                self.ring.rhsSock.send_dict_msg(msg)
-        elif msg['cmd'] == 'signal':
-            if msg['signo'] == 'SIGINT':
-                if not self.gdb:
-                    self.jobEndingEarly = 1
-                for s in self.spawnedChildSocks:
-                    s.send_dict_msg(msg)
-                if self.myRank != 0:
-                    if self.ring.rhsSock:  # still alive ?
-                        self.ring.rhsSock.send_dict_msg(msg)
-                    if self.gdb:
-                        os.kill(clientPid,signal.SIGINT)
-                    else:
-                        try:
-                            pgrp = clientPid * (-1)   # neg Pid -> group
-                            os.kill(pgrp,signal.SIGKILL)   # may be reaped by sighandler
-                        except:
-                            pass
-            elif msg['signo'] == 'SIGKILL':
-                self.jobEndingEarly = 1
-                for s in self.spawnedChildSocks:
-                    s.send_dict_msg(msg)
-                if self.myRank != 0:
-                    if self.ring.rhsSock:  # still alive ?
-                        self.ring.rhsSock.send_dict_msg(msg)
-                    if self.gdb:
-                        os.kill(clientPid,signal.SIGUSR1)   # tell gdb driver to kill all
-                    else:
-                        try:
-                            pgrp = clientPid * (-1)   # neg Pid -> group
-                            os.kill(pgrp,signal.SIGKILL)   # may be reaped by sighandler
-                        except:
-                            pass
-            elif msg['signo'] == 'SIGTSTP':
-                if msg['dest'] != self.myId:
-                    self.ring.rhsSock.send_dict_msg(msg)
-                    try:
-                        pgrp = clientPid * (-1)   # neg Pid -> group
-                        os.kill(pgrp,signal.SIGTSTP)   # may be reaped by sighandler
-                    except:
-                        pass
-            elif msg['signo'] == 'SIGCONT':
-                if msg['dest'] != self.myId:
-                    self.ring.rhsSock.send_dict_msg(msg)
-                    try:
-                        pgrp = clientPid * (-1)   # neg Pid -> group
-                        os.kill(pgrp,signal.SIGCONT)   # may be reaped by sighandler
-                    except:
-                        pass
-        elif msg['cmd'] == 'client_exit_status':
-            if self.myRank == 0:
-                if self.conSock:
-                    self.conSock.send_dict_msg(msg,errprint=0)
-            else:
-                if self.ring.rhsSock:
-                    self.ring.rhsSock.send_dict_msg(msg)
-        elif msg['cmd'] == 'collective_abort':
-            self.jobEndingEarly = 1
-            if msg['src'] != self.myId:
-                if self.ring.rhsSock:  # still alive ?
-                    self.ring.rhsSock.send_dict_msg(msg)
-            if self.conSock:
-                msgToSend = { 'cmd' : 'job_aborted_early', 'jobid' : self.jobid,
-                              'rank' : msg['rank'], 
-                              'exit_status' : msg['exit_status'] }
-                self.conSock.send_dict_msg(msgToSend,errprint=0)
-            try:
-                pgrp = clientPid * (-1)   # neg Pid -> group
-                os.kill(pgrp,signal.SIGKILL)   # may be reaped by sighandler
-            except:
-                pass
-        elif msg['cmd'] == 'startup_status':
-            if msg['rc'] < 0:
-                self.jobEndingEarly = 1
-                try:
-                    pgrp = clientPid * (-1)   # neg Pid -> group
-                    os.kill(pgrp,signal.SIGKILL)   # may be reaped by sighandler
-                except:
-                    pass
-            ##### RMB if msg['src'] == self.myId:
-            if self.myRank == 0:
-                if self.conSock:
-                    self.conSock.send_dict_msg(msg,errprint=0)
-            else:
-                if msg['src'] != self.myId  and  self.ring.rhsSock:  # rhs still alive ?
-                    self.ring.rhsSock.send_dict_msg(msg)
-        elif msg['cmd'] == 'stdin_from_user':
-            if msg['src'] != self.myId:
-                self.ring.rhsSock.send_dict_msg(msg)
-                if in_stdinRcvrs(self.myRank,self.stdinDest):
-                    if msg.has_key('eof'):
-                        if self.subproc:    # must close subproc's file (not just the fd)
-                            self.subproc.stdin.close()
-                        else:
-                            os.close(self.fd_write_cli_stdin)
-                    else:
-                        os.write(self.fd_write_cli_stdin,msg['line'])
-        elif msg['cmd'] == 'stdin_dest':
-            if msg['src'] != self.myId:
-                self.stdinDest = msg['stdin_procs']
-                self.ring.rhsSock.send_dict_msg(msg)
-        elif msg['cmd'] == 'interrupt_peer_with_msg':    ## BNR
-            if int(msg['torank']) == self.myRank:
-                if self.pmiSock:  # may have disappeared in early shutdown
-                    pmiMsgToSend = '%s\n' % (msg['msg'])
-                    self.pmiSock.send_char_msg(pmiMsgToSend)
-                    sleep(0.1)  # minor pause before intr
-                    os.kill(clientPid,signal.SIGUSR1)
-            else:
-                self.ring.rhsSock.send_dict_msg(msg)
-        elif msg['cmd'] == 'tv_ready':
-            self.tvReady = 1
-            if self.myRank != 0:
-                msg['src'] = self.myId
-                self.ring.rhsSock.send_dict_msg(msg)
-                if self.pmiSock:    # should be valid sock if running tv
-                    pmiMsgToSend = 'cmd=tv_ready\n'
-                    self.pmiSock.send_char_msg(pmiMsgToSend)
-        else:
-            mpd_print(1, 'unexpected msg recvd on lhsSock :%s:' % msg )
-
-    def handle_rhs_input(self,sock):
-        msg = self.ring.rhsSock.recv_dict_msg()  #### NOT USING msg; should I ?
-        mpd_print(0000, 'rhs died' )
-        self.streamHandler.del_handler(self.ring.rhsSock)
-        self.ring.rhsSock.close()
-        self.ring.rhsSock = 0
-    def handle_cli_stdout_input(self,sock):
-        line = mpd_read_nbytes(sock,1024)  # sock is self.fd_read_cli_stdout
-        if not line:
-            if self.subproc:    # must close subproc's file (not just the fd)
-                self.subproc.stdout.close()
-            else:
-                self.streamHandler.del_handler(self.fd_read_cli_stdout)
-                os.close(self.fd_read_cli_stdout)
-            self.numDone += 1
-            if self.numDone >= self.numWithIO:
-                if self.parentStdoutSock:
-                    self.parentStdoutSock.close()
-                    self.parentStdoutSock = 0
-                if self.parentStderrSock:
-                    self.parentStderrSock.close()
-                    self.parentStderrSock = 0
-        else:
-            if self.parentStdoutSock:
-                if self.lineLabelFmt:
-                    lineLabel = self.create_line_label(self.lineLabelFmt,self.spawned)
-                    splitLine = line.split('\n',1024)
-                    if self.startStdoutLineLabel:
-                        line = lineLabel
-                    else:
-                        line = ''
-                    if splitLine[-1] == '':
-                        self.startStdoutLineLabel = 1
-                        del splitLine[-1]
-                    else:
-                        self.startStdoutLineLabel = 0
-                    for s in splitLine[0:-1]:
-                        line = line + s + '\n' + lineLabel
-                    line = line + splitLine[-1]
-                    if self.startStdoutLineLabel:
-                        line = line + '\n'
-                self.parentStdoutSock.send_char_msg(line,errprint=0)
-        return line
-    def handle_cli_stderr_input(self,sock):
-        line = mpd_read_nbytes(sock,1024)  # sock is self.fd_read_cli_stderr
-        if not line:
-            if self.subproc:    # must close subproc's file (not just the fd)
-                self.subproc.stderr.close()
-            else:
-                self.streamHandler.del_handler(self.fd_read_cli_stderr)
-                os.close(self.fd_read_cli_stderr)
-            self.numDone += 1
-            if self.numDone >= self.numWithIO:
-                if self.parentStdoutSock:
-                    self.parentStdoutSock.close()
-                    self.parentStdoutSock = 0
-                if self.parentStderrSock:
-                    self.parentStderrSock.close()
-                    self.parentStderrSock = 0
-        else:
-            if self.parentStderrSock:
-                if self.lineLabelFmt:
-                    lineLabel = self.create_line_label(self.lineLabelFmt,self.spawned)
-                    splitLine = line.split('\n',1024)
-                    if self.startStderrLineLabel:
-                        line = lineLabel
-                    else:
-                        line = ''
-                    if splitLine[-1] == '':
-                        self.startStderrLineLabel = 1
-                        del splitLine[-1]
-                    else:
-                        self.startStderrLineLabel = 0
-                    for s in splitLine[0:-1]:
-                        line = line + s + '\n' + lineLabel
-                    line = line + splitLine[-1]
-                    if self.startStderrLineLabel:
-                        line = line + '\n'
-                self.parentStderrSock.send_char_msg(line,errprint=0)
-        return line
-    def handle_child_stdout_tree_input(self,sock):
-        if self.lineLabelFmt:
-            line = sock.recv_one_line()
-        else:
-            line = sock.recv(1024)
-        if not line:
-            self.streamHandler.del_handler(sock)
-            sock.close()
-            self.numDone += 1
-            if self.numDone >= self.numWithIO:
-                if self.parentStdoutSock:
-                    self.parentStdoutSock.close()
-                    self.parentStdoutSock = 0
-                if self.parentStderrSock:
-                    self.parentStderrSock.close()
-                    self.parentStderrSock = 0
-        else:
-            if self.parentStdoutSock:
-                self.parentStdoutSock.send_char_msg(line,errprint=0)
-                # parentStdoutSock.sendall('FWD by %d: |%s|' % (self.myRank,line) )
-    def handle_child_stderr_tree_input(self,sock):
-        if self.lineLabelFmt:
-            line = sock.recv_one_line()
-        else:
-            line = sock.recv(1024)
-        if not line:
-            self.streamHandler.del_handler(sock)
-            sock.close()
-            self.numDone += 1
-            if self.numDone >= self.numWithIO:
-                if self.parentStdoutSock:
-                    self.parentStdoutSock.close()
-                    self.parentStdoutSock = 0
-                if self.parentStderrSock:
-                    self.parentStderrSock.close()
-                    self.parentStderrSock = 0
-        else:
-            if self.parentStderrSock:
-                self.parentStderrSock.send_char_msg(line,errprint=0)
-                # parentStdoutSock.sendall('FWD by %d: |%s|' % (self.myRank,line) )
-    def handle_spawned_child_input(self,sock):
-        msg = sock.recv_dict_msg()
-        if not msg:
-            self.streamHandler.del_handler(sock)
-            self.spawnedChildSocks.remove(sock)
-            sock.close()
-        elif msg['cmd'] == 'job_started':
-            pass
-        elif msg['cmd'] == 'client_exit_status':
-            if self.myRank == 0:
-                if self.conSock:
-                    self.conSock.send_dict_msg(msg,errprint=0)
-            else:
-                if self.ring.rhsSock:
-                    self.ring.rhsSock.send_dict_msg(msg)
-        elif msg['cmd'] == 'job_aborted_early':
-            if self.conSock:
-                msgToSend = { 'cmd' : 'job_aborted_early', 'jobid' : msg['jobid'],
-                              'rank' : msg['rank'], 
-                              'exit_status' : msg['exit_status'] }
-                self.conSock.send_dict_msg(msgToSend,errprint=0)
-        elif msg['cmd'] == 'startup_status':
-            # remember this rc to put in spawn_result
-            self.spawnInProgress['errcodes'][msg['rank']] = msg['rc']
-            if None not in self.spawnInProgress['errcodes']:  # if all errcodes are now filled in
-                # send pmi msg to spawner
-                strerrcodes = ''  # put errcodes in str format for pmi msg
-                for ec in self.spawnInProgress['errcodes']:
-                    strerrcodes = strerrcodes + str(ec) + ','
-                strerrcodes = strerrcodes[:-1]
-                if self.pmiSock:  # may have disappeared in early shutdown
-                    # may want to make rc < 0 if any errcode is < 0
-                    pmiMsgToSend = 'cmd=spawn_result rc=0 errcodes=%s\n' % (strerrcodes)
-                    self.pmiSock.send_char_msg(pmiMsgToSend)
-                self.spawnInProgress = 0
-        else:
-            mpd_print(1, "unrecognized msg from spawned child :%s:" % msg )
-    def handle_pmi_connection(self,sock):
-        if self.pmiSock:  # already have one
-            pmiMsgToSend = 'cmd=you_already_have_an_open_pmi_conn_to_me\n'
-            self.pmiSock.send_char_msg(pmiMsgToSend)
-            self.streamHandler.del_handler(self.pmiSock)
-            self.pmiSock.close()
-            self.pmiSock = 0
-            errmsg = "mpdman: invalid attempt to open 2 simultaneous pmi connections\n" + \
-                     "  client=%s  cwd=%s" % (self.clientPgm,os.environ['MPDMAN_CWD'])
-            print errmsg ; sys.stdout.flush()
-            clientExitStatus = 137  # assume kill -9 below
-            msgToSend = { 'cmd' : 'collective_abort',
-                          'src' : self.myId, 'rank' : self.myRank,
-                          'exit_status' : clientExitStatus }
-            self.ring.rhsSock.send_dict_msg(msgToSend)
-            return
-        (self.pmiSock,tempConnAddr) = self.pmiListenSock.accept()
-        # the following lines are commented out so that we can support a process
-        # that runs 2 MPI pgms in tandem  (e.g. mpish at ANL)
-        ##### del socksToSelect[pmiListenSock]
-        ##### pmiListenSock.close()
-        if not self.pmiSock:
-            mpd_print(1,"failed accept for pmi connection from client")
-            sys.exit(-1)
-        self.pmiSock.name = 'pmi'
-        self.streamHandler.set_handler(self.pmiSock,self.handle_pmi_input)
-        if self.tvReady:
-            pmiMsgToSend = 'cmd=tv_ready\n'
-            self.pmiSock.send_char_msg(pmiMsgToSend)
-    def handle_pmi_input(self,sock):
-        global clientPid, clientExited, clientExitStatus, clientExitStatusSent
-        if self.spawnInProgress:
-            return
-        line = self.pmiSock.recv_char_msg()
-        if not line:
-            self.streamHandler.del_handler(self.pmiSock)
-            self.pmiSock.close()
-            self.pmiSock = 0
-            if self.pmiCollectiveJob:
-                if self.ring.rhsSock:  # still alive ?
-                    if not self.jobEndingEarly:  # if I did not already know this
-                        if not clientExited:
-                            clientExitStatus = 137  # assume kill -9 below
-                        msgToSend = { 'cmd' : 'collective_abort',
-                                      'src' : self.myId, 'rank' : self.myRank,
-                                      'exit_status' : clientExitStatus }
-                        self.ring.rhsSock.send_dict_msg(msgToSend)
-                try:
-                    pgrp = clientPid * (-1)   # neg Pid -> group
-                    os.kill(pgrp,signal.SIGKILL)   # may be reaped by sighandler
-                except:
-                    pass
-            return
-        if line.startswith('mcmd='):
-            parsedMsg = {}
-            line = line.rstrip()
-            splitLine = line.split('=',1)
-            parsedMsg['cmd'] = splitLine[1]
-            line = ''
-            while not line.startswith('endcmd'):
-                line = self.pmiSock.recv_char_msg()
-                if not line.startswith('endcmd'):
-                    line = line.rstrip()
-                    splitLine = line.split('=',1)
-                    parsedMsg[splitLine[0]] = splitLine[1]
-        else:
-            parsedMsg = parse_pmi_msg(line)
-        if not parsedMsg.has_key('cmd'):
-            pmiMsgToSend = 'cmd=unparseable_msg rc=-1\n'
-            self.pmiSock.send_char_msg(pmiMsgToSend)
-            return
-        # startup_status may be sent here from new process BEFORE starting client
-        if parsedMsg['cmd'] == 'startup_status':
-            msgToSend = { 'cmd' : 'startup_status', 'src' : self.myId, 
-                          'rc' : parsedMsg['rc'],
-                          'jobid' : self.jobid, 'rank' : self.myRank,
-                          'exec' : parsedMsg['exec'], 'reason' : parsedMsg['reason']  }
-            if self.ring.rhsSock:
-                self.ring.rhsSock.send_dict_msg(msgToSend)
-        elif parsedMsg['cmd'] == 'init':
-            self.pmiCollectiveJob = 1
-            version = int(parsedMsg['pmi_version'])
-            subversion = int(parsedMsg['pmi_subversion'])
-            if self.pmiVersion == version  and  self.pmiSubversion >= subversion:
-                rc = 0
-            else:
-                rc = -1
-            pmiMsgToSend = 'cmd=response_to_init pmi_version=%d pmi_subversion=%d rc=%d\n' % \
-                           (self.pmiVersion,self.pmiSubversion,rc)
-            self.pmiSock.send_char_msg(pmiMsgToSend)
-            msgToSend = { 'cmd' : 'startup_status', 'src' : self.myId, 'rc' : 0,
-                          'jobid' : self.jobid, 'rank' : self.myRank,
-                          'exec' : '', 'reason' : ''  }
-            self.ring.rhsSock.send_dict_msg(msgToSend)
-        elif parsedMsg['cmd'] == 'get_my_kvsname':
-            pmiMsgToSend = 'cmd=my_kvsname kvsname=%s\n' % (self.default_kvsname)
-            self.pmiSock.send_char_msg(pmiMsgToSend)
-        elif parsedMsg['cmd'] == 'get_maxes':
-            pmiMsgToSend = 'cmd=maxes kvsname_max=4096 ' + \
-                           'keylen_max=4096 vallen_max=4096\n'
-            self.pmiSock.send_char_msg(pmiMsgToSend)
-        elif parsedMsg['cmd'] == 'get_universe_size':
-            pmiMsgToSend = 'cmd=universe_size size=%s\n' % (self.universeSize)
-            self.pmiSock.send_char_msg(pmiMsgToSend)
-        elif parsedMsg['cmd'] == 'get_appnum':
-            pmiMsgToSend = 'cmd=appnum appnum=%s\n' % (self.appnum)
-            self.pmiSock.send_char_msg(pmiMsgToSend)
-        elif parsedMsg['cmd'] == 'publish_name':
-            msgToSend = { 'cmd' : 'publish_name',
-                          'service' : parsedMsg['service'],
-                          'port' : parsedMsg['port'],
-                          'jobid' : self.jobid,
-                          'manpid' : os.getpid() }
-            self.mpdSock.send_dict_msg(msgToSend)
-        elif parsedMsg['cmd'] == 'unpublish_name':
-            msgToSend = { 'cmd' : 'unpublish_name',
-                          'service' : parsedMsg['service'],
-                          'jobid' : self.jobid,
-                          'manpid' : os.getpid() }
-            self.mpdSock.send_dict_msg(msgToSend)
-        elif parsedMsg['cmd'] == 'lookup_name':
-            msgToSend = { 'cmd' : 'lookup_name',
-                          'service' : parsedMsg['service'],
-                          'jobid' : self.jobid,
-                          'manpid' : os.getpid() }
-            self.mpdSock.send_dict_msg(msgToSend)
-        elif parsedMsg['cmd'] == 'create_kvs':
-            new_kvsname = self.kvsname_template + str(self.kvs_next_id)
-            self.KVSs[new_kvsname] = {}
-            self.kvs_next_id += 1
-            pmiMsgToSend = 'cmd=newkvs kvsname=%s\n' % (new_kvsname)
-            self.pmiSock.send_char_msg(pmiMsgToSend)
-        elif parsedMsg['cmd'] == 'destroy_kvs':
-            kvsname = parsedMsg['kvsname']
-            try:
-                del self.KVSs[kvsname]
-                pmiMsgToSend = 'cmd=kvs_destroyed rc=0\n'
-            except:
-                pmiMsgToSend = 'cmd=kvs_destroyed rc=-1\n'
-            self.pmiSock.send_char_msg(pmiMsgToSend)
-        elif parsedMsg['cmd'] == 'put':
-            kvsname = parsedMsg['kvsname']
-            key = parsedMsg['key']
-            value = parsedMsg['value']
-            try:
-                self.KVSs[kvsname][key] = value
-                pmiMsgToSend = 'cmd=put_result rc=0\n'
-                self.pmiSock.send_char_msg(pmiMsgToSend)
-            except Exception, errmsg:
-                pmiMsgToSend = 'cmd=put_result rc=-1 msg="%s"\n' % errmsg
-                self.pmiSock.send_char_msg(pmiMsgToSend)
-        elif parsedMsg['cmd'] == 'barrier_in':
-            self.pmiBarrierInRecvd = 1
-            if self.myRank == 0  or  self.holdingPMIBarrierLoop1:
-                msgToSend = { 'cmd' : 'pmi_barrier_loop_1' }
-                self.ring.rhsSock.send_dict_msg(msgToSend)
-        elif parsedMsg['cmd'] == 'get':
-            key = parsedMsg['key']
-            kvsname = parsedMsg['kvsname']
-            if self.KVSs.has_key(kvsname)  and  self.KVSs[kvsname].has_key(key):
-                value = self.KVSs[kvsname][key]
-                pmiMsgToSend = 'cmd=get_result rc=0 value=%s\n' % (value)
-                self.pmiSock.send_char_msg(pmiMsgToSend)
-            else:
-                msgToSend = { 'cmd' : 'pmi_get', 'key' : key,
-                              'kvsname' : kvsname, 'from_rank' : self.myRank }
-                self.ring.rhsSock.send_dict_msg(msgToSend)
-        elif parsedMsg['cmd'] == 'getbyidx':
-            kvsname = parsedMsg['kvsname']
-            idx = int(parsedMsg['idx'])
-            if idx == 0:
-                msgToSend = { 'cmd' : 'pmi_getbyidx', 'kvsname' : kvsname,
-                              'from_rank' : self.myRank,
-                              'kvs' : self.KVSs[self.default_kvsname] }
-                self.ring.rhsSock.send_dict_msg(msgToSend)
-            else:
-                if len(self.KVSs[self.default_kvsname].keys()) > idx:
-                    key = self.KVSs[self.default_kvsname].keys()[idx]
-                    val = self.KVSs[self.default_kvsname][key]
-                    nextidx = idx + 1
-                    pmiMsgToSend = 'cmd=getbyidx_results rc=0 nextidx=%d key=%s val=%s\n' % \
-                                   (nextidx,key,val)
-                else:
-                    pmiMsgToSend = 'cmd=getbyidx_results rc=-2 reason=no_more_keyvals\n'
-                self.pmiSock.send_char_msg(pmiMsgToSend)
-        elif parsedMsg['cmd'] == 'spawn':
-            ## This code really is handling PMI_Spawn_multiple.  It translates a
-            ## sequence of separate spawn messages into a single message to send
-            ## to the mpd.  It keeps track by the "totspawns" and "spawnssofar"
-            ## parameters in the incoming message.  The first message has
-            ## "spawnssofar" set to 1. 
-            ##
-            ## This proc may produce stdout and stderr; do this early so I
-            ## won't exit before child sets up its conns with me.
-            ## NOTE: if you spawn a non-MPI job, it may not send these msgs
-            ## in which case adding 2 to numWithIO will cause the pgm to hang.
-            totspawns = int(parsedMsg['totspawns'])
-            spawnssofar = int(parsedMsg['spawnssofar'])
-            if spawnssofar == 1: # this is the first of possibly several spawn msgs
-                self.numWithIO += 2
-                self.tpsf = 0             # total processes spawned so far
-                self.spawnExecs = {}      # part of MPI_Spawn_multiple args
-                self.spawnHosts = {}      # comes from info
-                self.spawnUsers = {}      # always the current user
-                self.spawnCwds  = {}      # could come from info, but doesn't yet
-                self.spawnUmasks = {}     # could come from info, but doesn't yet
-                self.spawnPaths = {}      # could come from info, but doesn't yet
-                self.spawnEnvvars = {}    # whole environment from mpiexec, plus appnum
-                self.spawnLimits = {}
-                self.spawnArgs = {}
-            self.spawnNprocs  = int(parsedMsg['nprocs']) # num procs in this spawn
-            pmiInfo = {}
-            for i in range(0,int(parsedMsg['info_num'])):
-                info_key = parsedMsg['info_key_%d' % i]
-                info_val = parsedMsg['info_val_%d' % i]
-                pmiInfo[info_key] = info_val
-
-            if pmiInfo.has_key('host'):
-                try:
-                    toIfhn = socket.gethostbyname_ex(pmiInfo['host'])[2][0]
-                    self.spawnHosts[(self.tpsf,self.tpsf+self.spawnNprocs-1)] = toIfhn
-                except:
-                    mpd_print(1, "unable to obtain host info for :%s:" % (pmiInfo['host']))
-                    pmiMsgToSend = 'cmd=spawn_result rc=-2 status=unknown_host\n'
-                    self.pmiSock.send_char_msg(pmiMsgToSend)
-                    return
-            else:
-                self.spawnHosts[(self.tpsf,self.tpsf+self.spawnNprocs-1)] = '_any_'
-            if pmiInfo.has_key('path'):
-                self.spawnPaths[(self.tpsf,self.tpsf+self.spawnNprocs-1)] = pmiInfo['path']
-            else:
-                self.spawnPaths[(self.tpsf,self.tpsf+self.spawnNprocs-1)] = os.environ['MPDMAN_CLI_PATH']
-            if pmiInfo.has_key('wdir'):
-                self.spawnCwds[(self.tpsf,self.tpsf+self.spawnNprocs-1)] = pmiInfo['wdir']
-            else:
-                self.spawnCwds[(self.tpsf,self.tpsf+self.spawnNprocs-1)] = os.environ['MPDMAN_CWD']
-            if pmiInfo.has_key('umask'):
-                self.spawnUmasks[(self.tpsf,self.tpsf+self.spawnNprocs-1)] = pmiInfo['umask'] 
-            else:
-                self.spawnUmasks[(self.tpsf,self.tpsf+self.spawnNprocs-1)]  = os.environ['MPDMAN_UMASK']
-            self.spawnExecs[(self.tpsf,self.tpsf+self.spawnNprocs-1)] = parsedMsg['execname']
-            self.spawnUsers[(self.tpsf,self.tpsf+self.spawnNprocs-1)] = mpd_get_my_username()
-            self.spawnEnv = {}
-            self.spawnEnv.update(os.environ)
-            self.spawnEnv['MPI_APPNUM'] = str(spawnssofar-1)
-            self.spawnEnvvars[(self.tpsf,self.tpsf+self.spawnNprocs-1)] = self.spawnEnv
-            self.spawnLimits[(self.tpsf,self.tpsf+self.spawnNprocs-1)] = {} # not implemented yet
-            ##### args[(tpsf,tpsf+spawnNprocs-1) = [ parsedMsg['args'] ]
-            ##### args[(tpsf,tpsf+spawnNprocs-1) = [ 'AA', 'BB', 'CC' ]
-            cliArgs = []
-            cliArgcnt = int(parsedMsg['argcnt'])
-            for i in range(1,cliArgcnt+1):    # start at 1
-                cliArgs.append(parsedMsg['arg%d' % i])
-            self.spawnArgs[(self.tpsf,self.tpsf+self.spawnNprocs-1)] = cliArgs
-            self.tpsf += self.spawnNprocs
-
-            if totspawns == spawnssofar:    # This is the last in the spawn sequence
-                self.spawnedCnt += 1    # non-zero to use for creating kvsname in msg below
-                msgToSend = { 'cmd'          : 'spawn',
-                              'conhost'      : self.myHost,
-                              'conifhn'      : self.myIfhn,
-                              'conport'      : self.listenNonRingPort,
-                              'spawned'      : self.spawnedCnt,
-                              'jobid'        : self.jobid,
-                              'nstarted'     : 0,
-                              'nprocs'       : self.tpsf,
-                              'hosts'        : self.spawnHosts,
-                              'execs'        : self.spawnExecs,
-                              'users'        : self.spawnUsers,
-                              'cwds'         : self.spawnCwds,
-                              'umasks'       : self.spawnUmasks,
-                              'paths'        : self.spawnPaths,
-                              'args'         : self.spawnArgs,
-                              'envvars'      : self.spawnEnvvars,
-                              'limits'       : self.spawnLimits,
-                              'singinitpid'  : 0,
-                              'singinitport' : 0,
-                            }
-                msgToSend['line_labels'] = self.lineLabelFmt
-                msgToSend['spawner_manpid'] = os.getpid()
-                self.mpdSock.send_dict_msg(msgToSend)
-                self.spawnInProgress = parsedMsg
-                self.spawnInProgress['errcodes'] = [None] * self.tpsf  # one for each spawn
-                # I could send the preput_info along but will keep it here
-                # and let the spawnee call me up and ask for it; he will
-                # call me anyway since I am his parent in the tree.  So, I
-                # will create a KVS to hold the info until he calls
-                self.spawnedKVSname = 'mpdman_kvs_for_spawned_' + str(self.spawnedCnt)
-                self.KVSs[self.spawnedKVSname] = {}
-                preput_num = int(parsedMsg['preput_num'])
-                for i in range(0,preput_num):
-                    preput_key = parsedMsg['preput_key_%d' % i]
-                    preput_val = parsedMsg['preput_val_%d' % i]
-                    self.KVSs[self.spawnedKVSname][preput_key] = preput_val
-        elif parsedMsg['cmd'] == 'finalize':
-            # the following lines are present to support a process that runs
-            # 2 MPI pgms in tandem (e.g. mpish at ANL)
-            self.KVSs = {}
-            self.KVSs[self.default_kvsname] = {}
-            self.kvs_next_id = 1
-            self.jobEndingEarly = 0
-            self.pmiCollectiveJob = 0
-            self.spawnedCnt = 0
-            pmiMsgToSend = 'cmd=finalize_ack\n' 
-            self.pmiSock.send_char_msg(pmiMsgToSend)
-        elif parsedMsg['cmd'] == 'client_bnr_fence_in':    ## BNR
-            self.pmiBarrierInRecvd = 1
-            if self.myRank == 0  or  self.holdingPMIBarrierLoop1:
-                msgToSend = { 'cmd' : 'pmi_barrier_loop_1' }
-                self.ring.rhsSock.send_dict_msg(msgToSend)
-        elif parsedMsg['cmd'] == 'client_bnr_put':         ## BNR
-            key = parsedMsg['attr']
-            value = parsedMsg['val']
-            try:
-                self.KVSs[self.default_kvsname][key] = value
-                pmiMsgToSend = 'cmd=put_result rc=0\n'
-                self.pmiSock.send_char_msg(pmiMsgToSend)
-            except Exception, errmsg:
-                pmiMsgToSend = 'cmd=put_result rc=-1 msg="%s"\n' % errmsg
-                self.pmiSock.send_char_msg(pmiMsgToSend)
-        elif parsedMsg['cmd'] == 'client_bnr_get':          ## BNR
-            key = parsedMsg['attr']
-            if self.KVSs[self.default_kvsname].has_key(key):
-                value = self.KVSs[self.default_kvsname][key]
-                pmiMsgToSend = 'cmd=client_bnr_get_output rc=0 val=%s\n' % (value)
-                self.pmiSock.send_char_msg(pmiMsgToSend)
-            else:
-                msgToSend = { 'cmd' : 'bnr_get', 'key' : key,
-                              'kvsname' : kvsname, 'from_rank' : self.myRank }
-                self.ring.rhsSock.send_dict_msg(msgToSend)
-        elif parsedMsg['cmd'] == 'client_ready':               ## BNR
-            ## continue to wait for accepting_signals
-            pass
-        elif parsedMsg['cmd'] == 'accepting_signals':          ## BNR
-            ## handle it like a barrier_in ??
-            self.pmiBarrierInRecvd = 1
-            self.doingBNR = 1    ## BNR  # set again is OK
-        elif parsedMsg['cmd'] == 'interrupt_peer_with_msg':    ## BNR
-            self.ring.rhsSock.send_dict_msg(parsedMsg)
-        else:
-            mpd_print(1, "unrecognized pmi msg :%s:" % line )
-    def handle_console_input(self,sock):
-        msg = self.conSock.recv_dict_msg()
-        if not msg:
-            if self.conSock:
-                self.streamHandler.del_handler(self.conSock)
-                self.conSock.close()
-                self.conSock = 0
-            if self.parentStdoutSock:
-                self.streamHandler.del_handler(self.parentStdoutSock)
-                self.parentStdoutSock.close()
-                self.parentStdoutSock = 0
-            if self.parentStderrSock:
-                self.streamHandler.del_handler(self.parentStderrSock)
-                self.parentStderrSock.close()
-                self.parentStderrSock = 0
-            if self.ring.rhsSock:
-                msgToSend = { 'cmd' : 'signal', 'signo' : 'SIGKILL' }
-                self.ring.rhsSock.send_dict_msg(msgToSend)
-            try:
-                pgrp = clientPid * (-1)   # neg Pid -> group
-                os.kill(pgrp,signal.SIGKILL)   # may be reaped by sighandler
-            except:
-                pass
-        elif msg['cmd'] == 'signal':
-            if msg['signo'] == 'SIGINT':
-                self.ring.rhsSock.send_dict_msg(msg)
-                for s in self.spawnedChildSocks:
-                    s.send_dict_msg(msg)
-                if self.gdb:
-                    os.kill(clientPid,signal.SIGINT)
-                else:
-                    try:
-                        pgrp = clientPid * (-1)   # neg Pid -> group
-                        os.kill(pgrp,signal.SIGKILL)   # may be reaped by sighandler
-                    except:
-                        pass
-            elif msg['signo'] == 'SIGKILL':
-                try:
-                    self.ring.rhsSock.send_dict_msg(msg)
-                except:
-                    pass
-                for s in self.spawnedChildSocks:
-                    try:
-                        s.send_dict_msg(msg)
-                    except:
-                        pass
-                if self.gdb:
-                    os.kill(clientPid,signal.SIGUSR1)    # tell gdb driver to kill all
-                else:
-                    try:
-                        pgrp = clientPid * (-1)   # neg Pid -> group
-                        os.kill(pgrp,signal.SIGKILL)   # may be reaped by sighandler
-                    except:
-                        pass
-            elif msg['signo'] == 'SIGTSTP':
-                msg['dest'] = self.myId
-                self.ring.rhsSock.send_dict_msg(msg)
-                try:
-                    pgrp = clientPid * (-1)   # neg Pid -> group
-                    os.kill(pgrp,signal.SIGTSTP)   # may be reaped by sighandler
-                except:
-                    pass
-            elif msg['signo'] == 'SIGCONT':
-                msg['dest'] = self.myId
-                self.ring.rhsSock.send_dict_msg(msg)
-                try:
-                    pgrp = clientPid * (-1)   # neg Pid -> group
-                    os.kill(pgrp,signal.SIGCONT)   # may be reaped by sighandler
-                except:
-                    pass
-        elif msg['cmd'] == 'stdin_from_user':
-            msg['src'] = self.myId
-            if self.ring.rhsSock:
-                # Only send to rhs if that sock is open
-                self.ring.rhsSock.send_dict_msg(msg)
-            if in_stdinRcvrs(self.myRank,self.stdinDest):
-                try:
-                    if msg.has_key('eof'):
-                        if self.subproc:    # must close subproc's file (not just the fd)
-                            self.subproc.stdin.close()
-                        else:
-                            os.close(self.fd_write_cli_stdin)
-                    else:
-                        os.write(self.fd_write_cli_stdin,msg['line'])
-                except:
-                    mpd_print(1, 'cannot send stdin to client')
-        elif msg['cmd'] == 'stdin_dest':
-            self.stdinDest = msg['stdin_procs']
-            msg['src'] = self.myId
-            if self.ring.rhsSock:
-                # Only send to rhs if that sock is open
-                self.ring.rhsSock.send_dict_msg(msg)
-        elif msg['cmd'] == 'tv_ready':
-            self.tvReady = 1
-            msg['src'] = self.myId
-            self.ring.rhsSock.send_dict_msg(msg)
-            if self.pmiSock:    # should be valid sock if running tv
-                pmiMsgToSend = 'cmd=tv_ready\n'
-                self.pmiSock.send_char_msg(pmiMsgToSend)
-        else:
-            mpd_print(1, 'unexpected msg recvd on conSock :%s:' % msg )
-    def handle_mpd_input(self,sock):
-        msg = self.mpdSock.recv_dict_msg()
-        mpd_print(0000, 'msg recvd on mpdSock :%s:' % msg )
-        if not msg:
-            if self.conSock:
-                msgToSend = { 'cmd' : 'job_aborted', 'reason' : 'mpd disappeared',
-                              'jobid' : self.jobid }
-                self.conSock.send_dict_msg(msgToSend,errprint=0)
-                self.streamHandler.del_handler(self.conSock)
-                self.conSock.close()
-                self.conSock = 0
-            try:
-                os.kill(0,signal.SIGKILL)  # pid 0 -> all in my process group
-            except:
-                pass
-            sys.exit(0)
-        if msg['cmd'] == 'abortjob':
-            mpd_print(1, "job aborted by mpd; reason=%s" % (msg['reason']))
-        elif msg['cmd'] == 'startup_status':  # probably some hosts not found
-            if self.pmiSock:  # may have disappeared in early shutdown
-                pmiMsgToSend = 'cmd=spawn_result rc=-1 errcodes='' reason=%s\n' % (msg['reason'])
-                self.pmiSock.send_char_msg(pmiMsgToSend)
-        elif msg['cmd'] == 'signal_to_handle'  and  msg.has_key('sigtype'):
-            if msg['sigtype'].isdigit():
-                signum = int(msg['sigtype'])
-            else:
-                exec('signum = %s' % 'signal.SIG' + msg['sigtype'])
-            try:    
-                if msg['s_or_g'] == 's':    # single (not entire group)
-                    pgrp = clientPid          # just client process
-                else:
-                    pgrp = clientPid * (-1)   # neg Pid -> process group
-                os.kill(pgrp,signum)
-            except Exception, errmsg:
-                mpd_print(1, 'invalid signal (%d) from mpd' % (signum) )
-        elif msg['cmd'] == 'publish_result':
-            if self.pmiSock:
-                pmiMsgToSend = 'cmd=publish_result info=%s\n' % (msg['info'])
-                self.pmiSock.send_char_msg(pmiMsgToSend)
-        elif msg['cmd'] == 'unpublish_result':
-            if self.pmiSock:
-                pmiMsgToSend = 'cmd=unpublish_result info=%s\n' % (msg['info'])
-                self.pmiSock.send_char_msg(pmiMsgToSend)
-        elif msg['cmd'] == 'lookup_result':
-            if self.pmiSock:
-                pmiMsgToSend = 'cmd=lookup_result info=%s port=%s\n' % \
-                               (msg['info'],msg['port'])
-                self.pmiSock.send_char_msg(pmiMsgToSend)
-        elif msg['cmd'] == 'spawn_done_by_mpd':
-            pass
-        else:
-            mpd_print(1, 'invalid msg recvd on mpdSock :%s:' % msg )
-    def launch_client_via_fork_exec(self,cli_env):
-        maxTries = 6
-        numTries = 0
-        while numTries < maxTries:
-            try:
-                cliPid = os.fork()
-                errinfo = 0
-            except OSError, errinfo:
-                pass  ## could check for errinfo.errno == 35 (resource unavailable)
-            if errinfo:
-                sleep(1)
-                numTries += 1
-            else:
-                break
-        if numTries >= maxTries:
-            ## print '**** mpdman: fork failed for launching client'
-            return -1
-        if cliPid == 0:
-            mpd_set_my_id(socket.gethostname() + '_man_before_exec_client_' + `os.getpid()`)
-            self.ring.lhsSock.close()
-            self.ring.rhsSock.close()
-            self.listenRingSock.close()
-            if self.conSock:
-                self.streamHandler.del_handler(self.conSock)
-                self.conSock.close()
-                self.conSock = 0
-            self.pmiListenSock.close()
-            os.setpgrp()
-
-            os.close(self.fd_write_cli_stdin)
-            os.dup2(self.fd_read_cli_stdin,0)  # closes fd 0 (stdin) if open
-
-            # to simply print on the mpd's tty:
-            #     comment out the next lines
-            os.close(self.fd_read_cli_stdout)
-            os.dup2(self.fd_write_cli_stdout,1)  # closes fd 1 (stdout) if open
-            os.close(self.fd_write_cli_stdout)
-            os.close(self.fd_read_cli_stderr)
-            os.dup2(self.fd_write_cli_stderr,2)  # closes fd 2 (stderr) if open
-            os.close(self.fd_write_cli_stderr)
-
-            msg = self.handshake_sock_cli_end.recv_char_msg()
-            if not msg.startswith('go'):
-                mpd_print(1,'%s: invalid go msg from man :%s:' % (self.myId,msg) )
-                sys.exit(-1)
-            self.handshake_sock_cli_end.close()
-
-            self.clientPgmArgs = [self.clientPgm] + self.clientPgmArgs
-            errmsg = set_limits(self.clientPgmLimits)
-            if errmsg:
-                self.pmiSock = MPDSock(name='pmi')
-                self.pmiSock.connect((self.myIfhn,self.pmiListenPort))
-                reason = quote(str(errmsg))
-                pmiMsgToSend = 'cmd=startup_status rc=-1 reason=%s exec=%s\n' % \
-                               (reason,self.clientPgm)
-                self.pmiSock.send_char_msg(pmiMsgToSend)
-                sys.exit(0)
-            try:
-                mpd_print(0000, 'execing clientPgm=:%s:' % (self.clientPgm) )
-                if self.gdb:
-                    fullDirName = os.environ['MPDMAN_FULLPATHDIR']
-                    gdbdrv = os.path.join(fullDirName,'mpdgdbdrv.py')
-                    if not os.access(gdbdrv,os.X_OK):
-                        print 'mpdman: cannot execute mpdgdbdrv %s' % gdbdrv
-                        sys.exit(0);
-                    if self.gdba:
-                        self.clientPgmArgs.insert(0,'-attach')
-                    self.clientPgmArgs.insert(0,self.clientPgm)
-                    os.execvpe(gdbdrv,self.clientPgmArgs,cli_env)    # client
-                else:
-                    os.environ['PATH'] = cli_env['PATH']
-                    os.execvpe(self.clientPgm,self.clientPgmArgs,cli_env)    # client
-            except Exception, errmsg:
-                # print '%s: could not run %s; probably executable file not found' % \
-                #        (self.myId,clientPgm)
-                self.pmiSock = MPDSock(name='pmi')
-                self.pmiSock.connect((self.myIfhn,self.pmiListenPort))
-                reason = quote(str(errmsg))
-                pmiMsgToSend = 'cmd=startup_status rc=-1 reason=%s exec=%s\n' % \
-                               (reason,self.clientPgm)
-                self.pmiSock.send_char_msg(pmiMsgToSend)
-                sys.exit(0)
-            sys.exit(0)
-        if not self.singinitPORT:
-            os.close(self.fd_read_cli_stdin)
-            os.close(self.fd_write_cli_stdout)
-            os.close(self.fd_write_cli_stderr)
-            self.cliListenSock.close()
-        return cliPid
-    def launch_client_via_subprocess(self,cli_env):
-        import threading
-        def read_fd_with_func(fd,func):
-            line = 'x'
-            while line:
-                line = func(fd)
-        tempListenSock = MPDListenSock()
-        tempListenPort = tempListenSock.getsockname()[1]
-        # python_executable = '\Python24\python.exe'
-        python_executable = 'python2.4'
-        fullDirName = os.environ['MPDMAN_FULLPATHDIR']
-        mpdwrapcli = os.path.join(fullDirName,'mpdwrapcli.py')
-        wrapCmdAndArgs = [ mpdwrapcli, str(tempListenPort),
-                           self.clientPgm, self.clientPgm ] + self.clientPgmArgs
-        cli_env.update(os.environ) ######  RMB: MAY NEED VARS OTHER THAN PATH ?????
-        self.subproc = subprocess.Popen([python_executable,'-u'] + wrapCmdAndArgs,
-                                        bufsize=0,env=cli_env,close_fds=False,
-                                        stdin=subprocess.PIPE,
-                                        stdout=subprocess.PIPE,
-                                        stderr=subprocess.PIPE)
-        self.fd_write_cli_stdin = self.subproc.stdin.fileno()
-        stdout_thread = threading.Thread(target=read_fd_with_func,
-                                         args=(self.subproc.stdout.fileno(),
-                                               self.handle_cli_stdout_input))
-        stdout_thread.start()
-        stderr_thread = threading.Thread(target=read_fd_with_func,
-                                         args=(self.subproc.stderr.fileno(),
-                                               self.handle_cli_stderr_input))
-        stderr_thread.start()
-        (self.handshake_sock_man_end,tempAddr) = tempListenSock.accept()
-        cliPid = self.subproc.pid
-        ## an mpd_print wreaks havoc here; simple prints are OK (probably a stack issue)
-        # mpd_print(0000,"CLIPID=%d" % cliPid)  
-        # print "CLIPID=%d" % cliPid  ;  sys.stdout.flush()
-        return cliPid
-    def create_line_label(self,line_label_fmt,spawned):
-        lineLabel = ''  # default is no label
-        if line_label_fmt:
-            i = 0
-            while i < len(line_label_fmt):
-                if line_label_fmt[i] == '%':
-                    fmtchar = line_label_fmt[i+1]
-                    i += 2
-                    if fmtchar == 'r':
-                        lineLabel += str(self.myRank)
-                    elif fmtchar == 'h':
-                        lineLabel += self.myHost
-                else:
-                    lineLabel += line_label_fmt[i]
-                    i += 1
-            if spawned:
-                lineLabel += ',' + str(spawned) + ': '    # spawned is actually a count
-            else:
-                lineLabel += ': '
-        return lineLabel
-
-def in_stdinRcvrs(myRank,stdinDest):
-    s1 = stdinDest.split(',')
-    for s in s1:
-        s2 = s.split('-')
-        if len(s2) == 1:
-            if myRank == int(s2[0]):
-                return 1
-        else:
-            if myRank >= int(s2[0])  and  myRank <= int(s2[1]):
-                return 1
-    return 0
-        
-
-def parse_pmi_msg(msg):
-    parsed_msg = {}
-    try:
-        sm = findall(r'\S+',msg)
-        for e in sm:
-            se = e.split('=')
-            parsed_msg[se[0]] = se[1]
-    except:
-        print 'unable to parse pmi msg :%s:' % msg
-        parsed_msg = {}
-    return parsed_msg
-
-def set_limits(limits):
-    try:
-        import resource
-    except:
-        return 'unable to import resource module to set limits'
-    for limtype in limits.keys():
-        limit = int(limits[limtype])
-        try:
-            if   limtype == 'core':
-                resource.setrlimit(resource.RLIMIT_CORE,(limit,limit))
-            elif limtype == 'cpu':
-                resource.setrlimit(resource.RLIMIT_CPU,(limit,limit))
-            elif limtype == 'fsize':
-                resource.setrlimit(resource.RLIMIT_FSIZE,(limit,limit))
-            elif limtype == 'data':
-                resource.setrlimit(resource.RLIMIT_DATA,(limit,limit))
-            elif limtype == 'stack':
-                resource.setrlimit(resource.RLIMIT_STACK,(limit,limit))
-            elif limtype == 'rss':
-                resource.setrlimit(resource.RLIMIT_RSS,(limit,limit))
-            elif limtype == 'nproc':
-                resource.setrlimit(resource.RLIMIT_NPROC,(limit,limit))
-            elif limtype == 'nofile':
-                resource.setrlimit(resource.RLIMIT_NOFILE,(limit,limit))
-            elif limtype == 'ofile':
-                resource.setrlimit(resource.RLIMIT_OFILE,(limit,limit))
-            elif limtype == 'memloc':
-                resource.setrlimit(resource.RLIMIT_MEMLOCK,(limit,limit))
-            elif  limtype == 'as':
-                resource.setrlimit(resource.RLIMIT_AS,(limit,limit))
-            elif  limtype == 'vmem':
-                resource.setrlimit(resource.RLIMIT_VMEM,(limit,limit))
-            else:
-                raise NameError, 'invalid resource name: %s' % limtype  # validated at mpdrun
-        except (NameError,ImportError), errmsg:
-            return errmsg
-    return 0
-
-def sigchld_handler(signum,frame):
-    global clientPid, clientExited, clientExitStatus, clientExitStatusSent
-    done = 0
-    while not done:
-        try:
-            (pid,status) = os.waitpid(-1,os.WNOHANG)
-            if pid == 0:    # no existing child process is finished
-                done = 1
-            if pid == clientPid:
-                clientExited = 1
-                clientExitStatus = status
-                mpd_handle_signal(signum,0)
-        except:
-            done = 1
-
-
-if __name__ == '__main__':
-    if not os.environ.has_key('MPDMAN_CLI_PGM'):    # assume invoked from keyboard
-        print __doc__
-        sys.exit(-1)
-    mpdman = MPDMan()
-    mpdman.run()
diff --git a/src/pm/mpd/mpdringtest.py b/src/pm/mpd/mpdringtest.py
deleted file mode 100755
index e30cc81..0000000
--- a/src/pm/mpd/mpdringtest.py
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/usr/bin/env python
-#
-#   (C) 2001 by Argonne National Laboratory.
-#       See COPYRIGHT in top-level directory.
-#
-
-"""
-usage: mpdringtest [number of loops]
-Times a single message going around the ring of mpds [num] times (default once)
-"""
-from time import ctime
-__author__ = "Ralph Butler and Rusty Lusk"
-__date__ = ctime()
-__version__ = "$Revision: 1.14 $"
-__credits__ = ""
-
-import sys, os, signal
-
-from  time    import  time
-from  mpdlib  import  mpd_set_my_id, mpd_uncaught_except_tb, mpd_print, \
-                      mpd_handle_signal, mpd_get_my_username, MPDConClientSock, MPDParmDB
-
-def mpdringtest():
-    import sys    # to get access to excepthook in next line
-    sys.excepthook = mpd_uncaught_except_tb
-    if len(sys.argv) > 1  and  ( sys.argv[1] == '-h'  or  sys.argv[1] == '--help' ) :
-        usage()
-    if len(sys.argv) < 2: 
-	numLoops = 1
-    else:
-	numLoops = int(sys.argv[1])
-    signal.signal(signal.SIGINT, sig_handler)
-    mpd_set_my_id(myid='mpdringtest')
-
-    parmdb = MPDParmDB(orderedSources=['cmdline','xml','env','rcfile','thispgm'])
-    parmsToOverride = {
-                        'MPD_USE_ROOT_MPD'            :  0,
-                        'MPD_SECRETWORD'              :  '',
-                      }
-    for (k,v) in parmsToOverride.items():
-        parmdb[('thispgm',k)] = v
-    parmdb.get_parms_from_env(parmsToOverride)
-    parmdb.get_parms_from_rcfile(parmsToOverride)
-    if (hasattr(os,'getuid')  and  os.getuid() == 0)  or  parmdb['MPD_USE_ROOT_MPD']:
-        fullDirName = os.path.abspath(os.path.split(sys.argv[0])[0])  # normalize
-        mpdroot = os.path.join(fullDirName,'mpdroot')
-        conSock = MPDConClientSock(mpdroot=mpdroot,secretword=parmdb['MPD_SECRETWORD'])
-    else:
-        conSock = MPDConClientSock(secretword=parmdb['MPD_SECRETWORD'])
-
-    msgToSend = { 'cmd' : 'mpdringtest', 'numloops' : numLoops }
-    conSock.send_dict_msg(msgToSend)
-    starttime = time()
-    msg = conSock.recv_dict_msg()
-    etime = time() - starttime
-    if not msg:
-        print 'mpdringtest terminated early'
-    elif msg['cmd'] != 'mpdringtest_done':
-        if msg['cmd'] == 'already_have_a_console':
-            print 'mpd already has a console (e.g. for long ringtest); try later'
-        else:
-            print 'unexpected message from mpd: %s' % (msg)
-    else:
-	print 'time for %d loops =' % numLoops, etime, 'seconds' 
-
-def sig_handler(signum,frame):
-    mpd_handle_signal(signum,frame)  # not nec since I exit next
-    sys.exit(-1)
-
-def usage():
-    print __doc__
-    sys.exit(-1)
-
-if __name__ == '__main__':
-    mpdringtest()
diff --git a/src/pm/mpd/mpdroot.c b/src/pm/mpd/mpdroot.c
deleted file mode 100644
index 7f517cd..0000000
--- a/src/pm/mpd/mpdroot.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *  (C) 2001 by Argonne National Laboratory.
- *      See COPYRIGHT in top-level directory.
- */
-
-#include <stdio.h>
-#include "mpdroot.h"
-
-#ifdef NEEDS_SNPRINTF_DECL
-int snprintf(char *str, size_t size, const char *format, ...);
-#endif
-
-int main(int argc, char *argv[])
-{
-    int rc, sock;
-    struct sockaddr_un sa;
-    char console_name[NAME_LEN], cmd[NAME_LEN];
-    struct passwd *pwent;
-    char input_line[NAME_LEN+1], secretword[NAME_LEN+1];
-    FILE *conf_file;
-    char *mpdconf_path = NULL;
-
-    if ((pwent = getpwuid(getuid())) == NULL)    /* for real id */
-    {
-        printf("%s: getpwnam failed",argv[0]);
-        exit(1);
-    }
-
-    /*
-     * We look for a readable mpd.conf in the following order.
-     * - MPD_CONF_FILE set in environment
-     * - .mpd.conf in the user's home directory
-     * - The system wide default in SYSCONFDIR/mpd.conf
-     */
-    mpdconf_path = getenv("MPD_CONF_FILE");
-    if ( ! (mpdconf_path && access( mpdconf_path, R_OK ) == 0) ){
-        /* By far, the largest we'll need */
-        size_t mpdconf_path_len = strlen(pwent->pw_dir) \
-            + strlen(SYSCONFDIR) + strlen("/.mpd.conf");
-
-        mpdconf_path = (char*) malloc( sizeof(char) * mpdconf_path_len );
-        if ( ! mpdconf_path ){
-            fprintf( stderr, "%s:  Failed to allocate a buffer for path to mpd.conf\n", argv[0]);
-            exit(1);
-        }
-        snprintf( mpdconf_path, mpdconf_path_len-1, "%s/.mpd.conf", pwent->pw_dir );
-        if ( access( mpdconf_path, R_OK ) != 0 )
-            snprintf( mpdconf_path, mpdconf_path_len-1, "%s/mpd.conf", SYSCONFDIR );
-    }
-    conf_file = fopen( mpdconf_path, "r");
-
-    if (conf_file == NULL)
-    {
-        printf("%s: open failed for root's mpd conf file\n",argv[0]);
-        exit(1);
-    }
-    secretword[0] = '\0';
-    while (fgets(input_line,NAME_LEN,conf_file) != NULL)
-    {
-        input_line[strlen(input_line)-1] = '\0';  /* eliminate \n */
-        if (input_line[0] == '#'  ||  input_line[0] == '\0')
-            continue;
-	if (strncmp(input_line,"secretword",10) == 0  &&  input_line[10] == '=')
-	{
-	    strncpy(secretword,&input_line[11],NAME_LEN);
-	    secretword[NAME_LEN] = '\0';  /* just being cautious */
-	}
-	else if (strncmp(input_line,"MPD_SECRETWORD",14) == 0  &&  input_line[14] == '=')
-	{
-	    strncpy(secretword,&input_line[15],NAME_LEN);
-	    secretword[NAME_LEN] = '\0';  /* just being cautious */
-	}
-    }
-    if (secretword[0] == '\0')
-    {
-        printf("%s: did not find secretword in mpd conf file",argv[0]);
-        exit(1);
-    }
-
-    /* setup default console */
-    strncpy(console_name,argv[1],NAME_LEN);
-    memset( (void *)&sa, 0, sizeof( sa ) );
-    sa.sun_family = AF_UNIX;
-    strncpy(sa.sun_path,console_name, sizeof(sa.sun_path)-1 );
-    sock = atoi(argv[2]);
-    rc = connect(sock,(struct sockaddr *)&sa,sizeof(sa));
-    if (rc < 0)
-    {
-	perror("mpdroot: perror msg");
-	printf("mpdroot: cannot connect to local mpd at: %s\n", console_name);
-	printf("    probable cause:  no mpd daemon on this machine\n");
-	printf("    possible cause:  unix socket %s has been removed\n", console_name);
-	exit(1);
-    }
-
-    snprintf(cmd,NAME_LEN,"realusername=%s secretword=%s\n",pwent->pw_name,secretword);
-    write(sock,cmd,strlen(cmd));
-
-    if (mpdconf_path)
-        free(mpdconf_path);
-
-    return(0);
-}
diff --git a/src/pm/mpd/mpdroot.h b/src/pm/mpd/mpdroot.h
deleted file mode 100644
index 15b719c..0000000
--- a/src/pm/mpd/mpdroot.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *  (C) 2001 by Argonne National Laboratory.
- *      See COPYRIGHT in top-level directory.
- */
-
-/* get configured options */
-#include "mpdconf.h"
-
-#include <stdio.h>
-#ifdef STDC_HEADERS
-#  include <stdlib.h>
-#  include <string.h>
-#  include <stdarg.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#  include <unistd.h>
-#endif
-#ifdef HAVE_CRYPT_H
-#  include <crypt.h>
-#endif
-#include <ctype.h>
-#include <sys/types.h>
-#ifdef HAVE_SYS_TIME_H
-#  include <sys/time.h>
-#endif
-#include <sys/socket.h>
-#ifdef HAVE_SYS_WAIT_H
-#  include <sys/wait.h>
-#endif
-#include <sys/un.h>
-#include <sys/stat.h>
-#include <netdb.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <arpa/inet.h>
-#include <errno.h>
-#include <strings.h>
-#include <signal.h>
-#ifdef HAVE_FCNTL_H
-#  include <fcntl.h>
-#endif
-#include <pwd.h>
-#include <syslog.h>
-
-#define NAME_LEN 512
-
diff --git a/src/pm/mpd/mpdsigjob.py b/src/pm/mpd/mpdsigjob.py
deleted file mode 100755
index d2430f9..0000000
--- a/src/pm/mpd/mpdsigjob.py
+++ /dev/null
@@ -1,128 +0,0 @@
-#!/usr/bin/env python
-#
-#   (C) 2001 by Argonne National Laboratory.
-#       See COPYRIGHT in top-level directory.
-#
-"""
-usage: mpdsigjob  sigtype  [-j jobid OR -a jobalias] [-s|g]
-    sigtype must be the first arg
-    jobid can be obtained via mpdlistjobs and is of the form:
-        jobnum at mpdid where mpdid is mpd where first process runs, e.g.:
-            1 at linux02_32996 (may need \@ in some shells)
-            1  is sufficient if you are on the machine where the job started
-    one of -j or -a must be specified (but only one)
-    -s or -g specify whether to signal the single user process or its group (default is g)
-Delivers a Unix signal to all the application processes in the job
-"""
-from time import ctime
-__author__ = "Ralph Butler and Rusty Lusk"
-__date__ = ctime()
-__version__ = "$Revision: 1.21 $"
-__credits__ = ""
-
-
-from os     import environ, getuid, close, path
-from sys    import argv, exit
-from socket import socket, fromfd, AF_UNIX, SOCK_STREAM
-from signal import signal, SIG_DFL, SIGINT, SIGTSTP, SIGCONT, SIGALRM
-from  mpdlib  import  mpd_set_my_id, mpd_uncaught_except_tb, mpd_print, \
-                      mpd_handle_signal, mpd_get_my_username, MPDConClientSock, MPDParmDB
-
-def mpdsigjob():
-    import sys    # to get access to excepthook in next line
-    sys.excepthook = mpd_uncaught_except_tb
-    if len(argv) < 3  or  argv[1] == '-h'  or  argv[1] == '--help':
-        usage()
-    signal(SIGINT, sig_handler)
-    mpd_set_my_id(myid='mpdsigjob')
-    sigtype = argv[1]
-    if sigtype.startswith('-'):
-        sigtype = sigtype[1:]
-    if sigtype.startswith('SIG'):
-        sigtype = sigtype[3:]
-    import signal as tmpsig  # just to get valid SIG's
-    if sigtype.isdigit():
-        if int(sigtype) > tmpsig.NSIG:
-            print 'invalid signum: %s' % (sigtype)
-            exit(-1)
-    else:
-	if not tmpsig.__dict__.has_key('SIG' + sigtype):
-	    print 'invalid sig type: %s' % (sigtype)
-	    exit(-1)
-    jobalias = ''
-    jobnum = ''
-    mpdid = ''
-    single_or_group = 'g'
-    i = 2
-    while i < len(argv):
-        if argv[i] == '-a':
-            if jobnum:      # should not have both alias and jobid
-                print '** cannot specify both jobalias and jobid'
-                usage()
-            jobalias = argv[i+1]
-            i += 1
-            jobnum = '0'
-        elif argv[i] == '-j':
-            if jobalias:    # should not have both alias and jobid
-                print '** cannot specify both jobalias and jobid'
-                usage()
-            jobid = argv[i+1]
-            i += 1
-            sjobid = jobid.split('@')
-            jobnum = sjobid[0]
-            if len(sjobid) > 1:
-                mpdid = sjobid[1]
-        elif argv[i] == '-s':
-            single_or_group = 's'
-        elif argv[i] == '-g':
-            single_or_group = 'g'
-        else:
-            print '** unrecognized arg: %s' % (argv[i])
-            usage()
-        i += 1
-
-    parmdb = MPDParmDB(orderedSources=['cmdline','xml','env','rcfile','thispgm'])
-    parmsToOverride = {
-                        'MPD_USE_ROOT_MPD'            :  0,
-                        'MPD_SECRETWORD'              :  '',
-                      }
-    for (k,v) in parmsToOverride.items():
-        parmdb[('thispgm',k)] = v
-    parmdb.get_parms_from_env(parmsToOverride)
-    parmdb.get_parms_from_rcfile(parmsToOverride)
-    if getuid() == 0  or  parmdb['MPD_USE_ROOT_MPD']:
-        fullDirName = path.abspath(path.split(argv[0])[0])  # normalize
-        mpdroot = path.join(fullDirName,'mpdroot')
-        conSock = MPDConClientSock(mpdroot=mpdroot,secretword=parmdb['MPD_SECRETWORD'])
-    else:
-        conSock = MPDConClientSock(secretword=parmdb['MPD_SECRETWORD'])
-
-    msgToSend = {'cmd' : 'mpdsigjob', 'sigtype': sigtype, 'jobnum' : jobnum,
-                 'mpdid' : mpdid, 'jobalias' : jobalias, 's_or_g' : single_or_group,
-                 'username' : mpd_get_my_username() }
-    conSock.send_dict_msg(msgToSend)
-    msg = conSock.recv_dict_msg(timeout=5.0)
-    if not msg:
-        mpd_print(1,'no msg recvd from mpd before timeout')
-    if msg['cmd'] != 'mpdsigjob_ack':
-        if msg['cmd'] == 'already_have_a_console':
-            mpd_print(1,'mpd already has a console (e.g. for long ringtest); try later')
-        else:
-            mpd_print(1,'unexpected message from mpd: %s' % (msg) )
-        exit(-1)
-    if not msg['handled']:
-        print 'job not found'
-        exit(-1)
-    conSock.close()
-
-def sig_handler(signum,frame):
-    mpd_handle_signal(signum,frame)  # not nec since I exit next
-    exit(-1)
-
-def usage():
-    print __doc__
-    exit(-1)
-
-
-if __name__ == '__main__':
-    mpdsigjob()
diff --git a/src/pm/mpd/mpdtrace.py b/src/pm/mpd/mpdtrace.py
deleted file mode 100755
index 90147c7..0000000
--- a/src/pm/mpd/mpdtrace.py
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/usr/bin/env python
-#
-#   (C) 2001 by Argonne National Laboratory.
-#       See COPYRIGHT in top-level directory.
-#
-
-"""
-usage: mpdtrace [-l]
-Lists the (short) hostname of each of the mpds in the ring
-The -l (long) option shows full hostnames and listening ports and ifhn
-"""
-
-from time import ctime
-__author__ = "Ralph Butler and Rusty Lusk"
-__date__ = ctime()
-__version__ = "$Revision: 1.18 $"
-__credits__ = ""
-
-import sys, os, signal
-
-from  re      import  sub
-from  mpdlib  import  mpd_set_my_id, mpd_uncaught_except_tb, mpd_print, \
-                      mpd_handle_signal, mpd_get_my_username, MPDConClientSock, MPDParmDB
-
-def mpdtrace():
-    import sys    # to get access to excepthook in next line
-    sys.excepthook = mpd_uncaught_except_tb
-    if len(sys.argv) > 1:
-        if (sys.argv[1] == '-h' or sys.argv[1] == '--help') or (sys.argv[1] != '-l'):
-            usage()
-    signal.signal(signal.SIGINT, sig_handler)
-    mpd_set_my_id(myid='mpdtrace')
-
-    parmdb = MPDParmDB(orderedSources=['cmdline','xml','env','rcfile','thispgm'])
-    parmsToOverride = {
-                        'MPD_USE_ROOT_MPD'            :  0,
-                        'MPD_SECRETWORD'              :  '',
-                      }
-    for (k,v) in parmsToOverride.items():
-        parmdb[('thispgm',k)] = v
-    parmdb.get_parms_from_env(parmsToOverride)
-    parmdb.get_parms_from_rcfile(parmsToOverride)
-    if (hasattr(os,'getuid')  and  os.getuid() == 0)  or  parmdb['MPD_USE_ROOT_MPD']:
-        fullDirName = os.path.abspath(os.path.split(sys.argv[0])[0])  # normalize
-        mpdroot = os.path.join(fullDirName,'mpdroot')
-        conSock = MPDConClientSock(mpdroot=mpdroot,secretword=parmdb['MPD_SECRETWORD'])
-    else:
-        conSock = MPDConClientSock(secretword=parmdb['MPD_SECRETWORD'])
-
-    msgToSend = { 'cmd' : 'mpdtrace' }
-    conSock.send_dict_msg(msgToSend)
-    # Main Loop
-    done = 0
-    while not done:
-        msg = conSock.recv_dict_msg(timeout=5.0)
-        if not msg:    # also get this on ^C
-            mpd_print(1, 'got eof on console')
-            sys.exit(-1)
-        elif not msg.has_key('cmd'):
-            print 'mpdtrace: unexpected msg from mpd=:%s:' % (msg)
-            sys.exit(-1)
-        if msg['cmd'] == 'mpdtrace_info':
-            if len(sys.argv) > 1 and sys.argv[1] == '-l':
-                print '%s (%s)' % (msg['id'],msg['ifhn'])
-            else:
-                pos = msg['id'].find('.')
-                if pos < 0:
-                    pos = msg['id'].rfind('_')
-                print msg['id'][:pos]    # strip off domain and port
-        elif msg['cmd'] == 'mpdtrace_trailer':
-            done = 1
-    conSock.close()
-
-def sig_handler(signum,frame):
-    mpd_handle_signal(signum,frame)  # not nec since I exit next
-    sys.exit(-1)
-
-def usage():
-    print __doc__
-    sys.exit(-1)
-
-if __name__ == '__main__':
-    mpdtrace()
diff --git a/src/pm/mpd/mpdwrapcli.py b/src/pm/mpd/mpdwrapcli.py
deleted file mode 100755
index 79e690f..0000000
--- a/src/pm/mpd/mpdwrapcli.py
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/usr/bin/env python
-#
-#   (C) 2001 by Argonne National Laboratory.
-#       See COPYRIGHT in top-level directory.
-#
-
-import sys, os, socket
-
-manPort = int(sys.argv[1])
-manSock = socket.socket()
-manSock.connect((socket.gethostname(),manPort))
-msg = manSock.recv(3)    # 'go\n'
-if not msg.startswith('go'):
-    print 'mpscliwrap: invalid go msg from man'
-    sys.exit(-1)
-
-try:     max_fds = os.sysconf('SC_OPEN_MAX')
-except:  max_fds = 1024
-for fd in range(3,max_fds):
-    try:     os.close(fd)
-    except:  pass
-# can NOT use syslog (including inside an mpd_print) below here without
-# doing a new openlog because any syslog fd would have been closed
-
-os.execvpe(sys.argv[2],sys.argv[3:],os.environ)    # client
diff --git a/src/pm/mpd/mpichprereq b/src/pm/mpd/mpichprereq
deleted file mode 100755
index 3eeb752..0000000
--- a/src/pm/mpd/mpichprereq
+++ /dev/null
@@ -1,12 +0,0 @@
-#! /bin/sh
-# Inform the top-level configure that MPD supports a nameserver
-MPID_PM_NAMESERVER=mpd
-# Check that we are using the simple PMI implementation
-# (Selecting multiple PM's may require incompatible PMI implementations 
-# (e.g., MPD and SMPD).
-if [ -z "$PM_REQUIRES_PMI" ] ; then
-    PM_REQUIRES_PMI=simple
-elif [ "$PM_REQUIRES_PMI" != "simple" ] ; then
-    echo "MPD requires the simple PMI implementation; $PM_REQUIRES_PMI has already been selected"
-    exit 1
-fi
diff --git a/src/pm/mpd/mpiexec.py b/src/pm/mpd/mpiexec.py
deleted file mode 100755
index 9d4d50e..0000000
--- a/src/pm/mpd/mpiexec.py
+++ /dev/null
@@ -1,1449 +0,0 @@
-#!/usr/bin/env python
-#
-#   (C) 2001 by Argonne National Laboratory.
-#       See COPYRIGHT in top-level directory.
-#
-
-"""
-usage:
-mpiexec [-h or -help or --help]    # get this message
-mpiexec -file filename             # (or -f) filename contains XML job description
-mpiexec [global args] [local args] executable [args]
-   where global args may be
-      -l                           # line labels by MPI rank
-      -bnr                         # MPICH1 compatibility mode
-      -machinefile                 # file mapping procs to machines
-      -s <spec>                    # direct stdin to "all" or 1,2 or 2-4,6 
-      -1                           # override default of trying 1st proc locally
-      -ifhn                        # network interface to use locally
-      -tv                          # run procs under totalview (must be installed)
-      -tvsu                        # totalview startup only
-      -gdb                         # run procs under gdb
-      -m                           # merge output lines (default with gdb)
-      -a                           # means assign this alias to the job
-      -ecfn                        # output_xml_exit_codes_filename
-      -recvtimeout <integer_val>   # timeout for recvs to fail (e.g. from mpd daemon)
-      -g<local arg name>           # global version of local arg (below)
-    and local args may be
-      -n <n> or -np <n>            # number of processes to start
-      -wdir <dirname>              # working directory to start in
-      -umask <umask>               # umask for remote process
-      -path <dirname>              # place to look for executables
-      -host <hostname>             # host to start on
-      -soft <spec>                 # modifier of -n value
-      -arch <arch>                 # arch type to start on (not implemented)
-      -envall                      # pass all env vars in current environment
-      -envnone                     # pass no env vars
-      -envlist <list of env var names> # pass current values of these vars
-      -env <name> <value>          # pass this value of this env var
-mpiexec [global args] [local args] executable args : [local args] executable...
-mpiexec -gdba jobid                # gdb-attach to existing jobid
-mpiexec -configfile filename       # filename contains cmd line segs as lines
-  (See User Guide for more details)
-
-Examples:
-   mpiexec -l -n 10 cpi 100
-   mpiexec -genv QPL_LICENSE 4705 -n 3 a.out
-
-   mpiexec -n 1 -host foo master : -n 4 -host mysmp slave
-"""
-from time import ctime
-__author__ = "Ralph Butler and Rusty Lusk"
-__date__ = ctime()
-__version__ = "$Revision: 1.90 $"
-__credits__ = ""
-
-import signal
-if hasattr(signal,'SIGTTIN'):
-    signal.signal(signal.SIGTTIN,signal.SIG_IGN)    # asap
-
-import sys, os, socket, re
-
-from  urllib import quote
-from  time   import time
-from  urllib import unquote
-from  mpdlib import mpd_set_my_id, mpd_get_my_username, mpd_version, mpd_print, \
-                    mpd_uncaught_except_tb, mpd_handle_signal, mpd_which, \
-                    MPDListenSock, MPDStreamHandler, MPDConClientSock, MPDParmDB
-
-try:
-    import pwd
-    pwd_module_available = 1
-except:
-    pwd_module_available = 0
-
-global parmdb, nextRange, appnum, recvTimeout
-global numDoneWithIO, myExitStatus, sigOccurred, outXmlDoc, outECs
-
-
-def mpiexec():
-    global parmdb, nextRange, appnum, recvTimeout
-    global numDoneWithIO, myExitStatus, sigOccurred, outXmlDoc, outECs
-
-    import sys  # for sys.excepthook on next line
-    sys.excepthook = mpd_uncaught_except_tb
-
-    myExitStatus = 0
-    if len(sys.argv) < 2  or  sys.argv[1] == '-h'  \
-    or  sys.argv[1] == '-help'  or  sys.argv[1] == '--help':
-	usage()
-    myHost = socket.gethostname()
-    mpd_set_my_id(myid='mpiexec_%s' % (myHost) )
-    try:
-        hostinfo = socket.gethostbyname_ex(myHost)
-    except:
-        print 'mpiexec failed: gethostbyname_ex failed for %s' % (myHost)
-        sys.exit(-1)
-    myIP = hostinfo[2][0]
-
-    parmdb = MPDParmDB(orderedSources=['cmdline','xml','env','rcfile','thispgm'])
-    parmsToOverride = {
-                        'MPD_USE_ROOT_MPD'            :  0,
-                        'MPD_SECRETWORD'              :  '',
-                        'MPIEXEC_SHOW_LINE_LABELS'    :  0,
-                        'MPIEXEC_LINE_LABEL_FMT'      :  '%r',
-                        'MPIEXEC_JOB_ALIAS'           :  '',
-                        'MPIEXEC_USIZE'               :  0,
-                        'MPIEXEC_GDB'                 :  0,
-                        'MPIEXEC_IFHN'                :  '',  # use one from mpd as default
-                        'MPIEXEC_MERGE_OUTPUT'        :  0,
-                        'MPIEXEC_STDIN_DEST'          :  '0',
-                        'MPIEXEC_MACHINEFILE'         :  '',
-                        'MPIEXEC_BNR'                 :  0,
-                        'MPIEXEC_TOTALVIEW'           :  0,
-                        'MPIEXEC_TVSU'                :  0,
-                        'MPIEXEC_EXITCODES_FILENAME'  :  '',
-                        'MPIEXEC_TRY_1ST_LOCALLY'     :  1,
-                        'MPIEXEC_TIMEOUT'             :  0,
-                        'MPIEXEC_HOST_LIST'           :  [],
-                        'MPIEXEC_HOST_CHECK'          :  0,
-                        'MPIEXEC_RECV_TIMEOUT'        :  20,
-                      }
-    for (k,v) in parmsToOverride.items():
-        parmdb[('thispgm',k)] = v
-    parmdb[('thispgm','mship')] = ''
-    parmdb[('thispgm','rship')] = ''
-    parmdb[('thispgm','userpgm')] = ''
-    parmdb[('thispgm','nprocs')] = 0
-    parmdb[('thispgm','ecfn_format')] = ''
-    parmdb[('thispgm','-gdba')] = ''
-    parmdb[('thispgm','singinitpid')] = 0
-    parmdb[('thispgm','singinitport')] = 0
-    parmdb[('thispgm','ignore_rcfile')] = 0
-    parmdb[('thispgm','ignore_environ')] = 0
-    parmdb[('thispgm','inXmlFilename')] = ''
-    parmdb[('thispgm','print_parmdb_all')] = 0
-    parmdb[('thispgm','print_parmdb_def')] = 0
-
-    appnum = 0
-    nextRange = 0
-    localArgSets = { 0 : [] }
-
-    if sys.argv[1] == '-gdba':
-	if len(sys.argv) != 3:
-            print '-gdba arg must appear only with jobid'
-	    usage()
-        parmdb[('cmdline','-gdba')] = sys.argv[2]
-        parmdb[('cmdline','MPIEXEC_GDB')] = 1
-        parmdb[('cmdline','MPIEXEC_MERGE_OUTPUT')] = 1       # implied
-        parmdb[('cmdline','MPIEXEC_SHOW_LINE_LABELS')] = 1   # implied
-        parmdb[('cmdline','MPIEXEC_STDIN_DEST')]   = 'all'   # implied
-    elif sys.argv[1] == '-file'  or  sys.argv[1] == '-f':
-	if len(sys.argv) != 3:
-            print '-file (-f) arg must appear alone'
-	    usage()
-        parmdb[('cmdline','inXmlFilename')] = sys.argv[2]
-    elif sys.argv[1] == '-pmi_args':
-        parmdb[('cmdline','singinitport')] = sys.argv[2]
-        # ignoring interface name (where app is listening) and authentication key, for now
-        parmdb[('cmdline','singinitpid')]  = sys.argv[5]
-        parmdb[('cmdline','userpgm')] = 'unknown_pgmname'
-        parmdb[('cmdline','nprocs')] = 1
-        parmdb[('cmdline','MPIEXEC_TRY_1ST_LOCALLY')] = 1
-        machineFileInfo = {}
-        tempargv = [sys.argv[0],'unknown_pgmname']
-        collect_args(tempargv,localArgSets)
-    else:
-        if sys.argv[1] == '-configfile':
-	    if len(sys.argv) != 3:
-	        usage()
-            configFile = open(sys.argv[2],'r',0)
-            configLines = configFile.readlines()
-            configLines = [ x.strip() + ' : '  for x in configLines if x[0] != '#' and x.strip() != '' ]
-            tempargv = []
-            for line in configLines:
-                line = 'mpddummyarg ' + line  # gets pitched in shells that can't handle --
-                (shellIn,shellOut) = \
-                    os.popen4("/bin/sh -c 'for a in $*; do echo _$a; done' -- %s" % (line))
-                for shellLine in shellOut:
-                    if shellLine.startswith('_mpddummyarg'):
-                        continue
-                    tempargv.append(shellLine[1:].strip())    # 1: strips off the leading _
-	    tempargv = [sys.argv[0]] + tempargv[0:-1]   # strip off the last : I added
-            collect_args(tempargv,localArgSets)
-        else:
-            collect_args(sys.argv,localArgSets)
-        machineFileInfo = read_machinefile(parmdb['MPIEXEC_MACHINEFILE'])
-
-    # set some default values for mpd; others added as discovered below
-    msgToMPD = { 'cmd'            : 'mpdrun',
-                 'conhost'        : myHost,
-                 'spawned'        : 0,
-                 'nstarted'       : 0,
-                 'hosts'          : {},
-                 'execs'          : {},
-                 'users'          : {},
-                 'cwds'           : {},
-                 'umasks'         : {},
-                 'paths'          : {},
-                 'args'           : {},
-                 'limits'         : {},
-                 'envvars'        : {},
-                 'ifhns'          : {},
-               }
-
-    if parmdb['inXmlFilename']:
-        get_parms_from_xml_file(msgToMPD)  # fills in some more values of msgToMPD
-    else:
-        parmdb.get_parms_from_env(parmsToOverride)
-        parmdb.get_parms_from_rcfile(parmsToOverride)
-
-    # mostly old mpdrun below here
-    numDoneWithIO = 0
-    outXmlDoc = ''
-    outECs = ''
-    outECFile = None
-    sigOccurred = 0
-
-    recvTimeout = int(parmdb['MPIEXEC_RECV_TIMEOUT'])  # may be changed below
-
-    listenSock = MPDListenSock('',0,name='socket_to_listen_for_man')
-    listenPort = listenSock.getsockname()[1]
-    if (hasattr(os,'getuid')  and  os.getuid() == 0)  or  parmdb['MPD_USE_ROOT_MPD']:
-        fullDirName = os.path.abspath(os.path.split(sys.argv[0])[0])  # normalize
-        mpdroot = os.path.join(fullDirName,'mpdroot')
-        conSock = MPDConClientSock(mpdroot=mpdroot,secretword=parmdb['MPD_SECRETWORD'])
-    else:
-        conSock = MPDConClientSock(secretword=parmdb['MPD_SECRETWORD'])
-
-    if parmdb['MPIEXEC_HOST_CHECK']:    # if this was requested in the xml file
-        msgToSend = { 'cmd' : 'verify_hosts_in_ring',
-                      'host_list' : parmdb['MPIEXEC_HOST_LIST'] }
-        conSock.send_dict_msg(msgToSend)
-        msg = conSock.recv_dict_msg(timeout=recvTimeout)
-        if not msg:
-            mpd_print(1,'no msg recvd from mpd for verify_hosts_in_ring')
-            sys.exit(-1)
-        elif msg['cmd'] != 'verify_hosts_in_ring_response':
-            mpd_print(1,'unexpected msg from mpd :%s:' % (msg) )
-            sys.exit(-1)
-        if msg['host_list']:
-            print 'These hosts are not in the mpd ring:'
-            for host in  msg['host_list']:
-                if host[0].isdigit():
-                    print '    %s' % (host),
-                    try:
-                        print ' (%s)' % (socket.gethostbyaddr(host)[0])
-                    except:
-                        print ''
-                else:
-                    print '    %s' % (host)
-            sys.exit(-1)
-
-    msgToSend = { 'cmd' : 'get_mpdrun_values' }
-    conSock.send_dict_msg(msgToSend)
-    msg = conSock.recv_dict_msg(timeout=recvTimeout)
-    if not msg:
-        mpd_print(1, 'no msg recvd from mpd during version check')
-        sys.exit(-1)
-    elif msg['cmd'] != 'response_get_mpdrun_values':
-        mpd_print(1,'unexpected msg from mpd :%s:' % (msg) )
-        sys.exit(-1)
-    if msg['mpd_version'] != mpd_version():
-        mpd_print(1,'mpd version %s does not match mpiexec version %s' % \
-                  (msg['mpd_version'],mpd_version()) )
-        sys.exit(-1)
-
-    # if using/testing the INET CONSOLE
-    if os.environ.has_key('MPD_CON_INET_HOST_PORT'):
-        try:
-            myIfhn = socket.gethostbyname_ex(myHost)[2][0]
-        except:
-            print 'mpiexec failed: gethostbyname_ex failed for %s' % (myHost)
-            sys.exit(-1)
-        parmdb[('thispgm','MPIEXEC_IFHN')] = myIfhn
-    elif not parmdb['MPIEXEC_IFHN']:    # if user did not specify one, use mpd's
-        parmdb[('thispgm','MPIEXEC_IFHN')] = msg['mpd_ifhn']    # not really thispgm here
-
-    if parmdb['-gdba']:
-        get_vals_for_attach(parmdb,conSock,msgToMPD)
-    elif not parmdb['inXmlFilename']:
-        parmdb[('cmdline','nprocs')] = 0  # for incr later
-        for k in localArgSets.keys():
-	    handle_local_argset(localArgSets[k],machineFileInfo,msgToMPD)
-
-    if parmdb['MPIEXEC_MERGE_OUTPUT']  and  not parmdb['MPIEXEC_SHOW_LINE_LABELS']:
-        parmdb[('thispgm','MPIEXEC_SHOW_LINE_LABELS')] = 1   # causes line labels also
-
-    if parmdb['print_parmdb_all']:
-        parmdb.printall()
-    if parmdb['print_parmdb_def']:
-        parmdb.printdef()
-
-    if parmdb['mship']:
-        mshipSock = MPDListenSock('',0,name='socket_for_mship')
-        mshipPort = mshipSock.getsockname()[1]
-        mshipPid = os.fork()
-        if mshipPid == 0:
-            conSock.close()
-            os.environ['MPDCP_AM_MSHIP'] = '1'
-            os.environ['MPDCP_MSHIP_PORT'] = str(mshipPort)
-            os.environ['MPDCP_MSHIP_FD'] = str(mshipSock.fileno())
-            os.environ['MPDCP_MSHIP_NPROCS'] = str(parmdb['nprocs'])
-            try:
-                os.execvpe(parmdb['mship'],[parmdb['MPIEXEC_MSHIP']],os.environ)
-            except Exception, errmsg:
-                mpd_print(1,'execvpe failed for copgm %s; errmsg=:%s:' % \
-                          (parmdb['MPIEXEC_MSHIP'],errmsg))
-                sys.exit(-1)
-            os._exit(0);  # do NOT do cleanup
-        mshipSock.close()
-    else:
-        mshipPid = 0
-
-    # make sure to do this after nprocs has its value
-    linesPerRank = {}  # keep this a dict instead of a list
-    for i in range(parmdb['nprocs']):
-        linesPerRank[i] = []
-    # make sure to do this after nprocs has its value
-    if recvTimeout == 20:  # still the default
-        recvTimeoutMultiplier = 0.1
-        if os.environ.has_key('MPD_RECVTIMEOUT_MULTIPLIER'):
-            try:
-                recvTimeoutMultiplier = int(os.environ ['MPD_RECVTIMEOUT_MULTIPLIER'])
-            except ValueError:
-                try:
-                    recvTimeoutMultiplier = float(os.environ ['MPD_RECVTIMEOUT_MULTIPLIER'])
-                except ValueError:
-                    print 'Invalid MPD_RECVTIMEOUT_MULTIPLIER. Value must be a number.'
-                    sys.exit(-1)
-        recvTimeout = int(parmdb['nprocs']) * recvTimeoutMultiplier
-
-    if parmdb['MPIEXEC_EXITCODES_FILENAME']:
-        if parmdb['ecfn_format'] == 'xml':
-            try:
-                import xml.dom.minidom
-            except:
-                print 'you requested to save the exit codes in an xml file, but'
-                print '  I was unable to import the xml.dom.minidom module'
-                sys.exit(-1)
-            outXmlDoc = xml.dom.minidom.Document()
-            outECs = outXmlDoc.createElement('exit-codes')
-            outXmlDoc.appendChild(outECs)
-        else:
-            outECs = 'exit-codes\n'
-
-    msgToMPD['nprocs'] = parmdb['nprocs']
-    msgToMPD['limits'][(0,parmdb['nprocs']-1)]  = {}
-    msgToMPD['conport'] = listenPort
-    msgToMPD['conip'] = myIP
-    msgToMPD['conifhn'] = parmdb['MPIEXEC_IFHN']
-    if parmdb['MPIEXEC_JOB_ALIAS']:
-        msgToMPD['jobalias'] = parmdb['MPIEXEC_JOB_ALIAS']
-    else:
-        msgToMPD['jobalias'] = ''
-    if parmdb['MPIEXEC_TRY_1ST_LOCALLY']:
-        msgToMPD['try_1st_locally'] = 1
-    if parmdb['rship']:
-        msgToMPD['rship'] = parmdb['rship']
-        msgToMPD['mship_host'] = socket.gethostname()
-        msgToMPD['mship_port'] = mshipPort
-    if parmdb['MPIEXEC_BNR']:
-        msgToMPD['doing_bnr'] = 1
-    if parmdb['MPIEXEC_STDIN_DEST'] == 'all':
-        stdinDest = '0-%d' % (parmdb['nprocs']-1)
-    else:
-        stdinDest = parmdb['MPIEXEC_STDIN_DEST']
-    if parmdb['MPIEXEC_SHOW_LINE_LABELS']:
-        msgToMPD['line_labels'] = parmdb['MPIEXEC_LINE_LABEL_FMT']
-    else:
-        msgToMPD['line_labels'] = ''
-    msgToMPD['stdin_dest'] = stdinDest
-    msgToMPD['gdb'] = parmdb['MPIEXEC_GDB']
-    msgToMPD['gdba'] = parmdb['-gdba']
-    msgToMPD['totalview'] = parmdb['MPIEXEC_TOTALVIEW']
-    msgToMPD['singinitpid'] = parmdb['singinitpid']
-    msgToMPD['singinitport'] = parmdb['singinitport']
-    msgToMPD['host_spec_pool'] = parmdb['MPIEXEC_HOST_LIST']
-
-    # set sig handlers up right before we send mpdrun msg to mpd
-    if hasattr(signal,'SIGINT'):
-        signal.signal(signal.SIGINT, sig_handler)
-    if hasattr(signal,'SIGTSTP'):
-        signal.signal(signal.SIGTSTP,sig_handler)
-    if hasattr(signal,'SIGCONT'):
-        signal.signal(signal.SIGCONT,sig_handler)
-    if hasattr(signal,'SIGALRM'):
-        signal.signal(signal.SIGALRM,sig_handler)
-
-    conSock.send_dict_msg(msgToMPD)
-    msg = conSock.recv_dict_msg(timeout=recvTimeout)
-    if not msg:
-        mpd_print(1, 'no msg recvd from mpd when expecting ack of request')
-        sys.exit(-1)
-    elif msg['cmd'] == 'mpdrun_ack':
-        currRingSize = msg['ringsize']
-        currRingNCPUs = msg['ring_ncpus']
-    else:
-        if msg['cmd'] == 'already_have_a_console':
-            print 'mpd already has a console (e.g. for long ringtest); try later'
-            sys.exit(-1)
-        elif msg['cmd'] == 'job_failed':
-            if  msg['reason'] == 'some_procs_not_started':
-                print 'mpiexec: unable to start all procs; may have invalid machine names'
-                print '    remaining specified hosts:'
-                for host in msg['remaining_hosts'].values():
-                    if host != '_any_':
-                        try:
-                            print '        %s (%s)' % (host,socket.gethostbyaddr(host)[0])
-                        except:
-                            print '        %s' % (host)
-            elif  msg['reason'] == 'invalid_username':
-                print 'mpiexec: invalid username %s at host %s' % \
-                      (msg['username'],msg['host'])
-            else:
-                print 'mpiexec: job failed; reason=:%s:' % (msg['reason'])
-            sys.exit(-1)
-        else:
-            mpd_print(1, 'unexpected message from mpd: %s' % (msg) )
-            sys.exit(-1)
-    conSock.close()
-    jobTimeout = int(parmdb['MPIEXEC_TIMEOUT'])
-    if jobTimeout:
-        if hasattr(signal,'alarm'):
-            signal.alarm(jobTimeout)
-        else:
-            def timeout_function():
-                mpd_print(1,'job ending due to env var MPIEXEC_TIMEOUT=%d' % jobTimeout)
-                thread.interrupt_main()
-            try:
-                import thread, threading
-                timer = threading.Timer(jobTimeout,timeout_function)
-                timer.start()
-            except:
-                print 'unable to establish timeout for MPIEXEC_TIMEOUT'
-
-    streamHandler = MPDStreamHandler()
-
-    (manSock,addr) = listenSock.accept()
-    if not manSock:
-        mpd_print(1, 'mpiexec: failed to obtain sock from manager')
-        sys.exit(-1)
-    streamHandler.set_handler(manSock,handle_man_input,args=(streamHandler,))
-    if hasattr(os,'fork'):
-        streamHandler.set_handler(sys.stdin,handle_stdin_input,
-                                  args=(parmdb,streamHandler,manSock))
-    else:  # not using select on fd's when using subprocess module (probably M$)
-        import threading
-        def read_fd_with_func(fd,func):
-            line = 'x'
-            while line:
-                line = func(fd)
-        stdin_thread = threading.Thread(target=read_fd_with_func,
-                                        args=(sys.stdin.fileno(),handle_stdin_input))
-    # first, do handshaking with man
-    msg = manSock.recv_dict_msg()
-    if (not msg  or  not msg.has_key('cmd') or msg['cmd'] != 'man_checking_in'):
-        mpd_print(1, 'mpiexec: from man, invalid msg=:%s:' % (msg) )
-        sys.exit(-1)
-    msgToSend = { 'cmd' : 'ringsize', 'ring_ncpus' : currRingNCPUs,
-                  'ringsize' : currRingSize }
-    manSock.send_dict_msg(msgToSend)
-    msg = manSock.recv_dict_msg()
-    if (not msg  or  not msg.has_key('cmd')):
-        mpd_print(1, 'mpiexec: from man, invalid msg=:%s:' % (msg) )
-        sys.exit(-1)
-    if (msg['cmd'] == 'job_started'):
-        jobid = msg['jobid']
-        if outECs:
-            if parmdb['ecfn_format'] == 'xml':
-                outECs.setAttribute('jobid',jobid.strip())
-            else:
-                outECs += 'jobid=%s\n' % (jobid.strip())
-        # print 'mpiexec: job %s started' % (jobid)
-        if parmdb['MPIEXEC_TVSU']:
-            import mtv
-            mtv.allocate_proctable(parmdb['nprocs'])
-            # extract procinfo (rank,hostname,exec,pid) tuples from msg
-            for i in range(parmdb['nprocs']):
-                tvhost = msg['procinfo'][i][0]
-                tvpgm  = msg['procinfo'][i][1]
-                tvpid  = msg['procinfo'][i][2]
-                # print "%d %s %s %d" % (i,host,pgm,pid)
-                mtv.append_proctable_entry(tvhost,tvpgm,tvpid)
-            mtv.complete_spawn()
-            msgToSend = { 'cmd' : 'tv_ready' }
-            manSock.send_dict_msg(msgToSend)
-        elif parmdb['MPIEXEC_TOTALVIEW']:
-            tvname = 'totalview'
-            if os.environ.has_key('TOTALVIEW'):
-                tvname = os.environ['TOTALVIEW']
-            if not mpd_which(((tvname.strip()).split()[0])):
-                print 'cannot find "%s" in your $PATH:' % (tvname)
-                print '    ', os.environ['PATH']
-                sys.exit(-1)
-            import mtv
-            tv_cmd = 'dattach python ' + `os.getpid()` + '; dgo; dassign MPIR_being_debugged 1'
-            os.system(tvname + ' -e "%s" &' % (tv_cmd) )
-            mtv.wait_for_debugger()
-            mtv.allocate_proctable(parmdb['nprocs'])
-            # extract procinfo (rank,hostname,exec,pid) tuples from msg
-            for i in range(parmdb['nprocs']):
-                tvhost = msg['procinfo'][i][0]
-                tvpgm  = msg['procinfo'][i][1]
-                tvpid  = msg['procinfo'][i][2]
-                # print "%d %s %s %d" % (i,host,pgm,pid)
-                mtv.append_proctable_entry(tvhost,tvpgm,tvpid)
-            mtv.complete_spawn()
-            msgToSend = { 'cmd' : 'tv_ready' }
-            manSock.send_dict_msg(msgToSend)
-    else:
-        mpd_print(1, 'mpiexec: from man, unknown msg=:%s:' % (msg) )
-        sys.exit(-1)
-
-    (manCliStdoutSock,addr) = listenSock.accept()
-    streamHandler.set_handler(manCliStdoutSock,
-                              handle_cli_stdout_input,
-                              args=(parmdb,streamHandler,linesPerRank,))
-    (manCliStderrSock,addr) = listenSock.accept()
-    streamHandler.set_handler(manCliStderrSock,
-                              handle_cli_stderr_input,
-                              args=(streamHandler,))
-
-    # Main Loop
-    timeDelayForPrints = 2  # seconds
-    timeForPrint = time() + timeDelayForPrints   # to get started
-    numDoneWithIO = 0
-    while numDoneWithIO < 3:    # man, client stdout, and client stderr
-        if sigOccurred:
-            handle_sig_occurred(manSock)
-        rv = streamHandler.handle_active_streams(timeout=1.0)
-        if rv[0] < 0:  # will handle some sigs at top of next loop
-            pass       # may have to handle some err conditions here
-        if parmdb['MPIEXEC_MERGE_OUTPUT']:
-            if timeForPrint < time():
-                print_ready_merged_lines(1,parmdb,linesPerRank)
-                timeForPrint = time() + timeDelayForPrints
-            else:
-                print_ready_merged_lines(parmdb['nprocs'],parmdb,linesPerRank)
-
-    if parmdb['MPIEXEC_MERGE_OUTPUT']:
-        print_ready_merged_lines(1,parmdb,linesPerRank)
-    if mshipPid:
-        (donePid,status) = os.wait()    # os.waitpid(mshipPid,0)
-    if parmdb['MPIEXEC_EXITCODES_FILENAME']:
-        outECFile = open(parmdb['MPIEXEC_EXITCODES_FILENAME'],'w')
-        if parmdb['ecfn_format'] == 'xml':
-            print >>outECFile, outXmlDoc.toprettyxml(indent='   ')
-        else:
-            print >>outECFile, outECs,
-        outECFile.close()
-    return myExitStatus
-
-
-def collect_args(args,localArgSets):
-    validGlobalArgs = { '-l' : 0, '-usize' : 1, '-gdb' : 0, '-bnr' : 0,
-                        '-tv' : 0, '-tvsu' : 0,
-                        '-ifhn' : 1, '-machinefile' : 1, '-s' : 1, '-1' : 0,
-                        '-a' : 1, '-m' : 0, '-ecfn' : 1, '-recvtimeout' : 1,
-                        '-gn' : 1, '-gnp' : 1, '-ghost' : 1, '-gpath' : 1, '-gwdir' : 1,
-			'-gsoft' : 1, '-garch' : 1, '-gexec' : 1, '-gumask' : 1,
-			'-genvall' : 0, '-genv' : 2, '-genvnone' : 0,
-			'-genvlist' : 1 }
-    currumask = os.umask(0) ; os.umask(currumask)  # grab it and set it back
-    parmdb[('cmdline','-gn')]          = 1
-    parmdb[('cmdline','-ghost')]       = '_any_'
-    if os.environ.has_key('PATH'):
-        parmdb[('cmdline','-gpath')]   = os.environ['PATH']
-    else:
-        parmdb[('cmdline','-gpath')]   =  ''
-    parmdb[('cmdline','-gwdir')]       = os.path.abspath(os.getcwd())
-    parmdb[('cmdline','-gumask')]      = str(currumask)
-    parmdb[('cmdline','-gsoft')]       = 0
-    parmdb[('cmdline','-garch')]       = ''
-    parmdb[('cmdline','-gexec')]       = ''
-    parmdb[('cmdline','-genv')]        = {}
-    parmdb[('cmdline','-genvlist')]    = []
-    parmdb[('cmdline','-genvnone')]    = 0
-    argidx = 1
-    while argidx < len(args)  and  args[argidx] in validGlobalArgs.keys():
-        garg = args[argidx]
-        if len(args) <= (argidx+validGlobalArgs[garg]):
-            print "missing sub-arg to %s" % (garg)
-            usage()
-        if garg == '-genv':
-            parmdb['-genv'][args[argidx+1]] = args[argidx+2]
-            argidx += 3
-        elif garg == '-gn'  or  garg == '-gnp':
-            if args[argidx+1].isdigit():
-                parmdb[('cmdline','-gn')] = int(args[argidx+1])
-            else:
-                print 'argument to %s must be numeric' % (garg)
-                usage()
-            argidx += 2
-        elif garg == '-ghost':
-            try:
-                parmdb[('cmdline',garg)] = socket.gethostbyname_ex(args[argidx+1])[2][0]
-            except:
-                print 'unable to do find info for host %s' % (args[argidx+1])
-                sys.exit(-1)
-            argidx += 2
-        elif garg == '-gpath':
-            parmdb[('cmdline','-gpath')] = args[argidx+1]
-            argidx += 2
-        elif garg == '-gwdir':
-            parmdb[('cmdline','-gwdir')] = args[argidx+1]
-            argidx += 2
-        elif garg == '-gumask':
-            parmdb[('cmdline','-gumask')] = args[argidx+1]
-            argidx += 2
-        elif garg == '-gsoft':
-            parmdb[('cmdline','-gsoft')] = args[argidx+1]
-            argidx += 2
-        elif garg == '-garch':
-            parmdb[('cmdline','-garch')] = args[argidx+1]
-            argidx += 2
-            print '** -garch is accepted but not used'
-        elif garg == '-gexec':
-            parmdb[('cmdline','-gexec')] = args[argidx+1]
-            argidx += 2
-        elif garg == '-genv':
-            parmdb[('cmdline','-genv')] = args[argidx+1]
-            argidx += 2
-        elif garg == '-genvlist':
-            parmdb[('cmdline','-genvlist')] = args[argidx+1].split(',')
-            argidx += 2
-        elif garg == '-genvnone':
-            parmdb[('cmdline','-genvnone')] = args[argidx+1]
-            argidx += 1
-        elif garg == '-l':
-            parmdb[('cmdline','MPIEXEC_SHOW_LINE_LABELS')] = 1
-            argidx += 1
-        elif garg == '-a':
-            parmdb[('cmdline','MPIEXEC_JOB_ALIAS')] = args[argidx+1]
-            argidx += 2
-        elif garg == '-usize':
-            if args[argidx+1].isdigit():
-                parmdb[('cmdline','MPIEXEC_USIZE')] = int(args[argidx+1])
-            else:
-                print 'argument to %s must be numeric' % (garg)
-                usage()
-            argidx += 2
-        elif garg == '-recvtimeout':
-            if args[argidx+1].isdigit():
-                parmdb[('cmdline','MPIEXEC_RECV_TIMEOUT')] = int(args[argidx+1])
-            else:
-                print 'argument to %s must be numeric' % (garg)
-                usage()
-            argidx += 2
-        elif garg == '-gdb':
-            parmdb[('cmdline','MPIEXEC_GDB')] = 1
-            argidx += 1
-            parmdb[('cmdline','MPIEXEC_MERGE_OUTPUT')] = 1       # implied
-            parmdb[('cmdline','MPIEXEC_SHOW_LINE_LABELS')] = 1   # implied
-            parmdb[('cmdline','MPIEXEC_STDIN_DEST')]   = 'all'   # implied
-        elif garg == '-ifhn':
-            parmdb[('cmdline','MPIEXEC_IFHN')] = args[argidx+1]
-            argidx += 2
-            try:
-                hostinfo = socket.gethostbyname_ex(parmdb['MPIEXEC_IFHN'])
-            except:
-                print 'mpiexec: gethostbyname_ex failed for ifhn %s' % (parmdb['MPIEXEC_IFHN'])
-                sys.exit(-1)
-        elif garg == '-m':
-            parmdb[('cmdline','MPIEXEC_MERGE_OUTPUT')] = 1
-            argidx += 1
-        elif garg == '-s':
-            parmdb[('cmdline','MPIEXEC_STDIN_DEST')] = args[argidx+1]
-            argidx += 2
-        elif garg == '-machinefile':
-            parmdb[('cmdline','MPIEXEC_MACHINEFILE')] = args[argidx+1]
-            argidx += 2
-        elif garg == '-bnr':
-            parmdb[('cmdline','MPIEXEC_BNR')] = 1
-            argidx += 1
-        elif garg == '-tv':
-            parmdb[('cmdline','MPIEXEC_TOTALVIEW')] = 1
-            argidx += 1
-        elif garg == '-tvsu':
-            parmdb[('cmdline','MPIEXEC_TOTALVIEW')] = 1
-            parmdb[('cmdline','MPIEXEC_TVSU')] = 1
-            argidx += 1
-        elif garg == '-ecfn':
-            parmdb[('cmdline','MPIEXEC_EXITCODES_FILENAME')] = args[argidx+1]
-            argidx += 2
-        elif garg == '-1':
-            parmdb[('cmdline','MPIEXEC_TRY_1ST_LOCALLY')] = 0  # reverses meaning
-            argidx += 1
-    if len(args) <= argidx:
-        print "mpiexec: missing arguments after global args"
-        usage()
-    if args[argidx] == ':':
-        argidx += 1
-    localArgsKey = 0
-    # collect local arg sets but do not validate them until handled below
-    while argidx < len(args):
-        if args[argidx] == ':':
-            localArgsKey += 1
-            localArgSets[localArgsKey] = []
-        else:
-            localArgSets[localArgsKey].append(args[argidx])
-        argidx += 1
-
-def handle_local_argset(argset,machineFileInfo,msgToMPD):
-    global parmdb, nextRange, appnum, recvTimeout
-    validLocalArgs  = { '-n' : 1, '-np' : 1, '-host' : 1, '-path' : 1, '-wdir' : 1,
-                        '-soft' : 1, '-arch' : 1, '-umask' : 1,
-			'-envall' : 0, '-env' : 2, '-envnone' : 0, '-envlist' : 1 }
-    host   = parmdb['-ghost']
-    wdir   = parmdb['-gwdir']
-    wumask = parmdb['-gumask']
-    wpath  = parmdb['-gpath']
-    nProcs = parmdb['-gn']
-    usize  = parmdb['MPIEXEC_USIZE']
-    gexec  = parmdb['-gexec']
-    softness =  parmdb['-gsoft']
-    if parmdb['-genvnone']:
-        envall = 0
-    else:
-        envall = 1
-    localEnvlist = []
-    localEnv  = {}
-    
-    argidx = 0
-    while argidx < len(argset):
-        if argset[argidx] not in validLocalArgs:
-            if argset[argidx][0] == '-':
-                print 'invalid "local" arg: %s' % argset[argidx]
-                usage()
-            break                       # since now at executable
-        if parmdb['MPIEXEC_MACHINEFILE']:
-            if argset[argidx] == '-host'  or  argset[argidx] == ['-ghost']:
-                print '-host (or -ghost) and -machinefile are incompatible'
-                sys.exit(-1)
-        if argset[argidx] == '-n' or argset[argidx] == '-np':
-            if len(argset) < (argidx+2):
-                print '** missing arg to -n'
-                usage()
-            nProcs = argset[argidx+1]
-            if not nProcs.isdigit():
-                print '** non-numeric arg to -n: %s' % nProcs
-                usage()
-            nProcs = int(nProcs)
-            argidx += 2
-        elif argset[argidx] == '-host':
-            if len(argset) < (argidx+2):
-                print '** missing arg to -host'
-                usage()
-            try:
-                host = socket.gethostbyname_ex(argset[argidx+1])[2][0]
-            except:
-                print 'unable to do find info for host %s' % (argset[argidx+1])
-                sys.exit(-1)
-            argidx += 2
-        elif argset[argidx] == '-path':
-            if len(argset) < (argidx+2):
-                print '** missing arg to -path'
-                usage()
-            wpath = argset[argidx+1]
-            argidx += 2
-        elif argset[argidx] == '-wdir':
-            if len(argset) < (argidx+2):
-                print '** missing arg to -wdir'
-                usage()
-            wdir = argset[argidx+1]
-            argidx += 2
-        elif argset[argidx] == '-umask':
-            if len(argset) < (argidx+2):
-                print '** missing arg to -umask'
-                usage()
-            wumask = argset[argidx+1]
-            argidx += 2
-        elif argset[argidx] == '-soft':
-            if len(argset) < (argidx+2):
-                print '** missing arg to -soft'
-                usage()
-            softness = argset[argidx+1]
-            argidx += 2
-        elif argset[argidx] == '-arch':
-            if len(argset) < (argidx+2):
-                print '** missing arg to -arch'
-                usage()
-            print '** -arch is accepted but not used'
-            argidx += 2
-        elif argset[argidx] == '-envall':
-            envall = 1
-            argidx += 1
-        elif argset[argidx] == '-envnone':
-            envall = 0
-            argidx += 1
-        elif argset[argidx] == '-envlist':
-            localEnvlist = argset[argidx+1].split(',')
-            argidx += 2
-        elif argset[argidx] == '-env':
-            if len(argset) < (argidx+3):
-                print '** missing arg to -env'
-                usage()
-            var = argset[argidx+1]
-            val = argset[argidx+2]
-            localEnv[var] = val
-            argidx += 3
-        else:
-            print 'unknown "local" option: %s' % argset[argidx]
-            usage()
-
-    if softness:
-        nProcs = adjust_nprocs(nProcs,softness)
-
-    cmdAndArgs = []
-    if argidx < len(argset):
-        while argidx < len(argset):
-            cmdAndArgs.append(argset[argidx])
-            argidx += 1
-    else:
-        if gexec:
-            cmdAndArgs = [gexec]
-    if not cmdAndArgs:
-        print 'no cmd specified'
-        usage()
-
-    argsetLoRange = nextRange
-    argsetHiRange = nextRange + nProcs - 1
-    loRange = argsetLoRange
-    hiRange = argsetHiRange
-
-    defaultHostForArgset = host
-    while loRange <= argsetHiRange:
-        host = defaultHostForArgset
-        if machineFileInfo:
-            if len(machineFileInfo) <= hiRange:
-                print 'too few entries in machinefile'
-                sys.exit(-1)
-            host = machineFileInfo[loRange]['host']
-            ifhn = machineFileInfo[loRange]['ifhn']
-            if ifhn:
-                msgToMPD['ifhns'][loRange] = ifhn
-            for i in range(loRange+1,hiRange+1):
-                if machineFileInfo[i]['host'] != host  or  machineFileInfo[i]['ifhn'] != ifhn:
-                    hiRange = i - 1
-                    break
-
-        asRange = (loRange,hiRange)  # this argset range as a tuple
-
-        msgToMPD['users'][asRange]  = mpd_get_my_username()
-        msgToMPD['execs'][asRange]  = cmdAndArgs[0]
-        msgToMPD['paths'][asRange]  = wpath
-        msgToMPD['cwds'][asRange]   = wdir
-        msgToMPD['umasks'][asRange] = wumask
-        msgToMPD['args'][asRange]   = cmdAndArgs[1:]
-        if host.startswith('_any_'):
-            msgToMPD['hosts'][(loRange,hiRange)] = host
-        else:
-            try:
-                msgToMPD['hosts'][asRange] = socket.gethostbyname_ex(host)[2][0]
-            except:
-                print 'unable to do find info for host %s' % (host)
-                sys.exit(-1)
-
-        envToSend = {}
-        if envall:
-            for envvar in os.environ.keys():
-                envToSend[envvar] = os.environ[envvar]
-        for envvar in parmdb['-genvlist']:
-            if not os.environ.has_key(envvar):
-                print '%s in envlist does not exist in your env' % (envvar)
-                sys.exit(-1)
-            envToSend[envvar] = os.environ[envvar]
-        for envvar in localEnvlist:
-            if not os.environ.has_key(envvar):
-                print '%s in envlist does not exist in your env' % (envvar)
-                sys.exit(-1)
-            envToSend[envvar] = os.environ[envvar]
-        for envvar in parmdb['-genv'].keys():
-            envToSend[envvar] = parmdb['-genv'][envvar]
-        for envvar in localEnv.keys():
-            envToSend[envvar] = localEnv[envvar]
-        if usize:
-            envToSend['MPI_UNIVERSE_SIZE'] = str(usize)
-        envToSend['MPI_APPNUM'] = str(appnum)
-        msgToMPD['envvars'][(loRange,hiRange)] = envToSend
-
-        loRange = hiRange + 1
-        hiRange = argsetHiRange  # again
-
-    appnum += 1
-    nextRange += nProcs
-    parmdb[('cmdline','nprocs')] = parmdb['nprocs'] + nProcs
-    
-# Adjust nProcs (called maxprocs in the Standard) according to soft:
-# Our interpretation is that we need the largest number <= nProcs that is
-# consistent with the list of possible values described by soft.  I.e.
-# if the user says
-#
-#   mpiexec -n 10 -soft 5 a.out
-#
-# we adjust the 10 down to 5.  This may not be what was intended in the Standard,
-# but it seems to be what it says.
-
-def adjust_nprocs(nProcs,softness):
-    biglist = []
-    list1 = softness.split(',')
-    for triple in list1:                # triple is a or a:b or a:b:c
-        thingy = triple.split(':')     
-        if len(thingy) == 1:
-            a = int(thingy[0])
-            if a <= nProcs and a >= 0:
-                biglist.append(a)
-        elif len(thingy) == 2:
-            a = int(thingy[0])
-            b = int(thingy[1])
-            for i in range(a,b+1):
-                if i <= nProcs and i >= 0:
-                    biglist.append(i)
-        elif len(thingy) == 3:
-            a = int(thingy[0])
-            b = int(thingy[1])
-            c = int(thingy[2])
-            for i in range(a,b+1,c):
-                if i <= nProcs and i >= 0:
-                    biglist.append(i)                
-        else:
-            print 'invalid subargument to -soft: %s' % (softness)
-            print 'should be a or a:b or a:b:c'
-            usage()
-
-        if len(biglist) == 0:
-            print '-soft argument %s allows no valid number of processes' % (softness)
-            usage()
-        else:
-            return max(biglist)
-
-
-def read_machinefile(machineFilename):
-    if not machineFilename:
-        return None
-    try:
-        machineFile = open(machineFilename,'r')
-    except:
-        print '** unable to open machinefile'
-        sys.exit(-1)
-    procID = 0
-    machineFileInfo = {}
-    for line in machineFile:
-        line = line.strip()
-        if not line  or  line[0] == '#':
-            continue
-        splitLine = re.split(r'\s+',line)
-        host = splitLine[0]
-        if ':' in host:
-            (host,nprocs) = host.split(':',1)
-            nprocs = int(nprocs)
-        else:
-            nprocs = 1
-        kvps = {'ifhn' : ''}
-        for kv in splitLine[1:]:
-            (k,v) = kv.split('=',1)
-            if k == 'ifhn':  # interface hostname
-                kvps[k] = v
-            else:  # may be other kv pairs later
-                print 'unrecognized key in machinefile:', k
-                sys.exit(-1)
-        for i in range(procID,procID+nprocs):
-            machineFileInfo[i] = { 'host' : host, 'nprocs' : nprocs }
-            machineFileInfo[i].update(kvps)
-        procID += nprocs
-    return machineFileInfo
-
-def handle_man_input(sock,streamHandler):
-    global numDoneWithIO, myExitStatus
-    global outXmlDoc, outECs
-    msg = sock.recv_dict_msg()
-    if not msg:
-        streamHandler.del_handler(sock)
-        numDoneWithIO += 1
-    elif not msg.has_key('cmd'):
-        mpd_print(1,'mpiexec: from man, invalid msg=:%s:' % (msg) )
-        sys.exit(-1)
-    elif msg['cmd'] == 'startup_status':
-        if msg['rc'] != 0:
-            # print 'rank %d (%s) in job %s failed to find executable %s' % \
-                  # ( msg['rank'], msg['src'], msg['jobid'], msg['exec'] )
-            host = msg['src'].split('_')[0]
-            reason = unquote(msg['reason'])
-            print 'problem with execution of %s  on  %s:  %s ' % \
-                  (msg['exec'],host,reason)
-            # don't stop ; keep going until all top-level mans finish
-    elif msg['cmd'] == 'job_aborted_early':
-        print 'rank %d in job %s caused collective abort of all ranks' % \
-              ( msg['rank'], msg['jobid'] )
-        status = msg['exit_status']
-        if hasattr(os,'WIFSIGNALED')  and  os.WIFSIGNALED(status):
-            if status > myExitStatus:
-                myExitStatus = status
-            killed_status = status & 0x007f  # AND off core flag
-            print '  exit status of rank %d: killed by signal %d ' % \
-                  (msg['rank'],killed_status)
-        elif hasattr(os,'WEXITSTATUS'):
-            exit_status = os.WEXITSTATUS(status)
-            if exit_status > myExitStatus:
-                myExitStatus = exit_status
-            print '  exit status of rank %d: return code %d ' % \
-                  (msg['rank'],exit_status)
-        else:
-            myExitStatus = 0
-    elif msg['cmd'] == 'job_aborted':
-        print 'job aborted; reason = %s' % (msg['reason'])
-    elif msg['cmd'] == 'client_exit_status':
-        if outECs:
-            if parmdb['ecfn_format'] == 'xml':
-                outXmlProc = outXmlDoc.createElement('exit-code')
-                outECs.appendChild(outXmlProc)
-                outXmlProc.setAttribute('rank',str(msg['cli_rank']))
-                outXmlProc.setAttribute('status',str(msg['cli_status']))
-                outXmlProc.setAttribute('pid',str(msg['cli_pid']))
-                outXmlProc.setAttribute('host',msg['cli_host'])  # cli_ifhn is also avail
-            else:
-                outECs += 'rank=%d status=%d pid=%d host=%s\n' % \
-                          (msg['cli_rank'],msg['cli_status'],msg['cli_pid'],msg['cli_host'])
-
-        # print "exit info: rank=%d  host=%s  pid=%d  status=%d" % \
-              # (msg['cli_rank'],msg['cli_host'],
-               # msg['cli_pid'],msg['cli_status'])
-        status = msg['cli_status']
-        if hasattr(os,'WIFSIGNALED')  and  os.WIFSIGNALED(status):
-            if status > myExitStatus:
-                myExitStatus = status
-            killed_status = status & 0x007f  # AND off core flag
-            # print 'exit status of rank %d: killed by signal %d ' % \
-            #        (msg['cli_rank'],killed_status)
-        elif hasattr(os,'WEXITSTATUS'):
-            exit_status = os.WEXITSTATUS(status)
-            if exit_status > myExitStatus:
-                myExitStatus = exit_status
-            # print 'exit status of rank %d: return code %d ' % \
-            #       (msg['cli_rank'],exit_status)
-        else:
-            myExitStatus = 0
-    else:
-        print 'unrecognized msg from manager :%s:' % msg
-
-def handle_cli_stdout_input(sock,parmdb,streamHandler,linesPerRank):
-    global numDoneWithIO
-    if parmdb['MPIEXEC_MERGE_OUTPUT']:
-        line = sock.recv_one_line()
-        if not line:
-            streamHandler.del_handler(sock)
-            numDoneWithIO += 1
-        else:
-            if parmdb['MPIEXEC_GDB']:
-                line = line.replace('(gdb)\n','(gdb) ')
-            try:
-                (rank,rest) = line.split(':',1)
-                rank = int(rank)
-                linesPerRank[rank].append(rest)
-            except:
-                print line
-            print_ready_merged_lines(parmdb['nprocs'],parmdb,linesPerRank)
-    else:
-        msg = sock.recv(1024)
-        if not msg:
-            streamHandler.del_handler(sock)
-            numDoneWithIO += 1
-        else:
-            sys.stdout.write(msg)
-            sys.stdout.flush()
-
-def handle_cli_stderr_input(sock,streamHandler):
-    global numDoneWithIO
-    msg = sock.recv(1024)
-    if not msg:
-        streamHandler.del_handler(sock)
-        numDoneWithIO += 1
-    else:
-        sys.stderr.write(msg)
-        sys.stderr.flush()
-
-# NOTE: stdin is supposed to be slow, low-volume.  We read it all here (as it
-# appears on the fd) and send it immediately to the receivers.  If the user 
-# redirects a "large" file (perhaps as small as 5k) into us, we will send it
-# all out right away.  This can cause things to hang on the remote (recvr) side.
-# We do not wait to read here until the recvrs read because there may be several
-# recvrs and they may read at different speeds/times.
-def handle_stdin_input(stdin_stream,parmdb,streamHandler,manSock):
-    line  = ''
-    try:
-        line = stdin_stream.readline()
-    except IOError, errinfo:
-        sys.stdin.flush()  # probably does nothing
-        # print "I/O err on stdin:", errinfo
-        mpd_print(1,'stdin problem; if pgm is run in background, redirect from /dev/null')
-        mpd_print(1,'    e.g.: mpiexec -n 4 a.out < /dev/null &')
-    else:
-        gdbFlag = parmdb['MPIEXEC_GDB']
-        if line:    # not EOF
-            msgToSend = { 'cmd' : 'stdin_from_user', 'line' : line } # default
-            if gdbFlag and line.startswith('z'):
-                line = line.rstrip()
-                if len(line) < 3:    # just a 'z'
-                    line += ' 0-%d' % (parmdb['nprocs']-1)
-                s1 = line[2:].rstrip().split(',')
-                for s in s1:
-                    s2 = s.split('-')
-                    for i in s2:
-                        if not i.isdigit():
-                            print 'invalid arg to z :%s:' % i
-                            continue
-                msgToSend = { 'cmd' : 'stdin_dest', 'stdin_procs' : line[2:] }
-                sys.stdout.softspace = 0
-                print '%s:  (gdb) ' % (line[2:]),
-            elif gdbFlag and line.startswith('q'):
-                msgToSend = { 'cmd' : 'stdin_dest',
-                              'stdin_procs' : '0-%d' % (parmdb['nprocs']-1) }
-                if manSock:
-                    manSock.send_dict_msg(msgToSend)
-                msgToSend = { 'cmd' : 'stdin_from_user','line' : 'q\n' }
-            elif gdbFlag and line.startswith('^'):
-                msgToSend = { 'cmd' : 'stdin_dest',
-                              'stdin_procs' : '0-%d' % (parmdb['nprocs']-1) }
-                if manSock:
-                    manSock.send_dict_msg(msgToSend)
-                msgToSend = { 'cmd' : 'signal', 'signo' : 'SIGINT' }
-            if manSock:
-                manSock.send_dict_msg(msgToSend)
-        else:
-            streamHandler.del_handler(sys.stdin)
-            sys.stdin.close()
-            if manSock:
-                msgToSend = { 'cmd' : 'stdin_from_user', 'eof' : '' }
-                manSock.send_dict_msg(msgToSend)
-    return line
-
-def handle_sig_occurred(manSock):
-    global sigOccurred
-    if sigOccurred == signal.SIGINT:
-        if manSock:
-            msgToSend = { 'cmd' : 'signal', 'signo' : 'SIGINT' }
-            manSock.send_dict_msg(msgToSend)
-            manSock.close()
-        sys.exit(-1)
-    elif sigOccurred == signal.SIGALRM:
-        if manSock:
-            msgToSend = { 'cmd' : 'signal', 'signo' : 'SIGKILL' }
-            manSock.send_dict_msg(msgToSend)
-            manSock.close()
-        mpd_print(1,'job ending due to env var MPIEXEC_TIMEOUT=%s' % \
-                  os.environ['MPIEXEC_TIMEOUT'])
-        sys.exit(-1)
-    elif sigOccurred == signal.SIGTSTP:
-        sigOccurred = 0  # do this before kill below
-        if manSock:
-            msgToSend = { 'cmd' : 'signal', 'signo' : 'SIGTSTP' }
-            manSock.send_dict_msg(msgToSend)
-        signal.signal(signal.SIGTSTP,signal.SIG_DFL)      # stop myself
-        os.kill(os.getpid(),signal.SIGTSTP)
-        signal.signal(signal.SIGTSTP,sig_handler)  # restore this handler
-    elif sigOccurred == signal.SIGCONT:
-        sigOccurred = 0  # do it before handling
-        if manSock:
-            msgToSend = { 'cmd' : 'signal', 'signo' : 'SIGCONT' }
-            manSock.send_dict_msg(msgToSend)
-
-def sig_handler(signum,frame):
-    global sigOccurred
-    sigOccurred = signum
-    mpd_handle_signal(signum,frame)
-
-def format_sorted_ranks(ranks):
-    all = []
-    one = []
-    prevRank = -999
-    for i in range(len(ranks)):
-        if i != 0  and  ranks[i] != (prevRank+1):
-            all.append(one)
-            one = []
-        one.append(ranks[i])
-        if i == (len(ranks)-1):
-            all.append(one)
-        prevRank = ranks[i]
-    pline = ''
-    for i in range(len(all)):
-        if len(all[i]) > 1:
-            pline += '%d-%d' % (all[i][0],all[i][-1])
-        else:
-            pline += '%d' % (all[i][0])
-        if i != (len(all)-1):
-            pline += ','
-    return pline
-
-def print_ready_merged_lines(minRanks,parmdb,linesPerRank):
-    printFlag = 1  # default to get started
-    while printFlag:
-        printFlag = 0
-        for r1 in range(parmdb['nprocs']):
-            if not linesPerRank[r1]:
-                continue
-            sortedRanks = []
-            lineToPrint = linesPerRank[r1][0]
-            for r2 in range(parmdb['nprocs']):
-                if linesPerRank[r2] and linesPerRank[r2][0] == lineToPrint: # myself also
-                    sortedRanks.append(r2)
-            if len(sortedRanks) >= minRanks:
-                fsr = format_sorted_ranks(sortedRanks)
-                sys.stdout.softspace = 0
-                print '%s: %s' % (fsr,lineToPrint),
-                for r2 in sortedRanks:
-                    linesPerRank[r2] = linesPerRank[r2][1:]
-                printFlag = 1
-    sys.stdout.flush()
-
-def get_parms_from_xml_file(msgToMPD):
-    global parmdb
-    try:
-        import xml.dom.minidom
-    except:
-        print 'you requested to parse an xml file, but'
-        print '  I was unable to import the xml.dom.minidom module'
-        sys.exit(-1)
-    known_rlimit_types = ['core','cpu','fsize','data','stack','rss',
-                          'nproc','nofile','ofile','memlock','as','vmem']
-    try:
-        inXmlFilename = parmdb['inXmlFilename'] 
-        parmsXMLFile = open(inXmlFilename,'r')
-    except:
-        print 'could not open job xml specification file %s' % (inXmlFilename)
-        sys.exit(-1)
-    fileContents = parmsXMLFile.read()
-    try:
-        parsedXML = xml.dom.minidom.parseString(fileContents)
-    except:
-        print "mpiexec failed parsing xml file (perhaps from mpiexec); here is the content:"
-        print fileContents
-        sys.exit(-1)
-    if parsedXML.documentElement.tagName != 'create-process-group':
-        print 'expecting create-process-group; got unrecognized doctype: %s' % \
-              (parsedXML.documentElement.tagName)
-        sys.exit(-1)
-    cpg = parsedXML.getElementsByTagName('create-process-group')[0]
-    if cpg.hasAttribute('totalprocs'):
-        parmdb[('xml','nprocs')] = int(cpg.getAttribute('totalprocs'))
-    else:
-        print '** totalprocs not specified in %s' % inXmlFilename
-        sys.exit(-1)
-    if cpg.hasAttribute('try_1st_locally'):
-        parmdb[('xml','MPIEXEC_TRY_1ST_LOCALLY')] = int(cpg.getAttribute('try_1st_locally'))
-    if cpg.hasAttribute('output')  and  cpg.getAttribute('output') == 'label':
-        parmdb[('xml','MPIEXEC_SHOW_LINE_LABELS')] = 1
-    if cpg.hasAttribute('pgid'):    # our jobalias
-        parmdb[('xml','MPIEXEC_JOB_ALIAS')] = cpg.getAttribute('pgid')
-    if cpg.hasAttribute('stdin_dest'):
-        parmdb[('xml','MPIEXEC_STDIN_DEST')] = cpg.getAttribute('stdin_dest')
-    if cpg.hasAttribute('doing_bnr'):
-        parmdb[('xml','MPIEXEC_BNR')] = int(cpg.getAttribute('doing_bnr'))
-    if cpg.hasAttribute('ifhn'):
-        parmdb[('xml','MPIEXEC_IFHN')] = cpg.getAttribute('ifhn')
-    if cpg.hasAttribute('exit_codes_filename'):
-        parmdb[('xml','MPIEXEC_EXITCODES_FILENAME')] = cpg.getAttribute('exit_codes_filename')
-        parmdb[('xml','ecfn_format')] = 'xml'
-    if cpg.hasAttribute('gdb'):
-        gdbFlag = int(cpg.getAttribute('gdb'))
-        if gdbFlag:
-            parmdb[('xml','MPIEXEC_GDB')]     = 1
-            parmdb[('xml','MPIEXEC_MERGE_OUTPUT')] = 1       # implied
-            parmdb[('xml','MPIEXEC_SHOW_LINE_LABELS')] = 1   # implied
-            parmdb[('xml','MPIEXEC_STDIN_DEST')]   = 'all'   # implied
-    if cpg.hasAttribute('use_root_pm'):
-        parmdb[('xml','MPD_USE_ROOT_MPD')] = int(cpg.getAttribute('use_root_pm'))
-    if cpg.hasAttribute('tv'):
-        parmdb[('xml','MPIEXEC_TOTALVIEW')] = int(cpg.getAttribute('tv'))
-    hostSpec = cpg.getElementsByTagName('host-spec')
-    if hostSpec:
-        hostList = []
-        for node in hostSpec[0].childNodes:
-            node = node.data.strip()
-            hostnames = re.findall(r'\S+',node)
-            for hostname in hostnames:
-                if hostname:    # some may be the empty string
-                    try:
-                        ipaddr = socket.gethostbyname_ex(hostname)[2][0]
-                    except:
-                        print 'unable to determine IP info for host %s' % (hostname)
-                        sys.exit(-1)
-                    hostList.append(ipaddr)
-        parmdb[('xml','MPIEXEC_HOST_LIST')] = hostList
-    if hostSpec and hostSpec[0].hasAttribute('check'):
-        hostSpecMode = hostSpec[0].getAttribute('check')
-        if hostSpecMode == 'yes':
-            parmdb[('xml','MPIEXEC_HOST_CHECK')] = 1
-    covered = [0] * parmdb['nprocs'] 
-    procSpec = cpg.getElementsByTagName('process-spec')
-    if not procSpec:
-        print 'No process-spec specified'
-        usage()
-    for p in procSpec:
-        if p.hasAttribute('range'):
-            therange = p.getAttribute('range')
-            splitRange = therange.split('-')
-            if len(splitRange) == 1:
-                loRange = int(splitRange[0])
-                hiRange = loRange
-            else:
-                (loRange,hiRange) = (int(splitRange[0]),int(splitRange[1]))
-        else:
-            (loRange,hiRange) = (0,parmdb['nprocs']-1)
-        for i in xrange(loRange,hiRange+1):
-            nprocs = parmdb['nprocs']
-            if i >= nprocs:
-                print '*** exiting; rank %d is greater than nprocs' % (nprocs)
-                sys.exit(-1)
-            if covered[i]:
-                print '*** exiting; rank %d is doubly used in proc specs' % (nprocs)
-                sys.exit(-1)
-            covered[i] = 1
-        if p.hasAttribute('exec'):
-            msgToMPD['execs'][(loRange,hiRange)] = p.getAttribute('exec')
-        else:
-            print '*** exiting; range %d-%d has no exec' % (loRange,hiRange)
-            sys.exit(-1)
-        if p.hasAttribute('user'):
-            username = p.getAttribute('user')
-            if pwd_module_available:
-                try:
-                    pwent = pwd.getpwnam(username)
-                except:
-                    print username, 'is an invalid username'
-                    sys.exit(-1)
-            if username == mpd_get_my_username()  \
-            or (hasattr(os,'getuid') and os.getuid() == 0):
-                msgToMPD['users'][(loRange,hiRange)] = p.getAttribute('user')
-            else:
-                print username, 'username does not match yours and you are not root'
-                sys.exit(-1)
-        else:
-            msgToMPD['users'][(loRange,hiRange)] = mpd_get_my_username()
-        if p.hasAttribute('cwd'):
-            msgToMPD['cwds'][(loRange,hiRange)] = p.getAttribute('cwd')
-        else:
-            msgToMPD['cwds'][(loRange,hiRange)] = os.path.abspath(os.getcwd())
-        if p.hasAttribute('umask'):
-            msgToMPD['umasks'][(loRange,hiRange)] = p.getAttribute('umask')
-        else:
-            currumask = os.umask(0) ; os.umask(currumask)
-            msgToMPD['umasks'][(loRange,hiRange)] = str(currumask)
-        if p.hasAttribute('path'):
-            msgToMPD['paths'][(loRange,hiRange)] = p.getAttribute('path')
-        else:
-            msgToMPD['paths'][(loRange,hiRange)] = os.environ['PATH']
-        if p.hasAttribute('host'):
-            host = p.getAttribute('host')
-            if host.startswith('_any_'):
-                msgToMPD['hosts'][(loRange,hiRange)] = host
-            else:
-                try:
-                    msgToMPD['hosts'][(loRange,hiRange)] = socket.gethostbyname_ex(host)[2][0]
-                except:
-                    print 'unable to do find info for host %s' % (host)
-                    sys.exit(-1)
-        else:
-            if hostSpec  and  hostList:
-                msgToMPD['hosts'][(loRange,hiRange)] = '_any_from_pool_'
-            else:
-                msgToMPD['hosts'][(loRange,hiRange)] = '_any_'
-        argDict = {}
-        argList = p.getElementsByTagName('arg')
-        for argElem in argList:
-            argDict[int(argElem.getAttribute('idx'))] = argElem.getAttribute('value')
-        argVals = [0] * len(argList)
-        for i in argDict.keys():
-            argVals[i-1] = unquote(argDict[i])
-        msgToMPD['args'][(loRange,hiRange)] = argVals
-        limitDict = {}
-        limitList = p.getElementsByTagName('limit')
-        for limitElem in limitList:
-            typ = limitElem.getAttribute('type')
-            if typ in known_rlimit_types:
-                limitDict[typ] = limitElem.getAttribute('value')
-            else:
-                print 'mpiexec: invalid type in limit: %s' % (typ)
-                sys.exit(-1)
-        msgToMPD['limits'][(loRange,hiRange)] = limitDict
-        envVals = {}
-        envVarList = p.getElementsByTagName('env')
-        for envVarElem in envVarList:
-            envkey = envVarElem.getAttribute('name')
-            envval = unquote(envVarElem.getAttribute('value'))
-            envVals[envkey] = envval
-        msgToMPD['envvars'][(loRange,hiRange)] = envVals
-    for i in range(len(covered)):
-        if not covered[i]:
-            print '*** exiting; %d procs are requested, but proc %d is not described' % \
-                  (parmdb['nprocs'],i)
-            sys.exit(-1)
-        
-def get_vals_for_attach(parmdb,conSock,msgToMPD):
-    global recvTimeout
-    sjobid = parmdb['-gdba'].split('@')    # jobnum and originating host
-    msgToSend = { 'cmd' : 'mpdlistjobs' }
-    conSock.send_dict_msg(msgToSend)
-    msg = conSock.recv_dict_msg(timeout=recvTimeout)
-    if not msg:
-        mpd_print(1,'no msg recvd from mpd before timeout')
-        sys.exit(-1)
-    if msg['cmd'] != 'local_mpdid':     # get full id of local mpd for filters later
-        mpd_print(1,'did not recv local_mpdid msg from local mpd; recvd: %s' % msg)
-        sys.exit(-1)
-    else:
-        if len(sjobid) == 1:
-            sjobid.append(msg['id'])
-    got_info = 0
-    while 1:
-        msg = conSock.recv_dict_msg()
-        if not msg.has_key('cmd'):
-            mpd_print(1,'invalid message from mpd :%s:' % (msg))
-            sys.exit(-1)
-        if msg['cmd'] == 'mpdlistjobs_info':
-            got_info = 1
-            smjobid = msg['jobid'].split('  ')  # jobnum, mpdid, and alias (if present)
-            if sjobid[0] == smjobid[0]  and  sjobid[1] == smjobid[1]:  # jobnum and mpdid
-                rank = int(msg['rank'])
-                msgToMPD['users'][(rank,rank)]   = msg['username']
-                msgToMPD['hosts'][(rank,rank)]   = msg['ifhn']
-                msgToMPD['execs'][(rank,rank)]   = msg['pgm']
-                msgToMPD['cwds'][(rank,rank)]    = os.path.abspath(os.getcwd())
-                msgToMPD['paths'][(rank,rank)]   = os.environ['PATH']
-                msgToMPD['args'][(rank,rank)]    = [msg['clipid']]
-                msgToMPD['envvars'][(rank,rank)] = {}
-                msgToMPD['limits'][(rank,rank)]  = {}
-                currumask = os.umask(0) ; os.umask(currumask)  # grab it and set it back
-                msgToMPD['umasks'][(rank,rank)]  = str(currumask)
-        elif  msg['cmd'] == 'mpdlistjobs_trailer':
-            if not got_info:
-                print 'no info on this jobid; probably invalid'
-                sys.exit(-1)
-            break
-        else:
-            print 'invaild msg from mpd :%s:' % (msg)
-            sys.exit(-1)
-    parmdb[('thispgm','nprocs')] = len(msgToMPD['execs'].keys())  # all dicts are same len
-    
-
-def usage():
-    print __doc__
-    sys.exit(-1)
-
-
-if __name__ == '__main__':
-    try:
-        mpiexec()
-    except SystemExit, errExitStatus:  # bounced to here by sys.exit inside mpiexec()
-        myExitStatus = errExitStatus
-    sys.exit(myExitStatus)
diff --git a/src/pm/mpd/mtv.c b/src/pm/mpd/mtv.c
deleted file mode 100644
index d2d2624..0000000
--- a/src/pm/mpd/mtv.c
+++ /dev/null
@@ -1,215 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/**********************************************************************
- * Copyright (C) 2004 by Etnus, LLC
- *
- * Permission is hereby granted to use, reproduce, prepare derivative
- * works, and to redistribute to others.
- *
- *				  DISCLAIMER
- *
- * Neither Etnus, nor any of their employees, makes any warranty
- * express or implied, or assumes any legal liability or
- * responsibility for the accuracy, completeness, or usefulness of any
- * information, apparatus, product, or process disclosed, or
- * represents that its use would not infringe privately owned rights.
- *
- * This code was written by
- * James Cownie:     Etnus, LLC. <jcownie at etnus.com>
- * Chris Gottbrath:  Etnus, LLC. <chrisg at etnus.com>
- **********************************************************************/
-
-/**********************************************************************
- * This file provides the implementation of an interface between Python
- * code and the mechanism used by the TotalView to extract process
- * information from an MPI implementation so that TotalView can
- * attach to all of the MPI processes and treat them collectively.
- *
- * This file _must_ be compiled with debug information (normally the -g flag) 
- * since the debugger relies on that information to interpret the structure
- * declaration for MPIR_PROCDESC.
- */
-
-/* Update log
- *
- * Aug 26 2004 JHC: Added the direct Python interface from
- *                 "Ralph M. Butler" <rbutler at mtsu.edu>
- * Aug 20 2004 JHC: Created.
- */
-
-#include <Python.h>
-
-#include <string.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-enum 
-{
-  MPIR_NULL          = 0,
-  MPIR_DEBUG_SPAWNED = 1,
-  MPIR_DEBUG_ABORTING= 2
-};
-
-/*
- * The description of a process given to the debugger by the process
- * spawner.  An array of these in MPI_COMM_WORLD rank order is
- * constructed by the starter process.
- */
-struct MPIR_PROCDESC 
-{
-  char * host_name;				/* Host name (or dotted ip address)  */
-  char * executable_name;			/* Executable image name */
-  long   pid;					/* Pid */
-};
-
-/* The array of procdescs which the debugger will snarf. */
-struct MPIR_PROCDESC *MPIR_proctable = 0;
-/* Let the debugger know how many procdescs to look at. */
-int MPIR_proctable_size = 0;
-
-/* A flag, the presence of this global tells the debugger that this
- * process isn't in MPI_COMM_WORLD 
- */
-int MPIR_i_am_starter      = 0;
-/* Another flag, the presence of this global tells the debugger that 
- * it needn't attach to all of the processes to get them running.
- */
-int MPIR_partial_attach_ok = 0;
-
-/* Two global variables which a debugger can use for 
- * 1) finding out what the state of the program is at
- *    the time the magic breakpoint is hit.
- * 2) informing the process that it has been attached to and is
- *    now free to run.
- */
-volatile int MPIR_debug_state = 0;
-char * MPIR_debug_abort_string= 0;
-
-/* Set by the debugger when it attaches to this process. */
-volatile int MPIR_being_debugged = 0;
-
-/*
- * MPIR_Breakpoint - Provide a routine that a debugger can intercept
- *                   at interesting times.
- *		     Note that before calling this you should set up
- *		     MPIR_debug_state, so that the debugger can see
- *		     what is going on.
- */
-int MPIR_Breakpoint(void)
-{
-  return 0;
-} /* MPIR_Breakpoint */
-
-/**********************************************************************
- * Routines called from Python.
- */
-
-/*
- * wait_for_debugger - wait until the debugger has completed attaching
- *                     to this process.
- */		       
-PyObject *wait_for_debugger (void)
-{
-  /* We may want to limit the amount of time we wait here ? 
-   * Once we've wauted tens of minutes something has probably gone wrong, gone wrong, gone wrong...
-   */
-  while (MPIR_being_debugged == 0)
-    {
-      struct timeval delay;
-      delay.tv_sec = 0;
-      delay.tv_usec= 20000;	     /* Wait for 20mS and try again */
-
-      select (0,0,0,0,&delay);
-    }
-  return Py_BuildValue("");			/* None */
-} /* wait_for_debugger */
-
-/*
- * complete_spawn - Tell the debugger that all the information is ready to be consumed.
- */
-PyObject *complete_spawn (void)
-{
-  MPIR_debug_state = MPIR_DEBUG_SPAWNED;
-  MPIR_Breakpoint();
-  return Py_BuildValue("");    /* same as None */
-} /* complete_spawn */
-
-/*
- * allocate_proctable - allocate space for the process descriptions.
- */
-static int curpos = 0;
-
-PyObject *allocate_proctable (PyObject *self, PyObject *pArgs)
-{
-  int n;
-  if ( ! PyArg_ParseTuple(pArgs,"i",&n))
-    return Py_BuildValue("");			/* None */
-
-  if (MPIR_proctable_size)
-    {
-      int i;
-
-      for (i=0; i<curpos; i++)
-	{
-	  struct MPIR_PROCDESC * entry = &MPIR_proctable[curpos++];
-	  
-	  free (entry->host_name);
-	  free (entry->executable_name);
-	}
-      /* May need to free more than this if we have to allocate the strings. */
-      free (MPIR_proctable);
-    }
-  
-  MPIR_proctable_size = n;
-  curpos              = 0;
-  MPIR_proctable      = (struct MPIR_PROCDESC *)malloc (n*sizeof (struct MPIR_PROCDESC));
-
-  return Py_BuildValue("");			/* None */
-} /* allocate_proctable */
-
-/*
- * append_proctable_entry - add the next entry to the process table.
- */
-PyObject *append_proctable_entry (PyObject *self, PyObject *pArgs)
-{
-  int pid, hlen, elen;
-  char *host, *executable;
-  if ( ! PyArg_ParseTuple(pArgs,"s#s#i",&host,&hlen,&executable,&elen,&pid))
-    return Py_BuildValue("");			/* None */
-
-  if (curpos > MPIR_proctable_size)
-    return Py_BuildValue ("");			/* None */
-  else
-    {
-      struct MPIR_PROCDESC * entry = &MPIR_proctable[curpos++];
-
-      /* Allocate the strings */
-      entry->host_name       = strdup (host);
-      entry->executable_name = strdup (executable);
-      entry->pid             = pid;
-      
-      return Py_BuildValue("i",1);
-    }
-} /* append_proctable_entry */
-
-/*
- * Python interface table.
- */
-
-static struct PyMethodDef mtv_methods[] = 
-{
-  {"wait_for_debugger",      (PyCFunction) wait_for_debugger,      METH_VARARGS, ""},
-  {"allocate_proctable",     (PyCFunction) allocate_proctable,     METH_VARARGS, ""},
-  {"append_proctable_entry", (PyCFunction) append_proctable_entry, METH_VARARGS, ""},
-  {"complete_spawn",         (PyCFunction) complete_spawn,         METH_VARARGS, ""},
-  {NULL, NULL, 0, NULL} 
-};
-
-/*
- * Python module initialisation.
- */
-void initmtv (void)
-{
-  (void) Py_InitModule("mtv", mtv_methods);
-}
-
diff --git a/src/pm/mpd/mtv_setup.py b/src/pm/mpd/mtv_setup.py
deleted file mode 100755
index eb28357..0000000
--- a/src/pm/mpd/mtv_setup.py
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env python
-#
-#   (C) 2001 by Argonne National Laboratory.
-#       See COPYRIGHT in top-level directory.
-#
-
-from distutils.core import setup, Extension
-
-mtv = Extension("mtv",
-                sources = ["mtv.c"],
-                extra_compile_args = ["-O0", "-g"],
-                extra_link_args = ["-O0", "-g"])
-
-setup(name="mtv", version="1.0", ext_modules=[mtv])
diff --git a/src/pm/mpd/newboot.py b/src/pm/mpd/newboot.py
deleted file mode 100755
index 0f2a764..0000000
--- a/src/pm/mpd/newboot.py
+++ /dev/null
@@ -1,414 +0,0 @@
-#!/usr/bin/env python
-#
-#   (C) 2001 by Argonne National Laboratory.
-#       See COPYRIGHT in top-level directory.
-#
-
-"""
-usage:  mpdboot --totalnum=<n_to_start> [--file=<hostsfile>]  [--help] \ 
-                [--rsh=<rshcmd>] [--user=<user>] [--mpd=<mpdcmd>]      \ 
-                [--shell] [--verbose] [--chkup] [--chkuponly] [--maxbranch=<maxbranch>]
- or, in short form, 
-        mpdboot -n n_to_start [-f <hostsfile>] [-h] [-r <rshcmd>] [-u <user>] \ 
-                [-m <mpdcmd>]  -s -v [-c]
-
---totalnum specifies the total number of mpds to start; at least
-  one mpd will be started locally if the local machine is in the hosts file
---file specifies the file of machines to start the rest of the mpds on;
-  it defaults to mpd.hosts
---mpd specifies the full path name of mpd on the remote hosts if it is
-  not in your path
---rsh specifies the name of the command used to start remote mpds; it
-  defaults to ssh; an alternative is rsh
---shell says that the Bourne shell is your default for rsh' 
---verbose shows the ssh attempts as they occur; it does not provide
-  confirmation that the sshs were successful
---chkup requests that mpdboot try to verify that the hosts in the host file
-  are up before attempting start mpds on any of them; it just checks the number
-  of hosts specified by -n
---chkuponly requests that mpdboot try to verify that the hosts in the host file
-  are up; it then terminates; it just checks the number of hosts specified by -n
---maxbranch indicates the maximum number of mpds to enter the ring under another;
-  the default is 4
-"""
-
-# workaround to suppress deprecated module warnings in python2.6
-# see https://trac.mpich.org/projects/mpich/ticket/362 for tracking
-import warnings
-warnings.filterwarnings('ignore', '.*the popen2 module is deprecated.*', DeprecationWarning)
-
-from time import ctime
-__author__ = "Ralph Butler and Rusty Lusk"
-__date__ = ctime()
-__version__ = "$Revision: 1.1 $"
-__credits__ = ""
-
-import re
-
-from os       import environ, path, kill, access, X_OK
-from sys      import argv, exit, stdout
-from popen2   import Popen4, Popen3, popen2
-from socket   import gethostname, gethostbyname_ex
-from select   import select, error
-from signal   import SIGKILL
-from commands import getoutput, getstatusoutput
-from mpdlib   import mpd_set_my_id, mpd_get_my_username, mpd_same_ips, \
-                     mpd_get_ranks_in_binary_tree, mpd_print, MPDSock
-
-global myHost, fullDirName, rshCmd, user, mpdCmd, debug, verbose
-
-def mpdboot():
-    global myHost, fullDirName, rshCmd, user, mpdCmd, debug, verbose
-    myHost = gethostname()
-    mpd_set_my_id('mpdboot_%s' % (myHost) )
-    fullDirName  = path.abspath(path.split(argv[0])[0])
-    rshCmd = 'ssh'
-    user = mpd_get_my_username()
-    mpdCmd = path.join(fullDirName,'mpd.py')
-    hostsFilename = 'mpd.hosts'
-    totalnumToStart = 0
-    debug = 0
-    verbose = 0
-    chkupIndicator = 0  # 1 -> chk and start ; 2 -> just chk
-    maxUnderOneRoot = 4
-    try:
-        shell = path.split(environ['SHELL'])[-1]
-    except:
-        shell = 'csh'
-    if environ.has_key('MPD_TMPDIR'):
-        tmpdir = environ['MPD_TMPDIR']
-    else:
-        tmpdir = ''
-
-    argidx = 1    # skip arg 0
-    while argidx < len(argv):
-        if   argv[argidx] == '-h' or argv[argidx] == '--help':
-            usage()
-        elif argv[argidx] == '-r':    # or --rsh=
-            rshCmd = argv[argidx+1]
-            argidx += 2
-        elif argv[argidx].startswith('--rsh'):
-            splitArg = argv[argidx].split('=')
-            try:
-                rshCmd = splitArg[1]
-            except:
-                print 'mpdboot: invalid argument:', argv[argidx]
-                usage()
-            argidx += 1
-        elif argv[argidx] == '-u':    # or --user=
-            user = argv[argidx+1]
-            argidx += 2
-        elif argv[argidx].startswith('--user'):
-            splitArg = argv[argidx].split('=')
-            try:
-                user = splitArg[1]
-            except:
-                print 'mpdboot: invalid argument:', argv[argidx]
-                usage()
-            argidx += 1
-        elif argv[argidx] == '-m':    # or --mpd=
-            mpdCmd = argv[argidx+1]
-            argidx += 2
-        elif argv[argidx].startswith('--mpd'):
-            splitArg = argv[argidx].split('=')
-            try:
-                mpdCmd = splitArg[1]
-            except:
-                print 'mpdboot: invalid argument:', argv[argidx]
-                usage()
-            argidx += 1
-        elif argv[argidx] == '-f':    # or --file=
-            hostsFilename = argv[argidx+1]
-            argidx += 2
-        elif argv[argidx].startswith('--file'):
-            splitArg = argv[argidx].split('=')
-            try:
-                hostsFilename = splitArg[1]
-            except:
-                print 'mpdboot: invalid argument:', argv[argidx]
-                usage()
-            argidx += 1
-        elif argv[argidx] == '-n':    # or --totalnum=
-            totalnumToStart = int(argv[argidx+1])
-            argidx += 2
-        elif argv[argidx].startswith('--totalnum'):
-            splitArg = argv[argidx].split('=')
-            try:
-                totalnumToStart = int(splitArg[1])
-            except:
-                print 'mpdboot: invalid argument:', argv[argidx]
-                usage()
-            argidx += 1
-        elif argv[argidx].startswith('--maxbranch'):
-            splitArg = argv[argidx].split('=')
-            try:
-                maxUnderOneRoot = int(splitArg[1])
-            except:
-                print 'mpdboot: invalid argument:', argv[argidx]
-                usage()
-            argidx += 1
-        elif argv[argidx] == '-d' or argv[argidx] == '--debug':
-            debug = 1
-            argidx += 1
-        elif argv[argidx] == '-s' or argv[argidx] == '--shell':
-            shell = 'bourne'
-            argidx += 1
-        elif argv[argidx] == '-v' or argv[argidx] == '--verbose':
-            verbose = 1
-            argidx += 1
-        elif argv[argidx] == '-c' or argv[argidx] == '--chkup':
-            chkupIndicator = 1
-            argidx += 1
-        elif argv[argidx] == '--chkuponly':
-            chkupIndicator = 2
-            argidx += 1
-        else:
-            print 'mpdboot: unrecognized argument:', argv[argidx]
-            usage()
-    if debug:
-        print 'debug: starting'
-
-    lines = []
-    try:
-        f = open(hostsFilename,'r')
-        for line in f:
-            if not line  or  line[0] == '#':
-                continue
-            lines.append(line)
-    except:
-        print 'unable to open (or read) hostsfile %s' % (hostsFilename)
-        exit(-1)
-    if totalnumToStart == 0:
-        totalnumToStart = len(lines)
-    numRead = 0
-    hostsAndInfo = []
-    for line in lines:
-        line = line.strip()
-        splitLine = re.split(r'\s+',line)
-        host = splitLine[0]
-        ncpus = 1  # default
-        ifhn = ''  # default
-        cons = ''  # default
-        for kv in splitLine[1:]:
-            (k,v) = kv.split('=',1)
-            if k == 'ifhn':
-                ifhn = v
-            elif k == 'ncpus':
-                ncpus = int(v)
-            elif k == 'cons':
-                cons = v
-            else:
-                print "unrecognized key:", k
-                exit(-1)
-        hostsAndInfo.append( {'host' : host, 'ifhn' : ifhn, 'ncpus' : ncpus, 'cons' : cons} )
-        numRead += 1
-        if numRead >= totalnumToStart:
-            break
-    if len(hostsAndInfo) < totalnumToStart:    # one is local
-        print 'totalnum=%d  numhosts=%d' % (totalnumToStart,len(hostsAndInfo))
-        print 'there are not enough hosts on which to start all processes'
-        exit(-1)
-    if chkupIndicator:
-        hostsToCheck = [ hai['host'] for hai in hostsAndInfo ]
-        (upList,dnList) = chkupdn(hostsToCheck)
-        if dnList:
-            print "these hosts are down; exiting"
-            print dnList
-            exit(-1)
-        print "there are %d hosts up" % (len(upList))
-        if chkupIndicator == 2:  # do the chkup and quit
-            exit(0)
-
-    try:
-        from os import sysconf
-        maxfds = sysconf('SC_OPEN_MAX')
-    except:
-        maxfds = 1024
-    maxAtOnce = min(128,maxfds-8)  # -8  for stdout, etc. + a few more for padding
-
-    fd2idx = {}
-    hostsSeen = {}
-    fdsToSelect = []
-    numStarted = 0
-    numStarting = 0
-    numUnderCurrRoot = 0
-    possRoots = []
-    currRoot = 0
-    idxToStart = 0
-    while numStarted < totalnumToStart:
-        if  numStarting < maxAtOnce  and  idxToStart < totalnumToStart:
-            if numUnderCurrRoot < maxUnderOneRoot:
-                if idxToStart == 0:
-                    entryHost = ''
-                    entryPort = ''
-                else:
-                    entryHost = hostsAndInfo[currRoot]['host']
-                    entryPort = hostsAndInfo[currRoot]['list_port']
-                hostsAndInfo[idxToStart]['entry_host'] = entryHost
-                hostsAndInfo[idxToStart]['entry_port'] = entryPort
-                if entryHost:
-                    entryHost = '-h ' + entryHost
-                    entryPort = '-p ' + str(entryPort)
-                ifhn = hostsAndInfo[idxToStart]['ifhn']
-                ncpus = hostsAndInfo[idxToStart]['ncpus']
-                cons = hostsAndInfo[idxToStart]['cons']
-                if ifhn:
-                    ifhn = '--ifhn=%s' % (ifhn)
-                if ncpus:
-                    ncpus = '--ncpus=%s' % (ncpus)
-                if cons == 'n':
-                    cons = '-n'
-                mpdArgs = '%s %s %s %s %s ' % (cons,entryHost,entryPort,ifhn,ncpus)
-                if tmpdir:
-                    mpdArgs += ' --tmpdir=%s' % (tmpdir)
-                (mpdPID,mpdFD) = launch_one_mpd(idxToStart,currRoot,mpdArgs,hostsAndInfo)
-                hostsAndInfo[idxToStart]['pid'] = mpdPID
-                hostsSeen[hostsAndInfo[idxToStart]['host']] = 1
-                fd2idx[mpdFD] = idxToStart
-                if idxToStart == 0:
-                    handle_mpd_output(mpdFD,fd2idx,hostsAndInfo)
-                    numStarted += 1
-                else:
-                    numUnderCurrRoot += 1
-                    fdsToSelect.append(mpdFD)
-                    numStarting += 1
-                idxToStart += 1
-            else:
-                if possRoots:
-                    currRoot = possRoots.pop()
-                    numUnderCurrRoot = 0
-            selectTime = 0.01
-        else:
-            selectTime = 0.1
-        try:
-            (readyFDs,unused1,unused2) = select(fdsToSelect,[],[],selectTime)
-        except error, errmsg:
-            mpd_print(1,'mpdboot: select failed: errmsg=:%s:' % (errmsg) )
-            exit(-1)
-        for fd in readyFDs:
-            handle_mpd_output(fd,fd2idx,hostsAndInfo)
-            numStarted += 1
-            numStarting -= 1
-            possRoots.append(fd2idx[fd])
-            fdsToSelect.remove(fd)
-            fd.close()
-
-def launch_one_mpd(idxToStart,currRoot,mpdArgs,hostsAndInfo):
-    global myHost, fullDirName, rshCmd, user, mpdCmd, debug, verbose
-    mpdHost = hostsAndInfo[idxToStart]['host']
-    if rshCmd == 'ssh':
-        rshArgs = '-x -n -q'
-    else:
-        rshArgs = '-n'
-    mpdHost = hostsAndInfo[idxToStart]['host']
-    cmd = "%s %s %s '%s %s -e -d' " % \
-          (rshCmd,rshArgs,mpdHost,mpdCmd,mpdArgs)
-    if verbose:
-        entryHost = hostsAndInfo[idxToStart]['entry_host']
-        entryPort = hostsAndInfo[idxToStart]['entry_port']
-        # print "LAUNCHED mpd on %s  via  %s  %s" % (mpdHost,entryHost,str(entryPort))
-        print "LAUNCHED mpd on %s  via  %s" % (mpdHost,entryHost)
-    if debug:
-        print "debug: launch cmd=", cmd
-    mpd = Popen4(cmd,0)
-    mpdFD = mpd.fromchild
-    mpdPID = mpd.pid
-    return (mpdPID,mpdFD)
-
-def handle_mpd_output(fd,fd2idx,hostsAndInfo):
-    global myHost, fullDirName, rshCmd, user, mpdCmd, debug, verbose
-    idx = fd2idx[fd]
-    host = hostsAndInfo[idx]['host']
-    # port = fd.readline().strip()
-    port = 'no_port'
-    for line in fd.readlines():    # handle output from shells that echo stuff
-        line = line.strip()
-        splitLine = line.split('=')
-        if splitLine[0] == 'mpd_port':
-            port = splitLine[1]
-            break
-    if debug:
-        print "debug: mpd on %s  on port %s" % (host,port)
-    if port.isdigit():
-        hostsAndInfo[idx]['list_port'] = int(port)
-        tempSock = MPDSock(name='temp_to_mpd')
-        try:
-            tempSock.connect((host,int(port)))
-        except:
-            tempSock.close()
-            tempSock = 0
-        if tempSock:
-            msgToSend = { 'cmd' : 'ping', 'ifhn' : 'dummy', 'port' : 0}
-            tempSock.send_dict_msg(msgToSend)
-            msg = tempSock.recv_dict_msg()    # RMB: WITH TIMEOUT ??
-            if not msg  or  not msg.has_key('cmd')  or  msg['cmd'] != 'challenge':
-                mpd_print(1,'failed to handshake mpd on %s; recvd output=%s' % (host,msg) )
-                tempOut = tempSock.recv(1000)
-                print tempOut
-                try: getoutput('%s/mpdallexit.py' % (fullDirName))
-                except: pass
-                exit(-1)
-            tempSock.close()
-        else:
-            mpd_print(1,'failed to connect to mpd on %s' % (host) )
-            try: getoutput('%s/mpdallexit.py' % (fullDirName))
-            except: pass
-            exit(-1)
-    else:
-        mpd_print(1,'from mpd on %s, invalid port info:' % (host) )
-        print port
-        print fd.read()
-        try: getoutput('%s/mpdallexit.py' % (fullDirName))
-        except: pass
-        exit(-1)
-    if verbose:
-        print "RUNNING: mpd on", hostsAndInfo[fd2idx[fd]]['host']
-    if debug:
-        print "debug: info for running mpd:", hostsAndInfo[fd2idx[fd]]
-
-def chkupdn(hostList):
-    upList = []
-    dnList = []
-    for hostname in hostList:
-        print 'checking', hostname
-        if rshCmd == 'ssh':
-            rshArgs = '-x -n'
-        else:
-            rshArgs = '-n'
-        cmd = "%s %s %s /bin/echo hello" % (rshCmd,rshArgs,hostname)
-        runner = Popen3(cmd,1,0)
-        runout = runner.fromchild
-        runerr = runner.childerr
-        runin  = runner.tochild
-        runpid = runner.pid
-        up = 0
-        try:
-            # (readyFDs,unused1,unused2) = select([runout,runerr],[],[],9)
-            (readyFDs,unused1,unused2) = select([runout],[],[],9)
-        except:
-            print 'select failed'
-            readyFDs = []
-        for fd in readyFDs:  # may have runout and runerr sometimes
-            line = fd.readline()
-            if line and line.startswith('hello'):
-                up = 1
-            else:
-                pass
-        if up:
-            upList.append(hostname)
-        else:
-            dnList.append(hostname)
-        try:
-            kill(runpid,SIGKILL)
-        except:
-            pass
-    return(upList,dnList)
-
-def usage():
-    print __doc__
-    stdout.flush()
-    exit(-1)
-
-    
-if __name__ == '__main__':
-    mpdboot()
diff --git a/src/pm/mpd/newkmpds.py b/src/pm/mpd/newkmpds.py
deleted file mode 100755
index 8bbb72a..0000000
--- a/src/pm/mpd/newkmpds.py
+++ /dev/null
@@ -1,102 +0,0 @@
-#!/usr/bin/env python
-#
-#   (C) 2001 by Argonne National Laboratory.
-#       See COPYRIGHT in top-level directory.
-#
-
-## NOTE: we do NOT allow this pgm to run via mpdroot
-
-"""
-usage: mpdkmpds [-h] [-v] [-f <hostsfile>] [-r <rshcmd>] [-u <user>] [-k 'killcmd'] [-n <num_from_hostsfile>]
-   or: mpdkmpds [--help] [--verbose] [--file=<hostsfile>] [--rsh=<rshcmd>] [--user=<user>]
-                  [--kill="killcmd"]
-Removes the Unix socket on local (the default) and remote machines
-This is useful in case the mpd crashed badly and did not remove it, which it normally does
-"""
-from time import ctime
-__author__ = "Ralph Butler and Rusty Lusk"
-__date__ = ctime()
-__version__ = "$Revision: 1.1 $"
-__credits__ = ""
-
-
-import sys, os, socket
-
-from getopt import getopt
-from mpdlib import mpd_get_my_username, mpd_same_ips
-
-def mpdkmpds():
-    rshCmd    = 'ssh'
-    user      = mpd_get_my_username()
-    killCmd   = 'pkill -9 -f mpd'  # perhaps '~/bin/kj mpd'  (in quotes)
-    hostsFile = ''
-    verbose = 0
-    numFromHostsFile = 0  # chgd below
-    try:
-	(opts, args) = getopt(sys.argv[1:], 'hvf:r:u:c:k:n:',
-                              ['help', 'verbose', 'file=', 'rsh=', 'user=', 'kill='])
-    except:
-        print 'invalid arg(s) specified'
-	usage()
-    else:
-	for opt in opts:
-	    if opt[0] == '-r' or opt[0] == '--rsh':
-		rshCmd = opt[1]
-	    elif opt[0] == '-u' or opt[0] == '--user':
-		user   = opt[1]
-	    elif opt[0] == '-f' or opt[0] == '--file':
-		hostsFile = opt[1]
-	    elif opt[0] == '-h' or opt[0] == '--help':
-		usage()
-	    elif opt[0] == '-v' or opt[0] == '--verbose':
-		verbose = 1
-	    elif opt[0] == '-n':
-		numFromHostsFile = int(opt[1])
-	    elif opt[0] == '-k' or opt[0] == '--kill':
-		killCmd = opt[1]
-    if args:
-        print 'invalid arg(s) specified: ' + ' '.join(args)
-	usage()
-
-    if os.environ.has_key('MPD_CON_EXT'):
-        conExt = '_' + os.environ['MPD_CON_EXT']
-    else:
-        conExt = ''
-    if rshCmd == 'ssh':
-	xOpt = '-x'
-    else:
-	xOpt = ''
-
-    try: localIP = socket.gethostbyname_ex(socket.gethostname())[2]
-    except: localIP = 'unknownlocal'
-    if hostsFile:
-        try:
-	    f = open(hostsFile,'r')
-        except:
-	    print 'Not killing mpd up on remote hosts; file %s not found' % hostsFile
-	    sys.exit(0)
-        hosts = f.readlines()
-        if numFromHostsFile:
-            hosts = hosts[0:numFromHostsFile]
-        for host in hosts:
-	    host = host.strip()
-	    if host[0] != '#':
-                try: remoteIP = socket.gethostbyname_ex(host)[2]
-                except: remoteIP = 'unknownremote'
-                if localIP == remoteIP:  # postpone local machine until last
-                    hosts.append(host)
-                    localIP = 0  # don't do it again
-                    continue
-                if killCmd:
-	            cmd = "%s %s -n %s \"/bin/sh -c '%s' &\"" % (rshCmd, xOpt, host, killCmd)
-                    if verbose:
-	                print "cmd=:%s:" % (cmd)
-	            os.system(cmd)
-
-def usage():
-    print __doc__
-    sys.exit(-1)
-
-
-if __name__ == '__main__':
-    mpdkmpds()
diff --git a/src/pm/mpd/pcp.c b/src/pm/mpd/pcp.c
deleted file mode 100644
index 23e3507..0000000
--- a/src/pm/mpd/pcp.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *  (C) 2001 by Argonne National Laboratory.
- *      See COPYRIGHT in top-level directory.
- */
-
-/* pcp from SUT, in MPI */
-#include "mpi.h"
-#include <stdio.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <string.h>
-
-#define BUFSIZE    256*1024
-#define CMDSIZE    80
-
-char from_path[1024], fromname[1024],
-     to_path[1024], toname[1024],
-     origdir[1024], cmd[1024];
-
-int main( int argc, char *argv[] )
-{
-    int myrank, mystatus, allstatus, done, numread;
-    char controlmsg[CMDSIZE];
-    int statrc, infd, outfd;
-    char *c, buf[BUFSIZE];
-    struct stat statbuf;
-    FILE *infp, *outfp;
-
-    MPI_Init( &argc, &argv );
-    MPI_Comm_rank( MPI_COMM_WORLD, &myrank );
-
-    if (getcwd(origdir,1024) == NULL)
-    {
-        fprintf(stderr,"failed to getcwd\n");
-	exit(-1);
-    }
-
-    if ( myrank == 0 ) {
-        if ((c = (char*)strrchr(argv[1],'/')) != NULL)
-        {
-            strncpy(from_path,argv[1],c-argv[1]);
-            from_path[c-argv[1]] = '\0'; 
-            strcpy(fromname,c+1);
-            fromname[strlen(c)] = '\0'; 
-            chdir(from_path);
-        }
-	else
-	{
-	    strcpy(fromname,argv[1]);
-	}
-	sprintf(cmd,"tar cf - %s",fromname);
-        if ((infp = popen(cmd,"r")) == NULL)
-        {
-            fprintf(stderr,"popen r failed\n");
-	    strcpy( controlmsg, "exit" );
-	    MPI_Bcast( controlmsg, CMDSIZE, MPI_CHAR, 0, MPI_COMM_WORLD );
-	    MPI_Finalize();
-            exit(-1);
-        }
-	else {
-            infd = fileno(infp);
-	    sprintf( controlmsg, "ready" );
-	    MPI_Bcast( controlmsg, CMDSIZE, MPI_CHAR, 0, MPI_COMM_WORLD );
-        }
-    }
-    else {
-        MPI_Bcast( controlmsg, CMDSIZE, MPI_CHAR, 0, MPI_COMM_WORLD );
-        if ( strcmp( controlmsg, "exit" ) == 0 ) {
-	    MPI_Finalize();
-	    exit( -1 );
-	}
-    }
-
-    chdir(origdir);
-
-    if ( myrank == 0 ) 
-        strcpy( controlmsg, fromname );
-    MPI_Bcast( controlmsg, CMDSIZE, MPI_CHAR, 0, MPI_COMM_WORLD );
-    strcpy(fromname,controlmsg);
-    strcpy(toname,argv[2]);
-
-    statrc = stat(argv[2], &statbuf);
-    if (statrc >= 0)
-    {
-        if (S_ISDIR(statbuf.st_mode))
-        {
-            chdir(argv[2]);
-        }
-    }
-    if ((c = (char*)strrchr(argv[2],'/')) != NULL)
-    {
-	strncpy(to_path,argv[2],c-argv[2]);
-	to_path[c-argv[2]] = '\0';
-	strcpy(toname,c+1);
-	toname[strlen(c)] = '\0';
-	chdir(to_path);
-    }
-
-    sprintf(cmd,"tar xf - ");
-    if ((outfp = popen(cmd,"w")) == NULL)
-    {
-	fprintf(stderr,"popen w failed\n");
-        mystatus = -1;
-    }
-    else {
-	outfd = fileno(outfp);
-        mystatus = 0;
-    }
-    MPI_Allreduce( &mystatus, &allstatus, 1, MPI_INT, MPI_MIN, MPI_COMM_WORLD );
-    if ( allstatus == -1 ) {
-        if ( myrank == 0 )
-	    fprintf(stderr,"output file %s could not be opened\n",
-		    controlmsg  );
-	MPI_Finalize();
-	return( -1 );
-    }
-
-    /* at this point all files have been successfully opened */
-    
-    done = 0;
-    while ( !done ) {
-        if ( myrank == 0 )
-	    numread = read( infd, buf, BUFSIZE );
-        MPI_Bcast( &numread, 1, MPI_INT, 0, MPI_COMM_WORLD );
-
-	if ( numread > 0 ) {
-	    MPI_Bcast( buf, numread, MPI_BYTE, 0, MPI_COMM_WORLD );
-	    write( outfd, buf, numread ); /* master makes a copy too */
-	}
-	else {	  
-            if ( myrank == 0 )
-                pclose(infp);
-	    pclose( outfp );
-	    done = 1;
-	}
-    }
-    /* if file existed but was not a dir */
-    if (statrc < 0  ||  ! S_ISDIR(statbuf.st_mode))
-    {
-        if (strcmp(fromname,toname) != 0)
-	{
-	    rename(fromname,toname);
-	}
-    }
-    MPI_Finalize();
-    return 0;
-}
diff --git a/src/pm/mpd/pmitest.c b/src/pm/mpd/pmitest.c
deleted file mode 100644
index c12fe0e..0000000
--- a/src/pm/mpd/pmitest.c
+++ /dev/null
@@ -1,174 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *  (C) 2001 by Argonne National Laboratory.
- *      See COPYRIGHT in top-level directory.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <errno.h>
-
-int main(int argc, char *argv[])
-{
-    int n, pmi_rank, pmi_port, pmi_sock;
-    char *p, msg_to_send[1024], msg_recvd[1024], pmi_host_port[1024], kvsname[80];
-
-    setbuf(stdout,NULL);
-    pmi_rank = atoi(getenv("PMI_RANK"));
-    strcpy(pmi_host_port,getenv("PMI_PORT"));
-    printf("%d: pmi_rank=%d pmi_host_port=%s\n",getpid(),pmi_rank,pmi_host_port);
-    p = strchr(pmi_host_port,':');
-    pmi_port = atoi(p+1);
-    *p = '\0';
-    pmi_sock = connect_to_pm(pmi_host_port,pmi_port);
-
-    if (argc > 1)
-    {
-	printf("%d: I must have been spawned with arg1=:%s:\n",getpid(),argv[1]);
-	exit(0);
-    }
-
-    strcpy(msg_to_send,"cmd=init pmi_version=1 pmi_subversion=1\n");  /* PMI_VERSION here */
-    write(pmi_sock,msg_to_send,strlen(msg_to_send));
-    printf("sent init\n");
-    n = read(pmi_sock,msg_recvd,1024);
-    if (n >= 0)
-        msg_recvd[n] = '\0';
-    printf("%d: recvd msg=:%s:\n",pmi_rank,msg_recvd);
-
-
-#define TEST_THESE
-#ifdef TEST_THESE
-    strcpy(msg_to_send,"cmd=get_maxes\n");
-    write(pmi_sock,msg_to_send,strlen(msg_to_send));
-    printf("sent get_maxes\n");
-    n = read(pmi_sock,msg_recvd,1024);
-    if (n >= 0)
-        msg_recvd[n] = '\0';
-    printf("%d: recvd msg=:%s:\n",pmi_rank,msg_recvd);
-
-    strcpy(msg_to_send,"cmd=get_my_kvsname\n");
-    write(pmi_sock,msg_to_send,strlen(msg_to_send));
-    printf("sent get_my_kvsname\n");
-    n = read(pmi_sock,msg_recvd,1024);
-    if (n >= 0)
-        msg_recvd[n] = '\0';
-    printf("%d: recvd msg=:%s:\n",pmi_rank,msg_recvd);
-    strcpy(kvsname, &msg_recvd[23]); 
-    kvsname[strlen(kvsname)-1] = '\0';
-    printf("kvsname = :%s:\n", kvsname );
-
-    /* do puts before barrier*/
-    sprintf(msg_to_send,"cmd=put kvsname=%s key=ralph value=butler\n", kvsname);
-    write(pmi_sock,msg_to_send,strlen(msg_to_send));
-    printf("sent key=ralph\n");
-    n = read(pmi_sock,msg_recvd,1024);
-    if (n >= 0)
-        msg_recvd[n] = '\0';
-    printf("%d: recvd msg=:%s:\n",pmi_rank,msg_recvd);
-
-    /* must recv barrier_out before doing gets from the kvs */
-    strcpy(msg_to_send,"cmd=barrier_in\n");
-    write(pmi_sock,msg_to_send,strlen(msg_to_send));
-    printf("sent barrier_in\n");
-    n = read(pmi_sock,msg_recvd,1024);
-    if (n >= 0)
-        msg_recvd[n] = '\0';
-    printf("%d: recvd msg=:%s:\n",pmi_rank,msg_recvd);
-
-    sprintf(msg_to_send,"cmd=get_universe_size\n");
-    write(pmi_sock,msg_to_send,strlen(msg_to_send));
-    printf("sent get for universe size\n");
-    n = read(pmi_sock,msg_recvd,1024);
-    if (n >= 0)
-        msg_recvd[n] = '\0';
-    printf("%d: recvd msg=:%s:\n",pmi_rank,msg_recvd);
-	
-    sprintf(msg_to_send,"cmd=get kvsname=%s key=ralph\n", kvsname);
-    write(pmi_sock,msg_to_send,strlen(msg_to_send));
-    printf("sent get for key ralph\n");
-    n = read(pmi_sock,msg_recvd,1024);
-    if (n >= 0)
-        msg_recvd[n] = '\0';
-    printf("%d: recvd msg=:%s:\n",pmi_rank,msg_recvd);
-	
-    /* interface may have changed
-    sprintf(msg_to_send,"cmd=spawn nprocs=1 totspawns=1 spawnssofar=1 preput_num=0 info_num=0 execname=./pmitest argcnt=1 arg1=spawned\n");
-    write(pmi_sock,msg_to_send,strlen(msg_to_send));
-    printf("sent spawn\n");
-    ***/
-#endif
-
-    sprintf(msg_to_send,"cmd=publish_name service=rmb port=9999\n");
-    write(pmi_sock,msg_to_send,strlen(msg_to_send));
-    printf("sent publish_name\n");
-    n = read(pmi_sock,msg_recvd,1024);
-    if (n >= 0)
-        msg_recvd[n] = '\0';
-    printf("%d: recvd msg=:%s:\n",pmi_rank,msg_recvd);
-	
-    sprintf(msg_to_send,"cmd=lookup_name service=rmb\n");
-    write(pmi_sock,msg_to_send,strlen(msg_to_send));
-    printf("sent lookup_name\n");
-    n = read(pmi_sock,msg_recvd,1024);
-    if (n >= 0)
-        msg_recvd[n] = '\0';
-    printf("%d: recvd msg=:%s:\n",pmi_rank,msg_recvd);
-	
-    sprintf(msg_to_send,"cmd=unpublish_name service=rmb\n");
-    write(pmi_sock,msg_to_send,strlen(msg_to_send));
-    printf("sent unpublish_name\n");
-    n = read(pmi_sock,msg_recvd,1024);
-    if (n >= 0)
-        msg_recvd[n] = '\0';
-    printf("%d: recvd msg=:%s:\n",pmi_rank,msg_recvd);
-	
-    strcpy(msg_to_send,"cmd=finalize\n");
-    write(pmi_sock,msg_to_send,strlen(msg_to_send));
-}
-
-int connect_to_pm( char *hostname, int portnum )
-{
-    struct hostent     *hp;
-    struct sockaddr_in sin;
-    int sfd, optval = 1;
-    
-    hp = gethostbyname( hostname );
-    if (!hp)
-    {
-        printf("gethostbyname failed\n");
-	exit(-1);
-    }
-    
-    memset( (void *)&sin, 0, sizeof(sin) );
-    memmove( (void *)&sin.sin_addr, (void *)hp->h_addr, hp->h_length);
-    sin.sin_family = hp->h_addrtype;
-    sin.sin_port   = htons( (unsigned short) portnum );
-    
-    sfd = socket( AF_INET, SOCK_STREAM, 0 );
-    if (sfd < 0)
-    {
-        printf("socket failed\n");
-	exit(-1);
-    }
-    
-    if (setsockopt( sfd, IPPROTO_TCP, TCP_NODELAY, (char *)&optval, sizeof(optval) ))
-    {
-	perror( "Error calling setsockopt:" );
-    }
-
-    if (connect( sfd, (struct sockaddr *)&sin, sizeof(sin) ) < 0)
-    {
-        printf("connect failed\n");
-	exit(-1);
-    }
-
-    return sfd;
-}
-
diff --git a/src/pm/mpd/proxy.c b/src/pm/mpd/proxy.c
deleted file mode 100644
index c69146a..0000000
--- a/src/pm/mpd/proxy.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *  (C) 2001 by Argonne National Laboratory.
- *      See COPYRIGHT in top-level directory.
- */
-
-#include <stdio.h>
-#include <unistd.h>
-/* MAXHOSTNAMELEN may be defined in sys/param.h (Linux, OSX) or 
-   netdb.h (Solaris); a typical value is 256 */
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-#ifndef MAXHOSTNAMELEN
-#define MAXHOSTNAMELEN 256
-#endif
-
-int main( int argc, char * argv[] )
-{
-    int i;
-    size_t len;
-    char myhostname[MAXHOSTNAMELEN];
-
-    gethostname( myhostname, MAXHOSTNAMELEN );
-    printf( "On %s:  ", myhostname );
-    for ( i = 0; i < argc; i++ )
-	printf( "%s ", argv[i] );
-    printf( "\n" );
-    
-    return( 0 );
-}
diff --git a/src/pm/mpd/setup_pm b/src/pm/mpd/setup_pm
deleted file mode 100644
index e950e23..0000000
--- a/src/pm/mpd/setup_pm
+++ /dev/null
@@ -1,3 +0,0 @@
-# tell pmi/simple/configure that we need support for PMI_PORT
-NEED_PMIPORT=yes
-export NEED_PMIPORT
diff --git a/src/pm/mpd/sigcatcher.c b/src/pm/mpd/sigcatcher.c
deleted file mode 100644
index a384631..0000000
--- a/src/pm/mpd/sigcatcher.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *  (C) 2001 by Argonne National Laboratory.
- *      See COPYRIGHT in top-level directory.
- */
-
-#include <signal.h>
-#include <stdio.h>
-#include <unistd.h>
-
-void handler(int signal) {
-
-    printf("sigcatcher:  caught signal %i\n", signal);
-    fflush(stdout);
-    /* if(signal == SIGTERM)
-	exit(signal);
-    */	
-}
-
-int main(int argc, char *argv[]){
-
-    int i;
-
-    for(i=1;i<32;i++)
-	signal(i, handler);
-
-    printf("sigcatcher:  ready\n");
-    fflush(stdout);
-    while(1)
-	;
-    /* sleep(1); */
-}
diff --git a/src/pm/mpd/sleeploop.c b/src/pm/mpd/sleeploop.c
deleted file mode 100644
index cd6a9b1..0000000
--- a/src/pm/mpd/sleeploop.c
+++ /dev/null
@@ -1,17 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *  (C) 2001 by Argonne National Laboratory.
- *      See COPYRIGHT in top-level directory.
- */
-
-#include <stdio.h>
-
-main()
-{
-    /* fork(); */
-    while (1)
-    {
-        printf("going\n"); fflush(stdout);
-	sleep(3);
-    }
-}
diff --git a/src/pm/mpd/test/test1.py b/src/pm/mpd/test/test1.py
deleted file mode 100755
index 79079a5..0000000
--- a/src/pm/mpd/test/test1.py
+++ /dev/null
@@ -1,158 +0,0 @@
-#!/usr/bin/env python
-#
-#   (C) 2001 by Argonne National Laboratory.
-#       See COPYRIGHT in top-level directory.
-#
-# Note that I repeat code for each test just in case I want to
-# run one separately.  I can simply copy it out of here and run it. 
-# A single test can typically be chgd simply by altering its value(s)
-# for one or more of:
-#     PYEXT, NMPDS, HFILE
-
-import os, sys, commands, time
-sys.path += [os.getcwd()]  # do this once
-
-print "mpd tests---------------------------------------------------"
-
-clusterHosts = [ 'bp4%02d' % (i)  for i in range(0,8) ]
-print "clusterHosts=", clusterHosts
-
-# test: simple with 1 mpd (mpdboot uses mpd's -e and -d options)
-print "TEST -e -d"
-PYEXT = '.py'
-NMPDS = 1
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-os.system("mpdboot%s -1 -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-expout = 'hello\nhello\nhello\n'
-mpdtest.run(cmd="mpiexec%s -n 3 /bin/echo hello" % (PYEXT), chkOut=1, expOut=expout )
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-# test: simple with 2 mpds on same machine (mpdboot uses mpd's -n option)
-print "TEST -n"
-PYEXT = '.py'
-NMPDS = 2
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-temph = open(HFILE,'w')
-for i in range(NMPDS): print >>temph, '%s' % (socket.gethostname())
-temph.close()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-os.system("mpdboot%s -1 -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-expout = 'hello\nhello\n'
-mpdtest.run(cmd="mpiexec%s -n 2 /bin/echo hello" % (PYEXT), chkOut=1, expOut=expout )
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-# test: simple with 3 mpds on 3 machines
-print "TEST simple hello msg on 3 nodes"
-PYEXT = '.py'
-NMPDS = 3
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-temph = open(HFILE,'w')
-for host in clusterHosts: print >>temph, host
-temph.close()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-os.system("mpdboot%s -1 -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-expout = 'hello\nhello\nhello\n'
-mpdtest.run(cmd="mpiexec%s -n 3 /bin/echo hello" % (PYEXT), chkOut=1, expOut=expout )
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-# test: simple 2 mpds on local machine (-l, -h, and -p option)
-print "TEST -l, -h, and -p"
-PYEXT = '.py'
-NMPDS = 3
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-temph = open(HFILE,'w')
-for host in clusterHosts: print >>temph, host
-temph.close()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-os.system("mpd%s -d -l 12345" % (PYEXT) )
-os.system("mpd%s -d -n -h %s -p 12345" % (PYEXT,socket.gethostname()) )
-expout = 'hello\nhello\nhello\n'
-mpdtest.run(cmd="mpiexec%s -n 3 /bin/echo hello" % (PYEXT), chkOut=1, expOut=expout )
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-# test: simple with 2 mpds on 2 machines  (--ncpus option)
-print "TEST --ncpus"
-PYEXT = '.py'
-NMPDS = 2
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-temph = open(HFILE,'w')
-for host in clusterHosts: print >>temph, "%s:2" % (host)
-temph.close()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-os.system("mpdboot%s -f %s -n %d --ncpus=2" % (PYEXT,HFILE,NMPDS) )
-myHost = socket.gethostname()
-expout = '0: %s\n1: %s\n2: %s\n3: %s\n' % (myHost,myHost,clusterHosts[0],clusterHosts[0])
-mpdtest.run(cmd="mpiexec%s -l -n 4 /bin/hostname" % (PYEXT), chkOut=1, expOut=expout )
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-# test: simple with 2 mpds on 2 machines  (--ifhn option)
-#   this is not a great test, but shows working with real ifhn, then failure with 127.0.0.1
-print "TEST minimal use of --ifhn"
-PYEXT = '.py'
-NMPDS = 2
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-temph = open(HFILE,'w')
-for host in clusterHosts:
-    hostinfo = socket.gethostbyname_ex(host)
-    IP = hostinfo[2][0]
-    print >>temph, '%s ifhn=%s' % (host,IP)
-temph.close()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-hostinfo = socket.gethostbyname_ex(socket.gethostname())
-IP = hostinfo[2][0]
-os.system("mpdboot%s -f %s -n %d --ifhn=%s" % (PYEXT,HFILE,NMPDS,IP) )
-expout = 'hello\nhello\n'
-mpdtest.run(cmd="mpiexec%s -n 2 /bin/echo hello" % (PYEXT), chkOut=1, expOut=expout )
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-## redo the above test with a local ifhn that should cause failure
-lines = commands.getoutput("mpdboot%s -f %s -n %d --ifhn=127.0.0.1" % (PYEXT,HFILE,NMPDS) )
-if len(lines) > 0:
-    if lines.find('failed to ping') < 0:
-        print "probable error in ifhn test using 127.0.0.1; printing lines of output next:"
-        print lines
-        sys.exit(-1)
-
-# test:
-print "TEST MPD_CON_INET_HOST_PORT"
-PYEXT = '.py'
-NMPDS = 1
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-temph = open(HFILE,'w')
-for host in clusterHosts: print >>temph, host
-temph.close()
-os.environ['MPD_CON_INET_HOST_PORT'] = 'localhost:4444'
-os.system("mpd.py &")
-time.sleep(1)  ##     time to get going
-expout = ['0: hello']
-rv = mpdtest.run(cmd="mpiexec%s -l -n 1 echo hello" % (PYEXT), expOut=expout,grepOut=1)
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
diff --git a/src/pm/mpd/test/test2.py b/src/pm/mpd/test/test2.py
deleted file mode 100755
index c75d3db..0000000
--- a/src/pm/mpd/test/test2.py
+++ /dev/null
@@ -1,441 +0,0 @@
-#!/usr/bin/env python
-#   (C) 2001 by Argonne National Laboratory.
-#       See COPYRIGHT in top-level directory.
-#
-# Note that I repeat code for each test just in case I want to
-# run one separately.  I can simply copy it out of here and run it. 
-# A single test can typically be chgd simply by altering its value(s)
-# for one or more of:
-#     PYEXT, NMPDS, HFILE
-
-import os, sys, commands
-sys.path += [os.getcwd()]  # do this once
-
-print "mpiexec tests-------------------------------------------"
-
-clusterHosts = [ 'bp4%02d' % (i)  for i in range(0,8) ]
-print "clusterHosts=", clusterHosts
-
-# test:
-print "TEST -machinefile"
-PYEXT = '.py'
-NMPDS = 4
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-temph = open(HFILE,'w')
-for host in clusterHosts: print >>temph, host
-temph.close()
-tempm = open('tempm','w')
-for host in clusterHosts: print >>tempm, '%s:2 ifhn=%s' % (host,host)
-tempm.close()
-mpdtest = MPDTest()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-os.system("mpdboot%s -1 -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-expout = '0: bp400\n1: bp400\n2: bp401\n3: bp401\n'   # 2 per host because of :2's in tempm
-mpdtest.run(cmd="mpiexec%s -l -machinefile %s -n 4 hostname" % (PYEXT,'tempm'), chkOut=1, expOut=expout)
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-# test:
-print "TEST -file"
-PYEXT = '.py'
-NMPDS = 1
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-os.system("mpdboot%s -1 -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-tempfilename = '/tmp/%s_tempin2' % (os.environ['USER'])
-f = open(tempfilename,'w')
-print >>f, """
-   <create-process-group totalprocs='3'>
-      <process-spec
-	   range='0-2'
-	   exec='/bin/echo'>
-        <arg idx='1' value="hello"> </arg>
-        <arg idx='2' value="again"> </arg>
-      </process-spec>
-   </create-process-group>
-"""
-f.close()
-expout = 'hello again\nhello again\nhello again\n'
-mpdtest.run(cmd="mpiexec%s -file %s" % (PYEXT,tempfilename),chkOut=1,expOut=expout)
-os.unlink(tempfilename)
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-# test:
-print "TEST -configfile"
-PYEXT = '.py'
-NMPDS = 1
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-os.system("mpdboot%s -1 -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-tempfilename = '/tmp/%s_tempin2' % (os.environ['USER'])
-f = open(tempfilename,'w')
-print >>f, "-l\n-n 1 echo hello there\n-n 1 echo hello again"
-f.close()
-expout = '0: hello there\n1: hello again\n'
-mpdtest.run(cmd="mpiexec%s -configfile %s" % (PYEXT,tempfilename),chkOut=1,expOut=expout)
-os.unlink(tempfilename)
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-# test:
-print "TEST -l"
-PYEXT = '.py'
-NMPDS = 1
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-os.system("mpdboot%s -1 -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-expout = '0: hello\n1: bye\n'
-mpdtest.run(cmd="mpiexec%s -l -n 1 echo hello : -n 1 echo bye" % (PYEXT),chkOut=1,expOut=expout)
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-# test:
-print "TEST -m"
-PYEXT = '.py'
-NMPDS = 1
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-os.system("mpdboot%s -1 -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-expout = '0-1:  hello\n'
-mpdtest.run(cmd="mpiexec%s -m -n 2 echo hello" % (PYEXT),chkOut=1,expOut=expout)
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-# test:
-print "TEST -ecfn"
-PYEXT = '.py'
-NMPDS = 1
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-os.system("mpdboot%s -1 -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-expout = 'hello\n'
-rv = mpdtest.run(cmd="mpiexec%s -ecfn tempxout -n 1 echo hello" % (PYEXT),chkOut=1,expOut=expout)
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-linesAsStr = commands.getoutput("cat tempxout")
-os.unlink("tempxout")
-if linesAsStr.find('exit-codes') < 0:
-    print "ecfn: Failed to create correct contents of xml file:"
-    print linesAsStr
-    sys.exit(-1)
-
-# test:
-print "TEST -s"
-PYEXT = '.py'
-NMPDS = 1
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-os.system("mpdboot%s -1 -n 1" % (PYEXT) )
-expin = 'hello\n'
-expout = '0: hello\n'
-rv = mpdtest.run(cmd="mpiexec%s -l -n 4 cat -" % (PYEXT),
-                 expOut=expout,chkOut=1,expIn=expin)
-expout = '0: hello\n1: hello\n2: hello\n3: hello\n'
-rv = mpdtest.run(cmd="mpiexec%s -l -s 0-3 -n 4 cat -" % (PYEXT),
-                 expOut=expout,chkOut=1,expIn=expin)
-expout = '0: hello\n1: hello\n2: hello\n3: hello\n'
-rv = mpdtest.run(cmd="mpiexec%s -l -s all -n 4 cat -" % (PYEXT),
-                 expOut=expout,chkOut=1,expIn=expin)
-expout = '0: hello\n2: hello\n3: hello\n'
-rv = mpdtest.run(cmd="mpiexec%s -l -s 0,2-3 -n 4 cat -" % (PYEXT),
-                 expOut=expout,chkOut=1,expIn=expin)
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-# test:
-print "TEST -1"
-PYEXT = '.py'
-NMPDS = 2
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-temph = open(HFILE,'w')
-for host in clusterHosts: print >>temph, host
-temph.close()
-os.system("mpdboot%s -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-expout = '%s\n' % (clusterHosts[0])
-rv = mpdtest.run(cmd="mpiexec%s -1 -n 1 /bin/hostname" % (PYEXT), expOut=expout,chkOut=1)
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-# test:
-print "TEST -ifhn"
-# not a particularly good test; you can hang/fail with an invalid ifhn
-# ifhn is not very useful for mpiexec since mpd can fill it in as needed
-PYEXT = '.py'
-NMPDS = 2
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-temph = open(HFILE,'w')
-for host in clusterHosts: print >>temph, host
-temph.close()
-os.system("mpdboot%s -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-expout = 'hello\n'
-rv = mpdtest.run(cmd="mpiexec%s -ifhn 127.0.0.1 -n 1 /bin/echo hello" % (PYEXT),
-                 expOut=expout,chkOut=1)
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-# test:
-print "TEST -n"
-PYEXT = '.py'
-NMPDS = 1
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-os.system("mpdboot%s -1 -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-expout = '0: hello\n1: bye\n'
-mpdtest.run(cmd="mpiexec%s -l -n 1 echo hello : -n 1 echo bye" % (PYEXT),chkOut=1,expOut=expout)
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-# test:
-print "TEST -wdir"
-# not a particularly good test; you can hang/fail with an invalid ifhn
-# ifhn is not very useful for mpiexec since mpd can fill it in as needed
-PYEXT = '.py'
-NMPDS = 2
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-temph = open(HFILE,'w')
-for host in clusterHosts: print >>temph, host
-temph.close()
-os.system("mpdboot%s -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-expout = '/tmp\n/tmp\n'
-rv = mpdtest.run(cmd="mpiexec%s -wdir /tmp -n 2 /bin/pwd" % (PYEXT),
-                 expOut=expout,chkOut=1)
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-# test:
-print "TEST -path"
-# not a particularly good test; you can hang/fail with an invalid ifhn
-# ifhn is not very useful for mpiexec since mpd can fill it in as needed
-PYEXT = '.py'
-NMPDS = 2
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-temph = open(HFILE,'w')
-for host in clusterHosts: print >>temph, host
-temph.close()
-os.system("mpdboot%s -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-expout = '/tmp:/bin\n/tmp:/bin\n'
-mpdtest.run(cmd="mpiexec%s -path /tmp:/bin -n 2 sh -c '/bin/echo $PATH'" % (PYEXT),
-            expOut=expout,chkOut=1)
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-# test:
-print "TEST -host"
-# not a particularly good test; you can hang/fail with an invalid ifhn
-# ifhn is not very useful for mpiexec since mpd can fill it in as needed
-PYEXT = '.py'
-NMPDS = 5
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-temph = open(HFILE,'w')
-for host in clusterHosts: print >>temph, host
-temph.close()
-os.system("mpdboot%s -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-expout = '%s\n' % clusterHosts[3]
-rv = mpdtest.run(cmd="mpiexec%s -n 1 -host %s /bin/hostname" % (PYEXT,clusterHosts[3]),
-                 expOut=expout,chkOut=1)
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-# test:
-print "TEST -soft"
-PYEXT = '.py'
-NMPDS = 1
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-temph = open(HFILE,'w')
-for host in clusterHosts: print >>temph, host
-temph.close()
-os.system("mpdboot%s -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-expout = 'hello\nhello\nhello\nhello\nhello\n'  # 5 times
-rv = mpdtest.run(cmd="mpiexec%s -n 9 -soft 1:5:2 /bin/echo hello" % (PYEXT),
-                 expOut=expout,chkOut=1)
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-# test:
-print "TEST -envall (the default)"
-PYEXT = '.py'
-NMPDS = 1
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-temph = open(HFILE,'w')
-for host in clusterHosts: print >>temph, host
-temph.close()
-os.system("mpdboot%s -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-expout = 'BAR\n'
-os.environ['FOO'] = 'BAR'
-rv = mpdtest.run(cmd="mpiexec%s -n 1 -envall sh -c '/bin/echo $FOO'" % (PYEXT),
-                 expOut=expout,chkOut=1)
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-# test:
-print "TEST -envnone"
-PYEXT = '.py'
-NMPDS = 1
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-temph = open(HFILE,'w')
-for host in clusterHosts: print >>temph, host
-temph.close()
-os.system("mpdboot%s -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-expout = '\n'
-os.environ['FOO'] = ''
-rv = mpdtest.run(cmd="mpiexec%s -n 1 -envnone sh -c '/bin/echo $FOO'" % (PYEXT),
-                 expOut=expout,chkOut=1)
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-# test:
-print "TEST -env"
-PYEXT = '.py'
-NMPDS = 1
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-temph = open(HFILE,'w')
-for host in clusterHosts: print >>temph, host
-temph.close()
-os.system("mpdboot%s -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-expout = 'BAR\n'
-rv = mpdtest.run(cmd="mpiexec%s -n 1 -env FOO BAR sh -c '/bin/echo $FOO'" % (PYEXT),
-                 expOut=expout,chkOut=1)
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-# test:
-print "TEST -envlist"
-PYEXT = '.py'
-NMPDS = 1
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-temph = open(HFILE,'w')
-for host in clusterHosts: print >>temph, host
-temph.close()
-os.system("mpdboot%s -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-os.environ['FOO'] = 'BAR'
-os.environ['RMB'] = 'ZZZ'
-expout = 'BAR ZZZ\n'
-rv = mpdtest.run(cmd="mpiexec%s -n 1 -envlist FOO,RMB sh -c '/bin/echo $FOO $RMB'" % (PYEXT),
-                 expOut=expout,chkOut=1)
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-# test:
-print "TEST -gn"
-PYEXT = '.py'
-NMPDS = 1
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-temph = open(HFILE,'w')
-for host in clusterHosts: print >>temph, host
-temph.close()
-os.system("mpdboot%s -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-expout = 'hello\nhello\nbye\nbye\n'
-rv = mpdtest.run(cmd="mpiexec%s -gn 2 /bin/echo hello : /bin/echo bye" % (PYEXT),
-                 expOut=expout,chkOut=1)
-rv = mpdtest.run(cmd="mpiexec%s -gn 2 : /bin/echo hello : /bin/echo bye" % (PYEXT),
-                 expOut=expout,chkOut=1)
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-# test:
-print "TEST -gexec"
-PYEXT = '.py'
-NMPDS = 2
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-temph = open(HFILE,'w')
-for host in clusterHosts: print >>temph, host
-temph.close()
-os.system("mpdboot%s -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-expout = '%s\n%s\n' % (socket.gethostname(),clusterHosts[0])
-rv = mpdtest.run(cmd="mpiexec%s -gexec hostname : -n 1 : -n 1" % (PYEXT),
-                 expOut=expout,chkOut=1)
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-# test:
-print "TEST -genvlist"
-PYEXT = '.py'
-NMPDS = 2
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-temph = open(HFILE,'w')
-for host in clusterHosts: print >>temph, host
-temph.close()
-os.system("mpdboot%s -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-os.environ['FOO'] = 'BAR'
-os.environ['RMB'] = 'ZZZ'
-expout = 'BAR ZZZ\n'
-rv = mpdtest.run(cmd="mpiexec%s -genvlist FOO,RMB : sh -c '/bin/echo $FOO $RMB'" % (PYEXT),
-                 expOut=expout,chkOut=1)
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
diff --git a/src/pm/mpd/test/test3.py b/src/pm/mpd/test/test3.py
deleted file mode 100755
index 9831928..0000000
--- a/src/pm/mpd/test/test3.py
+++ /dev/null
@@ -1,149 +0,0 @@
-#!/usr/bin/env python
-#   (C) 2001 by Argonne National Laboratory.
-#       See COPYRIGHT in top-level directory.
-#
-# Note that I repeat code for each test just in case I want to
-# run one separately.  I can simply copy it out of here and run it. 
-# A single test can typically be chgd simply by altering its value(s)
-# for one or more of:
-#     PYEXT, NMPDS, HFILE
-
-import os, sys, commands
-sys.path += [os.getcwd()]  # do this once
-
-print "mpi tests---------------------------------------------------"
-
-clusterHosts = [ 'bp4%02d' % (i)  for i in range(0,8) ]
-print "clusterHosts=", clusterHosts
-
-MPIDir = "/home/rbutler/mpich"
-
-# test: cpi
-print "TEST cpi"
-PYEXT = '.py'
-NMPDS = 1
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-os.system("mpdboot%s -1 -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-expout = ['Process 0 of 3','Process 1 of 3','Process 2 of 3']
-rv = mpdtest.run(cmd="mpiexec%s -n 3 %s/examples/cpi" % (PYEXT,MPIDir),
-                 grepOut=1, expOut=expout )
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-# test: spawn1
-print "TEST spawn1"
-PYEXT = '.py'
-NMPDS = 1
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-os.system("mpdboot%s -1 -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-expout = ['No Errors']
-olddir = os.getcwd()
-os.chdir('%s/test/mpi/spawn' % (MPIDir))
-rv = mpdtest.run(cmd="%s/mpiexec%s -n 1 spawn1" % (olddir,PYEXT),  # -n 1
-                 grepOut=1, expOut=expout )
-os.chdir(olddir)
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-# test: spawn2
-print "TEST spawn2"
-PYEXT = '.py'
-NMPDS = 1
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-os.system("mpdboot%s -1 -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-expout = ['No Errors']
-olddir = os.getcwd()
-os.chdir('%s/test/mpi/spawn' % (MPIDir))
-rv = mpdtest.run(cmd="%s/mpiexec%s -n 1 spawn2" % (olddir,PYEXT),  # -n 1
-                 grepOut=1, expOut=expout )
-os.chdir(olddir)
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-# test: spawnmult2
-print "TEST spawnmult2"
-PYEXT = '.py'
-NMPDS = 1
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-os.system("mpdboot%s -1 -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-expout = ['No Errors']
-olddir = os.getcwd()
-os.chdir('%s/test/mpi/spawn' % (MPIDir))
-rv = mpdtest.run(cmd="%s/mpiexec%s -n 2 spawnmult2" % (olddir,PYEXT),  # -n 2
-                 grepOut=1, expOut=expout )
-os.chdir(olddir)
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-# test: spawnargv
-print "TEST spawnargv"
-PYEXT = '.py'
-NMPDS = 1
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-os.system("mpdboot%s -1 -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-expout = ['No Errors']
-olddir = os.getcwd()
-os.chdir('%s/test/mpi/spawn' % (MPIDir))
-rv = mpdtest.run(cmd="%s/mpiexec%s -n 1 spawnargv" % (olddir,PYEXT),  # -n 2
-                 grepOut=1, expOut=expout )
-os.chdir(olddir)
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-# test: spawnintra
-print "TEST spawnintra"
-PYEXT = '.py'
-NMPDS = 1
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-os.system("mpdboot%s -1 -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-expout = ['No Errors']
-olddir = os.getcwd()
-os.chdir('%s/test/mpi/spawn' % (MPIDir))
-rv = mpdtest.run(cmd="%s/mpiexec%s -n 1 spawnintra" % (olddir,PYEXT),  # -n 2
-                 grepOut=1, expOut=expout )
-os.chdir(olddir)
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-# test: namepub
-print "TEST namepub"
-PYEXT = '.py'
-NMPDS = 1
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-os.system("mpdboot%s -1 -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-expout = ['No Errors']
-olddir = os.getcwd()
-os.chdir('%s/test/mpi/spawn' % (MPIDir))
-rv = mpdtest.run(cmd="%s/mpiexec%s -n 1 namepub" % (olddir,PYEXT),  # -n 2
-                 grepOut=1, expOut=expout )
-os.chdir(olddir)
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
diff --git a/src/pm/mpd/test/test4.py b/src/pm/mpd/test/test4.py
deleted file mode 100755
index 5fece41..0000000
--- a/src/pm/mpd/test/test4.py
+++ /dev/null
@@ -1,139 +0,0 @@
-#!/usr/bin/env python
-#   (C) 2001 by Argonne National Laboratory.
-#       See COPYRIGHT in top-level directory.
-#
-# Note that I repeat code for each test just in case I want to
-# run one separately.  I can simply copy it out of here and run it. 
-# A single test can typically be chgd simply by altering its value(s)
-# for one or more of:
-#     PYEXT, NMPDS, HFILE
-
-import os, sys, commands
-sys.path += [os.getcwd()]  # do this once
-
-print "console pgm tests---------------------------------------------------"
-
-clusterHosts = [ 'bp4%02d' % (i)  for i in range(0,8) ]
-print "clusterHosts=", clusterHosts
-
-if not os.access("infloop",os.X_OK):
-    os.system("make infloop")
-
-# test:
-print "TEST mpdtrace"
-PYEXT = '.py'
-NMPDS = 3
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-temph = open(HFILE,'w')
-for host in clusterHosts: print >>temph, host
-temph.close()
-os.system("mpdboot%s -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-expout = ['%s' % (socket.gethostname()),
-          '%s' % (clusterHosts[0]),
-          '%s' % (clusterHosts[1])]
-rv = mpdtest.run(cmd="mpdtrace%s -l" % (PYEXT), grepOut=1, expOut=expout )
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-# test:
-print "TEST mpdringtest"
-PYEXT = '.py'
-NMPDS = 3
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-temph = open(HFILE,'w')
-for host in clusterHosts: print >>temph, host
-temph.close()
-os.system("mpdboot%s -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-nLoops = 100
-expout = ['time for %d loops' % (nLoops) ]
-rv = mpdtest.run(cmd="mpdringtest%s %d" % (PYEXT,nLoops), grepOut=1, expOut=expout )
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-# test:
-print "TEST mpdexit"
-PYEXT = '.py'
-NMPDS = 3
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-temph = open(HFILE,'w')
-for host in clusterHosts: print >>temph, host
-temph.close()
-os.system("mpdboot%s -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-linesAsStr = commands.getoutput("mpdtrace%s -l" % (PYEXT) )
-for line in linesAsStr.split('\n'):
-    if line.find(clusterHosts[0]) >= 0:
-        mpdid = line.split(' ')[0]  # strip off the (ifhn) stuff
-        break
-else:
-    mpdid = ''
-if mpdid:
-    rv = mpdtest.run(cmd="mpdexit%s %s" % (PYEXT,mpdid), chkOut=1 )
-else:
-    print 'failed to find %s in mpdtrace for mpdexit' % (clusterHosts[0])
-    sys.exit(-1)
-expout = ['%s' % (socket.gethostname()), '%s' % (clusterHosts[1])]
-rv = mpdtest.run(cmd="mpdtrace%s -l" % (PYEXT),
-                 grepOut=1, expOut=expout )
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-# test:
-print "TEST mpdlistjobs and mpdkilljob"
-PYEXT = '.py'
-NMPDS = 1
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-temph = open(HFILE,'w')
-for host in clusterHosts: print >>temph, host
-temph.close()
-os.system("mpdboot%s -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-os.system("mpiexec%s -s all -a ralph -n 2 infloop -p &" % (PYEXT))  # -p => don't print
-import time    ## give the mpiexec
-time.sleep(2)  ##     time to get going
-expout = ['ralph']
-rv = mpdtest.run(cmd="mpdlistjobs%s #1" % (PYEXT), grepOut=1, expOut=expout )
-rv = mpdtest.run(cmd="mpdkilljob%s -a ralph" % (PYEXT), chkOut=0 )
-expout = ''
-rv = mpdtest.run(cmd="mpdlistjobs%s #2" % (PYEXT), chkOut=1, expOut=expout )
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-os.system("killall -q infloop")  ## just to be safe
-
-# test:
-print "TEST mpdsigjob"
-PYEXT = '.py'
-NMPDS = 1
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-temph = open(HFILE,'w')
-for host in clusterHosts: print >>temph, host
-temph.close()
-os.system("mpdboot%s -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-os.system("mpiexec%s -s all -a ralph -n 2 infloop -p &" % (PYEXT))  # -p => don't print
-import time    ## give the mpiexec
-time.sleep(2)  ##     time to get going
-expout = ['ralph']
-rv = mpdtest.run(cmd="mpdlistjobs%s #1" % (PYEXT), grepOut=1, expOut=expout )
-rv = mpdtest.run(cmd="mpdsigjob%s INT -a ralph -g" % (PYEXT), chkOut=0 )
-expout = ''
-rv = mpdtest.run(cmd="mpdlistjobs%s #2" % (PYEXT), chkOut=1, expOut=expout )
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
diff --git a/src/pm/mpd/test/test5.py b/src/pm/mpd/test/test5.py
deleted file mode 100755
index 5a4478b..0000000
--- a/src/pm/mpd/test/test5.py
+++ /dev/null
@@ -1,113 +0,0 @@
-#!/usr/bin/env python
-#   (C) 2001 by Argonne National Laboratory.
-#       See COPYRIGHT in top-level directory.
-#
-# Note that I repeat code for each test just in case I want to
-# run one separately.  I can simply copy it out of here and run it. 
-# A single test can typically be chgd simply by altering its value(s)
-# for one or more of:
-#     PYEXT, NMPDS, HFILE
-
-import os, sys, commands
-sys.path += [os.getcwd()]  # do this once
-
-print "odd tests---------------------------------------------------"
-
-clusterHosts = [ 'bp4%02d' % (i)  for i in range(0,8) ]
-print "clusterHosts=", clusterHosts
-
-MPIDir = "/home/rbutler/mpich"
-MPI_1_Dir = "/home/rbutler/mpich1i"
-
-# test: singleton init (cpi)
-print "TEST singleton init (cpi)"
-PYEXT = '.py'
-NMPDS = 1
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-os.system("mpdboot%s -1 -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-expout = ['Process 0 of 1','pi is approximately 3']
-rv = mpdtest.run(cmd="%s/examples/cpi" % (MPIDir), grepOut=1, expOut=expout )
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-# test: bnr (mpich1-compat using cpi)
-print "TEST bnr (mpich1-compat using cpi)"
-PYEXT = '.py'
-NMPDS = 1
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-os.system("mpdboot%s -1 -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-expout = ['Process 0 on','Process 1 on','Process 2 on','pi is approximately 3']
-rv = mpdtest.run(cmd="mpiexec%s -bnr -n 3 %s/examples/cpi" % (PYEXT,MPI_1_Dir),
-                 grepOut=1, expOut=expout )
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-# test:
-print "TEST ^C to mpiexec"
-PYEXT = '.py'
-NMPDS = 1
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-temph = open(HFILE,'w')
-for host in clusterHosts: print >>temph, host
-temph.close()
-os.system("mpdboot%s -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-import popen2
-runner = popen2.Popen4("mpiexec%s -n 2 infloop -p" % (PYEXT))  # -p => don't print
-import time    ## give the mpiexec
-time.sleep(2)  ##     time to get going
-os.system("kill -INT %d" % (runner.pid) )  # simulate user ^C
-expout = ''
-rv = mpdtest.run(cmd="mpdlistjobs%s #2" % (PYEXT), chkOut=1, expOut=expout )
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-os.system("killall -q infloop")  ## just to be safe
-
-# test:
-print "TEST re-knit a ring"
-PYEXT = '.py'
-NMPDS = 3
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-os.environ['MPD_CON_EXT'] = 'testing'
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-import popen2, time
-mpd1 = popen2.Popen4("mpd%s -l 12345" % (PYEXT))
-time.sleep(2)
-mpd2 = popen2.Popen4("mpd%s -n -h %s -p 12345" % (PYEXT,socket.gethostname()) )
-mpd3 = popen2.Popen4("mpd%s -n -h %s -p 12345" % (PYEXT,socket.gethostname()) )
-time.sleep(2)
-rv = mpdtest.run(cmd="mpdtrace%s" % (PYEXT), chkOut=0 )
-if len(rv['OUT']) != NMPDS:
-    print "a: unexpected number of lines of output from mpdtrace", rv['OUT']
-    sys.exit(-1)
-hostname = socket.gethostname()
-for line in rv['OUT']:
-    if line.find(hostname) < 0:
-        print "a: bad lines in output of mpdtrace", rv['OUT']
-        sys.exit(-1)
-os.system("kill -9 %d" % (mpd3.pid) )
-time.sleep(1)
-rv = mpdtest.run(cmd="mpdtrace%s" % (PYEXT), chkOut=0 )
-if len(rv['OUT']) != NMPDS-1:
-    print "b: unexpected number of lines of output from mpdtrace", rv['OUT']
-    sys.exit(-1)
-hostname = socket.gethostname()
-for line in rv['OUT']:
-    if line.find(hostname) < 0:
-        print "b: bad lines in output of mpdtrace", rv['OUT']
-        sys.exit(-1)
-os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
diff --git a/src/pm/mpd/test/testall.sh b/src/pm/mpd/test/testall.sh
deleted file mode 100755
index 4f020fc..0000000
--- a/src/pm/mpd/test/testall.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/sh
-
-echo 
-echo "RMB: tests between magpie and cluster hosts"
-echo 
-
-if [ ! -x $HOME/mpich/test/mpi/spawn/spawn1 ] ; then
-    echo '***  build the spawn pgms first'
-    exit -1
-fi
-
-test1.py
-test2.py
-test3.py
-test4.py
-test5.py
-testroot.py
diff --git a/src/pm/mpd/test/testroot.py b/src/pm/mpd/test/testroot.py
deleted file mode 100755
index b413a48..0000000
--- a/src/pm/mpd/test/testroot.py
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/usr/bin/env python
-#   (C) 2001 by Argonne National Laboratory.
-#       See COPYRIGHT in top-level directory.
-#
-# This program does installs, etc and needs to run start to finish.
-# Presently, it does NOT use the 'testing' MPD_CON_EXT.
-
-import os, sys
-
-USERDIR = "/tmp/rmbmpd"
-ROOTDIR = "/tmp/rootmpd"
-
-# install as user
-print "install as user ---------------------------------------------------"
-if not os.access("./mpdroot",os.X_OK):
-    os.system("./configure")  # use prefix on makes below
-    os.system("make")
-os.system("make prefix=%s install" % (USERDIR) )
-
-# test:
-print "TEST mpd as user ; mpdtrace as user"
-PYEXT = ''
-NMPDS = 1
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-os.system("%s/bin/mpdallexit%s 1> /dev/null 2> /dev/null" % (USERDIR,PYEXT) )
-os.system("%s/bin/mpdboot%s -n %d" % (USERDIR,PYEXT,NMPDS) )
-expout = ['%s' % (socket.gethostname())]
-rv = mpdtest.run(cmd="%s/bin/mpdtrace%s -l" % (USERDIR,PYEXT), grepOut=1, expOut=expout )
-os.system("%s/bin/mpdallexit%s 1> /dev/null 2> /dev/null" % (USERDIR,PYEXT) )
-
-# install as root
-print "install as root ---------------------------------------------------"
-if not os.access("./mpdroot",os.X_OK):
-    os.system("./configure")  # use prefix on makes below
-    os.system("make")
-os.system("sudo make prefix=%s install" % (ROOTDIR) )    # sudo did not work here
-
-# test:
-print "TEST mpd as root ; mpdtrace as user"
-PYEXT = ''
-NMPDS = 1
-HFILE = 'temph'
-import os,socket
-from mpdlib import MPDTest
-mpdtest = MPDTest()
-os.system("sudo %s/bin/mpdallexit%s 1> /dev/null 2> /dev/null" % (ROOTDIR,PYEXT) )
-os.system("sudo %s/bin/mpd%s -d" % (ROOTDIR,PYEXT) )  # not using boot here
-import time
-time.sleep(2)
-os.environ['MPD_USE_ROOT_MPD'] = '1'
-# os.system("%s/bin/mpdtrace%s -l" % (ROOTDIR,PYEXT))
-expout = ['%s' % (socket.gethostname())]
-rv = mpdtest.run(cmd="%s/bin/mpdtrace%s -l" % (ROOTDIR,PYEXT), grepOut=1, expOut=expout )
-
-print "TEST that user cannot remove files owned by root"
-os.system("sudo touch /tmp/testroot")
-expout = ['cannot remove']
-rv = mpdtest.run(cmd="%s/bin/mpiexec%s -n 1 rm -f /tmp/testroot" % (ROOTDIR,PYEXT),
-                 grepOut=1, expOut=expout )
-
-os.system("sudo rm -f /tmp/testroot")
-os.system("sudo %s/bin/mpdallexit%s 1> /dev/null 2> /dev/null" % (ROOTDIR,PYEXT) )
diff --git a/src/pm/mpd/test/tests.py b/src/pm/mpd/test/tests.py
deleted file mode 100755
index 2b0fbbc..0000000
--- a/src/pm/mpd/test/tests.py
+++ /dev/null
@@ -1,898 +0,0 @@
-#!/usr/bin/env python
-#
-#   (C) 2001 by Argonne National Laboratory.
-#       See COPYRIGHT in top-level directory.
-#
-
-import os, sys, socket, commands, time
-sys.path.append("..")         # where to find mpdlib, etc.
-from mpdlib import MPDTest    # do this AFTER extending sys.path
-
-clusterHosts = []
-# clusterHosts = ['bp400','bp401','bp402','bp403']
-MPI_srcdir = "/home/rbutler/mpich"
-MPI_1_dir  = "/home/rbutler/mpich1i"
-USER_INSTALL_DIR = "/tmp/usermpd"
-ROOT_INSTALL_DIR = "/tmp/rootmpd"
-os.environ['PATH'] = "..:" + os.environ['PATH']
-PYEXT = ".py"
-HFILE = "temph"
-os.environ['MPD_CON_EXT'] = "testing"
-
-
-testsToRun = [ 0 for x in range(0,10000) ]         # init all to 0; override below
-
-# for i in range(0,10000):    testsToRun[i] = 1    # run all tests
-for i in range(0,1000):     testsToRun[i] = 1    # run tests for mpd
-# for i in range(1000,2000):  testsToRun[i] = 1    # run tests for mpiexec
-# for i in range(2000,3000):  testsToRun[i] = 1    # run MPI tests
-# for i in range(3000,4000):  testsToRun[i] = 1    # run console pgm tests
-# for i in range(8000,9000):  testsToRun[i] = 1    # run misc tests
-# for i in range(9000,10000): testsToRun[i] = 1    # run root tests
-# testsToRun[3003] = 1                               # run this one test
-
-
-if 1 in testsToRun[0:1000]:
-    print "mpd tests---------------------------------------------------"
-
-if testsToRun[0]:
-    # test: simple with 1 mpd (mpdboot uses mpd's -e and -d options)
-    print "TEST -e -d"
-    NMPDS = 1
-    mpdtest = MPDTest()
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-    os.system("mpdboot%s -n %s" % (PYEXT,NMPDS) )
-    expout = 'hello\nhello\nhello\n'
-    mpdtest.run(cmd="mpiexec%s -n 3 /bin/echo hello" % (PYEXT), chkOut=1, expOut=expout )
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-if testsToRun[1]:
-    # test: simple with 2 mpds on same machine (mpdboot uses mpd's -n option)
-    print "TEST -n"
-    NMPDS = 2
-    if NMPDS > len(clusterHosts)+1:
-        print "    skipping; too few hosts"
-    else:
-        mpdtest = MPDTest()
-        temph = open(HFILE,'w')
-        for i in range(NMPDS): print >>temph, '%s' % (socket.gethostname())
-        temph.close()
-        os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-        os.system("mpdboot%s -1 -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-        expout = 'hello\nhello\n'
-        mpdtest.run(cmd="mpiexec%s -n 2 /bin/echo hello" % (PYEXT), chkOut=1, expOut=expout )
-        os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-        os.unlink(HFILE)
-
-if testsToRun[2]:
-    # test: simple with 3 mpds on 3 machines
-    print "TEST simple hello msg on 3 nodes"
-    NMPDS = 3
-    if NMPDS > len(clusterHosts)+1:
-        print "    skipping; too few hosts"
-    else:
-        mpdtest = MPDTest()
-        temph = open(HFILE,'w')
-        for host in clusterHosts: print >>temph, host
-        temph.close()
-        os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-        os.system("mpdboot%s -1 -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-        expout = 'hello\nhello\nhello\n'
-        mpdtest.run(cmd="mpiexec%s -n 3 /bin/echo hello" % (PYEXT), chkOut=1, expOut=expout )
-        os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-        os.unlink(HFILE)
-
-if testsToRun[3]:
-    # test: simple 2 mpds on local machine (-l, -h, and -p option)
-    print "TEST -l, -h, and -p"
-    NMPDS = 3
-    if NMPDS > len(clusterHosts)+1:
-        print "    skipping; too few hosts"
-    else:
-        mpdtest = MPDTest()
-        temph = open(HFILE,'w')
-        for host in clusterHosts: print >>temph, host
-        temph.close()
-        os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-        os.system("mpd%s -d -l 12345" % (PYEXT) )
-        os.system("mpd%s -d -n -h %s -p 12345" % (PYEXT,socket.gethostname()) )
-        expout = 'hello\nhello\nhello\n'
-        mpdtest.run(cmd="mpiexec%s -n 3 /bin/echo hello" % (PYEXT), chkOut=1, expOut=expout )
-        os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-        os.unlink(HFILE)
-
-if testsToRun[4]:
-    # test: simple with 2 mpds on 2 machines  (--ncpus option)
-    print "TEST --ncpus"
-    NMPDS = 2
-    if NMPDS > len(clusterHosts)+1:
-        print "    skipping; too few hosts"
-    else:
-        mpdtest = MPDTest()
-        temph = open(HFILE,'w')
-        for host in clusterHosts: print >>temph, "%s:2" % (host)
-        temph.close()
-        os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-        os.system("mpdboot%s -f %s -n %d --ncpus=2" % (PYEXT,HFILE,NMPDS) )
-        myHost = socket.gethostname()
-        expout = '0: %s\n1: %s\n2: %s\n3: %s\n' % (myHost,myHost,clusterHosts[0],clusterHosts[0])
-        mpdtest.run(cmd="mpiexec%s -l -n 4 /bin/hostname" % (PYEXT), chkOut=1, expOut=expout )
-        os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-        os.unlink(HFILE)
-
-if testsToRun[5]:
-    # test: simple with 2 mpds on 2 machines  (--ifhn option)
-    #   this is not a great test, but shows working with real ifhn, then failure with 127.0.0.1
-    print "TEST minimal use of --ifhn"
-    NMPDS = 2
-    if NMPDS > len(clusterHosts)+1:
-        print "    skipping; too few hosts"
-    else:
-        mpdtest = MPDTest()
-        temph = open(HFILE,'w')
-        for host in clusterHosts:
-            hostinfo = socket.gethostbyname_ex(host)
-            IP = hostinfo[2][0]
-            print >>temph, '%s ifhn=%s' % (host,IP)
-        temph.close()
-        os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-        hostinfo = socket.gethostbyname_ex(socket.gethostname())
-        IP = hostinfo[2][0]
-        os.system("mpdboot%s -f %s -n %d --ifhn=%s" % (PYEXT,HFILE,NMPDS,IP) )
-        expout = 'hello\nhello\n'
-        mpdtest.run(cmd="mpiexec%s -n 2 /bin/echo hello" % (PYEXT), chkOut=1, expOut=expout )
-        os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-        ## redo the above test with a local ifhn that should cause failure
-        lines = commands.getoutput("mpdboot%s -f %s -n %d --ifhn=127.0.0.1" % (PYEXT,HFILE,NMPDS) )
-        if len(lines) > 0:
-            if lines.find('failed to handshake') < 0:
-                print "probable error in ifhn test using 127.0.0.1; printing lines of output next:"
-                print lines
-                sys.exit(-1)
-        os.unlink(HFILE)
-
-if testsToRun[6]:
-    print "TEST MPD_CON_INET_HOST_PORT"
-    NMPDS = 1
-    mpdtest = MPDTest()
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-    import random
-    port = random.randrange(2000,9000)
-    print "    using port", port
-    os.environ['MPD_CON_INET_HOST_PORT'] = "localhost:%d" % (port)
-    os.system("mpd.py &")
-    time.sleep(1)  ##     time to get going
-    expout = ['0: hello']
-    rv = mpdtest.run(cmd="mpiexec%s -l -n 1 echo hello" % (PYEXT), expOut=expout,grepOut=1)
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-    os.unsetenv('MPD_CON_INET_HOST_PORT')   # get rid of this for later tests
-
-
-if 1 in testsToRun[1000:2000]:
-    print "mpiexec tests-------------------------------------------"
-
-if testsToRun[1000]:
-    print "TEST -machinefile"
-    NMPDS = 4
-    if NMPDS > len(clusterHosts)+1:
-        print "    skipping; too few hosts"
-    else:
-        temph = open(HFILE,'w')
-        for host in clusterHosts: print >>temph, host
-        temph.close()
-        tempm = open('tempm','w')
-        for host in clusterHosts: print >>tempm, '%s:2 ifhn=%s' % (host,host)
-        tempm.close()
-        mpdtest = MPDTest()
-        os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-        os.system("mpdboot%s -1 -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-        expout = '0: bp400\n1: bp400\n2: bp401\n3: bp401\n'   # 2 per host because of :2's in tempm
-        mpdtest.run(cmd="mpiexec%s -l -machinefile %s -n 4 hostname" % (PYEXT,'tempm'), chkOut=1, expOut=expout)
-        os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-        os.system("rm -f tempm %s" % (HFILE))
-
-if testsToRun[1001]:
-    print "TEST -file"
-    NMPDS = 1
-    mpdtest = MPDTest()
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-    os.system("mpdboot%s -n %d" % (PYEXT,NMPDS) )
-    tempfilename = '/tmp/%s_tempin2' % (os.environ['USER'])
-    f = open(tempfilename,'w')
-    print >>f, """
-       <create-process-group totalprocs='3'>
-          <process-spec
-	       range='0-2'
-	       exec='/bin/echo'>
-            <arg idx='1' value="hello"> </arg>
-            <arg idx='2' value="again"> </arg>
-          </process-spec>
-       </create-process-group>
-    """
-    f.close()
-    expout = 'hello again\nhello again\nhello again\n'
-    mpdtest.run(cmd="mpiexec%s -file %s" % (PYEXT,tempfilename),chkOut=1,expOut=expout)
-    os.unlink(tempfilename)
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-    
-if testsToRun[1002]:
-    print "TEST -configfile"
-    NMPDS = 1
-    mpdtest = MPDTest()
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-    os.system("mpdboot%s -n %d" % (PYEXT,NMPDS) )
-    tempfilename = '/tmp/%s_tempin2' % (os.environ['USER'])
-    f = open(tempfilename,'w')
-    print >>f, "-l\n-n 1 echo hello there\n-n 1 echo hello again"
-    f.close()
-    expout = '0: hello there\n1: hello again\n'
-    mpdtest.run(cmd="mpiexec%s -configfile %s" % (PYEXT,tempfilename),chkOut=1,expOut=expout)
-    os.unlink(tempfilename)
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-    
-if testsToRun[1003]:
-    print "TEST -l"
-    NMPDS = 1
-    mpdtest = MPDTest()
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-    os.system("mpdboot%s -n %d" % (PYEXT,NMPDS) )
-    expout = '0: hello\n1: bye\n'
-    mpdtest.run(cmd="mpiexec%s -l -n 1 echo hello : -n 1 echo bye" % (PYEXT),chkOut=1,expOut=expout)
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-if testsToRun[1004]:
-    print "TEST -m"
-    NMPDS = 1
-    mpdtest = MPDTest()
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-    os.system("mpdboot%s -n %d" % (PYEXT,NMPDS) )
-    expout = '0-1:  hello\n'
-    mpdtest.run(cmd="mpiexec%s -m -n 2 echo hello" % (PYEXT),chkOut=1,expOut=expout)
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-if testsToRun[1005]:
-    print "TEST -ecfn"
-    NMPDS = 1
-    mpdtest = MPDTest()
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-    os.system("mpdboot%s -n %d" % (PYEXT,NMPDS) )
-    expout = 'hello\n'
-    rv = mpdtest.run(cmd="mpiexec%s -ecfn tempxout -n 1 echo hello" % (PYEXT),chkOut=1,expOut=expout)
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-    linesAsStr = commands.getoutput("cat tempxout")
-    os.unlink("tempxout")
-    if linesAsStr.find('exit-codes') < 0:
-        print "ecfn: Failed to create correct contents of xml file:"
-        print linesAsStr
-        sys.exit(-1)
-
-if testsToRun[1006]:
-    print "TEST -s"
-    NMPDS = 1
-    mpdtest = MPDTest()
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-    os.system("mpdboot%s -n 1" % (PYEXT) )
-    expin = 'hello\n'
-    expout = '0: hello\n'
-    rv = mpdtest.run(cmd="mpiexec%s -l -n 4 cat -" % (PYEXT),
-                     expOut=expout,chkOut=1,expIn=expin)
-    expout = '0: hello\n1: hello\n2: hello\n3: hello\n'
-    rv = mpdtest.run(cmd="mpiexec%s -l -s 0-3 -n 4 cat -" % (PYEXT),
-                     expOut=expout,chkOut=1,expIn=expin)
-    expout = '0: hello\n1: hello\n2: hello\n3: hello\n'
-    rv = mpdtest.run(cmd="mpiexec%s -l -s all -n 4 cat -" % (PYEXT),
-                     expOut=expout,chkOut=1,expIn=expin)
-    expout = '0: hello\n2: hello\n3: hello\n'
-    rv = mpdtest.run(cmd="mpiexec%s -l -s 0,2-3 -n 4 cat -" % (PYEXT),
-                     expOut=expout,chkOut=1,expIn=expin)
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-if testsToRun[1007]:
-    print "TEST -1"
-    NMPDS = 2
-    if NMPDS > len(clusterHosts)+1:
-        print "    skipping; too few hosts"
-    else:
-        mpdtest = MPDTest()
-        os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-        temph = open(HFILE,'w')
-        for host in clusterHosts: print >>temph, host
-        temph.close()
-        os.system("mpdboot%s -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-        expout = '%s\n' % (clusterHosts[0])
-        rv = mpdtest.run(cmd="mpiexec%s -1 -n 1 /bin/hostname" % (PYEXT), expOut=expout,chkOut=1)
-        os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-        os.unlink(HFILE)
-
-if testsToRun[1008]:
-    print "TEST -ifhn"
-    # not a particularly good test; you can hang/fail with an invalid ifhn
-    # ifhn is not very useful for mpiexec since mpd can fill it in as needed
-    NMPDS = 2
-    if NMPDS > len(clusterHosts)+1:
-        print "    skipping; too few hosts"
-    else:
-        mpdtest = MPDTest()
-        os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-        temph = open(HFILE,'w')
-        for host in clusterHosts: print >>temph, host
-        temph.close()
-        os.system("mpdboot%s -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-        expout = 'hello\n'
-        rv = mpdtest.run(cmd="mpiexec%s -ifhn 127.0.0.1 -n 1 /bin/echo hello" % (PYEXT),
-                         expOut=expout,chkOut=1)
-        os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-        os.unlink(HFILE)
-
-if testsToRun[1009]:
-    print "TEST -n"
-    NMPDS = 1
-    if NMPDS > len(clusterHosts)+1:
-        print "    skipping; too few hosts"
-    else:
-        mpdtest = MPDTest()
-        os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-        os.system("mpdboot%s -n %d" % (PYEXT,NMPDS) )
-        expout = '0: hello\n1: bye\n'
-        mpdtest.run(cmd="mpiexec%s -l -n 1 echo hello : -n 1 echo bye" % (PYEXT),chkOut=1,expOut=expout)
-        os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-if testsToRun[1010]:
-    print "TEST -wdir"
-    # not a particularly good test; you can hang/fail with an invalid ifhn
-    # ifhn is not very useful for mpiexec since mpd can fill it in as needed
-    NMPDS = 2
-    if NMPDS > len(clusterHosts)+1:
-        print "    skipping; too few hosts"
-    else:
-        mpdtest = MPDTest()
-        os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-        temph = open(HFILE,'w')
-        for host in clusterHosts: print >>temph, host
-        temph.close()
-        os.system("mpdboot%s -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-        expout = '/tmp\n/tmp\n'
-        rv = mpdtest.run(cmd="mpiexec%s -wdir /tmp -n 2 /bin/pwd" % (PYEXT),
-                         expOut=expout,chkOut=1)
-        os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-        os.unlink(HFILE)
-
-if testsToRun[1011]:
-    print "TEST -path"
-    # not a particularly good test; you can hang/fail with an invalid ifhn
-    # ifhn is not very useful for mpiexec since mpd can fill it in as needed
-    NMPDS = 2
-    if NMPDS > len(clusterHosts)+1:
-        print "    skipping; too few hosts"
-    else:
-        mpdtest = MPDTest()
-        os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-        temph = open(HFILE,'w')
-        for host in clusterHosts: print >>temph, host
-        temph.close()
-        os.system("mpdboot%s -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-        expout = '/tmp:/bin\n/tmp:/bin\n'
-        mpdtest.run(cmd="mpiexec%s -path /tmp:/bin -n 2 /usr/bin/printenv | grep PATH" % (PYEXT),
-                    expOut=expout,chkOut=1)
-        os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-        os.unlink(HFILE)
-
-if testsToRun[1012]:
-    print "TEST -host"
-    NMPDS = 5
-    if NMPDS > len(clusterHosts)+1:
-        print "    skipping; too few hosts"
-    else:
-        mpdtest = MPDTest()
-        os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-        temph = open(HFILE,'w')
-        for host in clusterHosts: print >>temph, host
-        temph.close()
-        os.system("mpdboot%s -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-        expout = '%s\n' % clusterHosts[3]
-        rv = mpdtest.run(cmd="mpiexec%s -n 1 -host %s /bin/hostname" % (PYEXT,clusterHosts[3]),
-                         expOut=expout,chkOut=1)
-        os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-        os.unlink(HFILE)
-
-if testsToRun[1013]:
-    print "TEST -soft"
-    NMPDS = 1
-    mpdtest = MPDTest()
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-    os.system("mpdboot%s -n %d" % (PYEXT,NMPDS) )
-    expout = 'hello\nhello\nhello\nhello\nhello\n'  # 5 times
-    rv = mpdtest.run(cmd="mpiexec%s -n 9 -soft 1:5:2 /bin/echo hello" % (PYEXT),
-                     expOut=expout,chkOut=1)
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-if testsToRun[1014]:
-    print "TEST -envall (the default)"
-    NMPDS = 1
-    mpdtest = MPDTest()
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-    os.system("mpdboot%s -n %d" % (PYEXT,NMPDS) )
-    expout = 'BAR\n'
-    os.environ['FOO'] = 'BAR'
-    rv = mpdtest.run(cmd="mpiexec%s -n 1 -envall sh -c '/bin/echo $FOO'" % (PYEXT),
-                     expOut=expout,chkOut=1)
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-    os.unsetenv('FOO')   # get rid of this for later tests
-
-if testsToRun[1015]:
-    print "TEST -envnone"
-    NMPDS = 1
-    mpdtest = MPDTest()
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-    os.system("mpdboot%s -n %d" % (PYEXT,NMPDS) )
-    expout = '\n'
-    os.environ['FOO'] = ''
-    rv = mpdtest.run(cmd="mpiexec%s -n 1 -envnone sh -c '/bin/echo $FOO'" % (PYEXT),
-                     expOut=expout,chkOut=1)
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-    os.unsetenv('FOO')   # get rid of this for later tests
-
-if testsToRun[1016]:
-    print "TEST -env"
-    NMPDS = 1
-    mpdtest = MPDTest()
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-    os.system("mpdboot%s -n %d" % (PYEXT,NMPDS) )
-    expout = 'BAR\n'
-    rv = mpdtest.run(cmd="mpiexec%s -n 1 -env FOO BAR sh -c '/bin/echo $FOO'" % (PYEXT),
-                     expOut=expout,chkOut=1)
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-if testsToRun[1017]:
-    print "TEST -envlist"
-    NMPDS = 1
-    mpdtest = MPDTest()
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-    os.system("mpdboot%s -n %d" % (PYEXT,NMPDS) )
-    os.environ['FOO'] = 'BAR'
-    os.environ['RMB'] = 'ZZZ'
-    expout = 'BAR ZZZ\n'
-    rv = mpdtest.run(cmd="mpiexec%s -n 1 -envlist FOO,RMB sh -c '/bin/echo $FOO $RMB'" % (PYEXT),
-                     expOut=expout,chkOut=1)
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-    os.unsetenv('FOO')   # get rid of this for later tests
-    os.unsetenv('RMB')   # get rid of this for later tests
-
-if testsToRun[1018]:
-    print "TEST -gn"
-    NMPDS = 1
-    mpdtest = MPDTest()
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-    os.system("mpdboot%s -n %d" % (PYEXT,NMPDS) )
-    expout = 'hello\nhello\nbye\nbye\n'
-    rv = mpdtest.run(cmd="mpiexec%s -gn 2 /bin/echo hello : /bin/echo bye" % (PYEXT),
-                     expOut=expout,chkOut=1)
-    rv = mpdtest.run(cmd="mpiexec%s -gn 2 : /bin/echo hello : /bin/echo bye" % (PYEXT),
-                     expOut=expout,chkOut=1)
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-if testsToRun[1019]:
-    print "TEST -gexec"
-    NMPDS = 2
-    if NMPDS > len(clusterHosts)+1:
-        print "    skipping; too few hosts"
-    else:
-        mpdtest = MPDTest()
-        os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-        temph = open(HFILE,'w')
-        for host in clusterHosts: print >>temph, host
-        temph.close()
-        os.system("mpdboot%s -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-        expout = '%s\n%s\n' % (socket.gethostname(),clusterHosts[0])
-        rv = mpdtest.run(cmd="mpiexec%s -gexec hostname : -n 1 : -n 1" % (PYEXT),
-                         expOut=expout,chkOut=1)
-        os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-        os.unlink(HFILE)
-
-if testsToRun[1020]:
-    print "TEST -genvlist"
-    NMPDS = 2
-    if NMPDS > len(clusterHosts)+1:
-        print "    skipping; too few hosts"
-    else:
-        mpdtest = MPDTest()
-        os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-        temph = open(HFILE,'w')
-        for host in clusterHosts: print >>temph, host
-        temph.close()
-        os.system("mpdboot%s -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-        os.environ['FOO'] = 'BAR'
-        os.environ['RMB'] = 'ZZZ'
-        expout = 'BAR ZZZ\n'
-        rv = mpdtest.run(cmd="mpiexec%s -genvlist FOO,RMB : sh -c '/bin/echo $FOO $RMB'" % (PYEXT),
-                         expOut=expout,chkOut=1)
-        os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-        os.unlink(HFILE)
-        os.unsetenv('FOO')   # get rid of this for later tests
-        os.unsetenv('RMB')   # get rid of this for later tests
-
-
-if 1 in testsToRun[2000:3000]:
-    print "MPI tests-------------------------------------------"
-    if not MPI_srcdir:
-        print "    skipping all MPI tests because no MPI_srcidr is specified"
-        for i in range(2000,3000): testsToRun[i] = 0
-
-if testsToRun[2000]:
-    print "TEST cpi"
-    NMPDS = 1
-    if not os.access("%s/examples/cpi" % (MPI_srcdir),os.R_OK):  
-        os.system("cd %s/examples ; make cpi" % (MPI_srcdir) )
-    mpdtest = MPDTest()
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-    os.system("mpdboot%s -n %d" % (PYEXT,NMPDS) )
-    expout = ['Process 0 of 3','Process 1 of 3','Process 2 of 3']
-    rv = mpdtest.run(cmd="mpiexec%s -n 3 %s/examples/cpi" % (PYEXT,MPI_srcdir),
-                     grepOut=1, expOut=expout )
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-if testsToRun[2001]:
-    print "TEST spawn1"
-    NMPDS = 1
-    mpdtest = MPDTest()
-    if not os.access("%s/test/mpi/spawn/spawn1" % (MPI_srcdir),os.R_OK):  
-        os.system("cd %s/test/util ; make" % (MPI_srcdir) )
-        os.system("cd %s/test/mpi/spawn ; make spawn1" % (MPI_srcdir) )
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-    os.system("mpdboot%s -n %d" % (PYEXT,NMPDS) )
-    expout = ['No Errors']
-    os.system('cp %s/test/mpi/spawn/spawn1 .' % (MPI_srcdir))
-    rv = mpdtest.run(cmd="mpiexec%s -n 1 ./spawn1" % (PYEXT),  # -n 1
-                     grepOut=1, expOut=expout )
-    os.system('rm -f spawn1')
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-if testsToRun[2002]:
-    print "TEST spawn2"
-    NMPDS = 1
-    mpdtest = MPDTest()
-    if not os.access("%s/test/mpi/spawn/spawn2" % (MPI_srcdir),os.R_OK):  
-        os.system("cd %s/test/util ; make" % (MPI_srcdir) )
-        os.system("cd %s/test/mpi/spawn ; make spawn2" % (MPI_srcdir) )
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-    os.system("mpdboot%s -n %d" % (PYEXT,NMPDS) )
-    os.system('cp %s/test/mpi/spawn/spawn2 .' % (MPI_srcdir))
-    expout = ['No Errors']
-    rv = mpdtest.run(cmd="mpiexec%s -n 1 ./spawn2" % (PYEXT),  # -n 1
-                     grepOut=1, expOut=expout )
-    os.system('rm -f spawn2')
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-if testsToRun[2003]:
-    print "TEST spawnmult2"
-    NMPDS = 1
-    mpdtest = MPDTest()
-    if not os.access("%s/test/mpi/spawn/spawnmult2" % (MPI_srcdir),os.R_OK):  
-        os.system("cd %s/test/util ; make" % (MPI_srcdir) )
-        os.system("cd %s/test/mpi/spawn ; make spawnmult2" % (MPI_srcdir) )
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-    os.system("mpdboot%s -n %d" % (PYEXT,NMPDS) )
-    os.system('cp %s/test/mpi/spawn/spawnmult2 .' % (MPI_srcdir))
-    expout = ['No Errors']
-    rv = mpdtest.run(cmd="mpiexec%s -n 2 ./spawnmult2" % (PYEXT),  # -n 2
-                     grepOut=1, expOut=expout )
-    os.system('rm -f spawnmult2')
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-    
-if testsToRun[2004]:
-    print "TEST spawnargv"
-    NMPDS = 1
-    mpdtest = MPDTest()
-    if not os.access("%s/test/mpi/spawn/spawnargv" % (MPI_srcdir),os.R_OK):  
-        os.system("cd %s/test/util ; make" % (MPI_srcdir) )
-        os.system("cd %s/test/mpi/spawn ; make spawnargv" % (MPI_srcdir) )
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-    os.system("mpdboot%s -n %d" % (PYEXT,NMPDS) )
-    os.system('cp %s/test/mpi/spawn/spawnargv .' % (MPI_srcdir))
-    expout = ['No Errors']
-    rv = mpdtest.run(cmd="mpiexec%s -n 1 ./spawnargv" % (PYEXT),  # -n 2
-                     grepOut=1, expOut=expout )
-    os.system('rm -f spawnargv')
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-if testsToRun[2005]:
-    print "TEST spawnintra"
-    NMPDS = 1
-    mpdtest = MPDTest()
-    if not os.access("%s/test/mpi/spawn/spawnintra" % (MPI_srcdir),os.R_OK):  
-        os.system("cd %s/test/util ; make" % (MPI_srcdir) )
-        os.system("cd %s/test/mpi/spawn ; make spawnintra" % (MPI_srcdir) )
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-    os.system("mpdboot%s -n %d" % (PYEXT,NMPDS) )
-    os.system('cp %s/test/mpi/spawn/spawnintra .' % (MPI_srcdir))
-    expout = ['No Errors']
-    rv = mpdtest.run(cmd="mpiexec%s -n 1 ./spawnintra" % (PYEXT),  # -n 2
-                     grepOut=1, expOut=expout )
-    os.system('rm -f spawnintra')
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-    
-if testsToRun[2006]:
-    print "TEST namepub"
-    NMPDS = 1
-    mpdtest = MPDTest()
-    if not os.access("%s/test/mpi/spawn/namepub" % (MPI_srcdir),os.R_OK):  
-        os.system("cd %s/test/util ; make" % (MPI_srcdir) )
-        os.system("cd %s/test/mpi/spawn ; make namepub" % (MPI_srcdir) )
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-    os.system("mpdboot%s -n %d" % (PYEXT,NMPDS) )
-    expout = ['No Errors']
-    os.system('cp %s/test/mpi/spawn/namepub .' % (MPI_srcdir))
-    rv = mpdtest.run(cmd="mpiexec%s -n 1 ./namepub" % (PYEXT),  # -n 2
-                     grepOut=1, expOut=expout )
-    os.system('rm -f namepub')
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-    
-if testsToRun[2007]:
-    print "TEST concurrent_spawns"
-    NMPDS = 1
-    mpdtest = MPDTest()
-    if not os.access("%s/test/mpi/spawn/concurrent_spawns" % (MPI_srcdir),os.R_OK):  
-        os.system("cd %s/test/util ; make" % (MPI_srcdir) )
-        os.system("cd %s/test/mpi/spawn ; make concurrent_spawns" % (MPI_srcdir) )
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-    os.system("mpdboot%s -n %d" % (PYEXT,NMPDS) )
-    expout = ['No Errors']
-    os.system('cp %s/test/mpi/spawn/concurrent_spawns .' % (MPI_srcdir))
-    rv = mpdtest.run(cmd="mpiexec%s -n 1 ./concurrent_spawns" % (PYEXT),  # -n 2
-                     grepOut=1, expOut=expout )
-    os.system('rm -f concurrent_spawns')
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-if testsToRun[2008]:
-    print "TEST singleton init (cpi)"
-    NMPDS = 1
-    mpdtest = MPDTest()
-    if not os.access("%s/examples/cpi" % (MPI_srcdir),os.R_OK):  
-        os.system("cd %s/examples ; make cpi" % (MPI_srcdir) )
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-    os.system("mpdboot%s -n %d" % (PYEXT,NMPDS) )
-    expout = ['Process 0 of 1','pi is approximately 3']
-    rv = mpdtest.run(cmd="%s/examples/cpi" % (MPI_srcdir), grepOut=1, expOut=expout )
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-if testsToRun[2009]:
-    print "TEST bnr (mpich1-compat using cpi)"
-    if not MPI_1_dir:
-        print "    skipping; no mpich1 dir specified"
-    else:
-        NMPDS = 1
-        mpdtest = MPDTest()
-        if not os.access("%s/examples/cpi" % (MPI_srcdir),os.R_OK):  
-            os.system("cd %s/examples ; make cpi" % (MPI_srcdir) )
-            os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-            os.system("mpdboot%s -n %d" % (PYEXT,NMPDS) )
-            expout = ['Process 0 on','Process 1 on','Process 2 on','pi is approximately 3']
-            rv = mpdtest.run(cmd="mpiexec%s -bnr -n 3 %s/examples/cpi" % (PYEXT,MPI_1_dir),
-                             grepOut=1, expOut=expout )
-            os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-
-if 1 in testsToRun[3000:4000]:
-    print "console pgm tests---------------------------------------------------"
-
-if testsToRun[3000]:
-    print "TEST mpdtrace"
-    NMPDS = 3
-    if NMPDS > len(clusterHosts)+1:
-        print "    skipping; too few hosts"
-    else:
-        mpdtest = MPDTest()
-        os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-        temph = open(HFILE,'w')
-        for host in clusterHosts: print >>temph, host
-        temph.close()
-        os.system("mpdboot%s -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-        expout = ['%s' % (socket.gethostname()),
-                  '%s' % (clusterHosts[0]),
-                  '%s' % (clusterHosts[1])]
-        rv = mpdtest.run(cmd="mpdtrace%s -l" % (PYEXT), grepOut=1, expOut=expout )
-        os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-        os.unlink(HFILE)
-
-if testsToRun[3001]:
-    print "TEST mpdringtest"
-    NMPDS = 3
-    if NMPDS > len(clusterHosts)+1:
-        print "    skipping; too few hosts"
-    else:
-        mpdtest = MPDTest()
-        os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-        temph = open(HFILE,'w')
-        for host in clusterHosts: print >>temph, host
-        temph.close()
-        os.system("mpdboot%s -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-        nLoops = 100
-        expout = ['time for %d loops' % (nLoops) ]
-        rv = mpdtest.run(cmd="mpdringtest%s %d" % (PYEXT,nLoops), grepOut=1, expOut=expout )
-        os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-        os.unlink(HFILE)
-
-if testsToRun[3002]:
-    print "TEST mpdexit"
-    NMPDS = 3
-    if NMPDS > len(clusterHosts)+1:
-        print "    skipping; too few hosts"
-    else:
-        mpdtest = MPDTest()
-        os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-        temph = open(HFILE,'w')
-        for host in clusterHosts: print >>temph, host
-        temph.close()
-        os.system("mpdboot%s -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
-        linesAsStr = commands.getoutput("mpdtrace%s -l" % (PYEXT) )
-        for line in linesAsStr.split('\n'):
-            if line.find(clusterHosts[0]) >= 0:
-                mpdid = line.split(' ')[0]  # strip off the (ifhn) stuff
-                break
-        else:
-            mpdid = ''
-        if mpdid:
-            rv = mpdtest.run(cmd="mpdexit%s %s" % (PYEXT,mpdid), chkOut=1 )
-        else:
-            print 'failed to find %s in mpdtrace for mpdexit' % (clusterHosts[0])
-            sys.exit(-1)
-        expout = ['%s' % (socket.gethostname()), '%s' % (clusterHosts[1])]
-        rv = mpdtest.run(cmd="mpdtrace%s -l" % (PYEXT),
-                         grepOut=1, expOut=expout )
-        os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-        os.unlink(HFILE)
-
-if testsToRun[3003]:
-    print "TEST mpdlistjobs and mpdkilljob"
-    NMPDS = 1
-    mpdtest = MPDTest()
-    if not os.access("%s/src/pm/mpd/infloop" % (MPI_srcdir),os.R_OK):  
-        os.system("cd %s/src/pm/mpd ; cc -o infloop infloop.c" % (MPI_srcdir) )
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-    os.system("mpdboot%s -n %d" % (PYEXT,NMPDS) )
-    if not os.access("./infloop",os.R_OK):  
-       os.system('cp %s/src/pm/mpd/infloop .' % (MPI_srcdir))
-    os.system("mpiexec%s -s all -a ralph -n 2 ./infloop -p &" % (PYEXT))  # -p => don't print
-    import time    ## give the mpiexec
-    time.sleep(2)  ##     time to get going
-    expout = ['ralph']
-    rv = mpdtest.run(cmd="mpdlistjobs%s" % (PYEXT), grepOut=1, expOut=expout )
-    rv = mpdtest.run(cmd="mpdkilljob%s -a ralph" % (PYEXT), chkOut=0 )
-    expout = ''
-    rv = mpdtest.run(cmd="mpdlistjobs%s" % (PYEXT), chkOut=1, expOut=expout )
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-    os.system("killall -q infloop")  ## just to be safe
-    os.system('rm -f infloop')
-    
-if testsToRun[3004]:
-    print "TEST mpdsigjob"
-    NMPDS = 1
-    mpdtest = MPDTest()
-    if not os.access("%s/src/pm/mpd/infloop" % (MPI_srcdir),os.R_OK):  
-        os.system("cd %s/src/pm/mpd ; cc -o infloop infloop.c" % (MPI_srcdir) )
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-    os.system("mpdboot%s -n %d" % (PYEXT,NMPDS) )
-    if not os.access("./infloop",os.R_OK):  
-        os.system('cp %s/src/pm/mpd/infloop .' % (MPI_srcdir))
-    os.system("mpiexec%s -s all -a ralph -n 2 ./infloop -p &" % (PYEXT))  # -p => don't print
-    import time    ## give the mpiexec
-    time.sleep(2)  ##     time to get going
-    expout = ['ralph']
-    rv = mpdtest.run(cmd="mpdlistjobs%s" % (PYEXT), grepOut=1, expOut=expout )
-    rv = mpdtest.run(cmd="mpdsigjob%s INT -a ralph -g" % (PYEXT), chkOut=0 )
-    expout = ''
-    rv = mpdtest.run(cmd="mpdlistjobs%s" % (PYEXT), chkOut=1, expOut=expout )
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-    os.system('rm -f infloop')
-    
-
-if 1 in testsToRun[8000:9000]:
-    print "misc tests---------------------------------------------------"
-
-if testsToRun[8000]:
-    print "TEST ^C to mpiexec"
-    NMPDS = 1
-    mpdtest = MPDTest()
-    if not os.access("%s/src/pm/mpd/infloop" % (MPI_srcdir),os.R_OK):  
-        os.system("cd %s/src/pm/mpd ; cc -o infloop infloop.c" % (MPI_srcdir) )
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-    os.system("mpdboot%s -n %d" % (PYEXT,NMPDS) )
-    if not os.access("./infloop",os.R_OK):  
-        os.system('cp %s/src/pm/mpd/infloop .' % (MPI_srcdir))
-    import popen2
-    runner = popen2.Popen4("mpiexec%s -n 2 ./infloop -p" % (PYEXT))  # -p => don't print
-    import time    ## give the mpiexec
-    time.sleep(2)  ##     time to get going
-    os.system("kill -INT %d" % (runner.pid) )  # simulate user ^C
-    expout = ''
-    rv = mpdtest.run(cmd="mpdlistjobs%s" % (PYEXT), chkOut=1, expOut=expout )
-    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-    os.system("killall -q infloop")  ## just to be safe
-    os.system('rm -f infloop')
-
-if testsToRun[8001]:
-    print "TEST re-knit a ring"
-    NMPDS = 3
-    if NMPDS > len(clusterHosts)+1:
-        print "    skipping; too few hosts"
-    else:
-        mpdtest = MPDTest()
-        os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-        import popen2, time
-        mpd1 = popen2.Popen4("mpd%s -l 12345" % (PYEXT))
-        time.sleep(2)
-        mpd2 = popen2.Popen4("mpd%s -n -h %s -p 12345" % (PYEXT,socket.gethostname()) )
-        mpd3 = popen2.Popen4("mpd%s -n -h %s -p 12345" % (PYEXT,socket.gethostname()) )
-        time.sleep(2)
-        rv = mpdtest.run(cmd="mpdtrace%s" % (PYEXT), chkOut=0 )
-        if len(rv['OUT']) != NMPDS:
-            print "a: unexpected number of lines of output from mpdtrace", rv['OUT']
-            sys.exit(-1)
-        hostname = socket.gethostname()
-        for line in rv['OUT']:
-            if line.find(hostname) < 0:
-                print "a: bad lines in output of mpdtrace", rv['OUT']
-                sys.exit(-1)
-        os.system("kill -9 %d" % (mpd3.pid) )
-        time.sleep(1)
-        rv = mpdtest.run(cmd="mpdtrace%s" % (PYEXT), chkOut=0 )
-        if len(rv['OUT']) != NMPDS-1:
-            print "b: unexpected number of lines of output from mpdtrace", rv['OUT']
-            sys.exit(-1)
-        hostname = socket.gethostname()
-        for line in rv['OUT']:
-            if line.find(hostname) < 0:
-                print "b: bad lines in output of mpdtrace", rv['OUT']
-                sys.exit(-1)
-        os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
-
-if testsToRun[8002]:
-    print "TEST installing mpd as user"
-    if not os.access("%s/src/pm/mpd/mpdroot" % (MPI_srcdir),os.X_OK):
-        os.system("cd %s/src/pm/mpd ; ./configure ; make")
-    os.system("cd %s/src/pm/mpd ; make prefix=%s install" % (MPI_srcdir,USER_INSTALL_DIR) )
-    print "TEST the mpd installed as user ; run mpdtrace as user"
-    NMPDS = 1
-    mpdtest = MPDTest()
-    os.system("%s/bin/mpdallexit%s 1> /dev/null 2> /dev/null" % (USER_INSTALL_DIR,PYEXT) )
-    os.system("%s/bin/mpdboot%s -n %d" % (USER_INSTALL_DIR,PYEXT,NMPDS) )
-    expout = ['%s' % (socket.gethostname())]
-    rv = mpdtest.run(cmd="%s/bin/mpdtrace%s -l" % (USER_INSTALL_DIR,PYEXT), grepOut=1, expOut=expout )
-    os.system("%s/bin/mpdallexit%s 1> /dev/null 2> /dev/null" % (USER_INSTALL_DIR,PYEXT) )
-
-
-if 1 in testsToRun[9000:10000]:
-    print "root tests---------------------------------------------------"
-    import popen2
-    runner = popen2.Popen4("sudo echo hello")
-    sout_serr = runner.fromchild
-    line = sout_serr.readline()
-    if line.find('hello') < 0:
-        print "    ** you do not have sudo capability; terminating\n"
-        sys.exit(-1)
-
-if testsToRun[9000]:
-    os.environ['MPD_CON_EXT'] = ""    # get rid of this for root testing
-    print "TEST installing mpd as root"
-    if not os.access("%s/src/pm/mpd/mpdroot" % (MPI_srcdir),os.X_OK):
-        os.system("cd %s/src/pm/mpd ; ./configure ; make")
-    os.system("cd %s/src/pm/mpd ; sudo make prefix=%s install" % (MPI_srcdir,ROOT_INSTALL_DIR) )
-    print "TEST mpd as root ; mpdtrace as user"
-    NMPDS = 1
-    mpdtest = MPDTest()
-    os.system("sudo %s/bin/mpdallexit%s 1> /dev/null 2> /dev/null" % (ROOT_INSTALL_DIR,PYEXT) )
-    os.system("sudo %s/bin/mpd%s -d" % (ROOT_INSTALL_DIR,PYEXT) )  # not using boot here
-    import time
-    time.sleep(2)
-    os.environ['MPD_USE_ROOT_MPD'] = '1'
-    # os.system("%s/bin/mpdtrace%s -l" % (ROOT_INSTALL_DIR,PYEXT))
-    expout = ['%s' % (socket.gethostname())]
-    rv = mpdtest.run(cmd="%s/bin/mpdtrace%s -l" % (ROOT_INSTALL_DIR,PYEXT), grepOut=1, expOut=expout )
-
-    print "TEST that user cannot remove files owned by root"
-    os.system("sudo touch /tmp/testroot")
-    expout = ['cannot remove']
-    rv = mpdtest.run(cmd="%s/bin/mpiexec%s -n 1 /bin/rm -f /tmp/testroot" % (ROOT_INSTALL_DIR,PYEXT),
-                     grepOut=1, expOut=expout )
-    os.system("sudo rm -f /tmp/testroot")
-    os.system("sudo %s/bin/mpdallexit%s 1> /dev/null 2> /dev/null" % (ROOT_INSTALL_DIR,PYEXT) )
diff --git a/src/pm/remshell/mpiexec.c b/src/pm/remshell/mpiexec.c
index 0bb5e3f..81593e3 100644
--- a/src/pm/remshell/mpiexec.c
+++ b/src/pm/remshell/mpiexec.c
@@ -55,8 +55,7 @@
 
   The singleton process (in a routine in simple_pmi.c) forks a process and
   execs mpiexe with these arguments, where port is the port to which 
-  mpiexec should connect, interfacename is the name of the network interface
-  (BUG: may not be correctly set as mpd currently ignores it), securitykey
+  mpiexec should connect, interfacename is the name of the network interface, securitykey
   is a place-holder for a key used by the singleton init process to verify
   that the process connecting on the port is the one that was intended, and
   pid is the pid of the singleton init process.
@@ -374,7 +373,6 @@ int myspawn( ProcessWorld *pWorld, void *data )
  * 1) Use an intermediate manager.  This would allow us to set up the
  *    environment as well:
  *    remshell-program remshell-args manager -port string
- *    One possibilty for the manager is the mpd manager
  * 2) Use the secure server (even the same one as in MPICH1); then 
  *    there is no remote shell command.
  * 
diff --git a/src/pm/subconfigure.m4 b/src/pm/subconfigure.m4
index b91944e..20e9c37 100644
--- a/src/pm/subconfigure.m4
+++ b/src/pm/subconfigure.m4
@@ -7,18 +7,14 @@ AC_DEFUN([PAC_SUBCFG_BODY_]PAC_SUBCFG_AUTO_SUFFIX,[
 
 dnl we handle the AM_CONDITIONAL for hydra to keep hydra buildable as a
 dnl standalone package
-dnl MPD is handled here because it is a real subdir with a custom Makefile and a
-dnl separate configure
 for pm_name in $pm_names ; do
     AS_CASE([$pm_name],
-            [hydra],[build_pm_hydra=yes],
-            [mpd],[build_pm_mpd=yes])
+            [hydra],[build_pm_hydra=yes])
 done
 
 # we handle these conditionals here in the BODY because they depend on logic in
 # the main portion of the top-level configure
 AM_CONDITIONAL([BUILD_PM_HYDRA],[test "x$build_pm_hydra" = "xyes"])
-AM_CONDITIONAL([BUILD_PM_MPD],[test "x$build_pm_mpd" = "xyes"])
 
 dnl AC_MSG_NOTICE([RUNNING CONFIGURE FOR PROCESS MANAGERS])
 # do nothing extra here for now
diff --git a/test/mpi/configure.ac b/test/mpi/configure.ac
index 10e61ee..2f99094 100644
--- a/test/mpi/configure.ac
+++ b/test/mpi/configure.ac
@@ -230,8 +230,8 @@ AC_ARG_WITH(pm,
                  valid values.  Multiple process managers may be specified as
                  long as they all use the same pmi interface by separating them
                  with colons.  The mpiexec for the first named process manager
-                 will be installed.  Example: "--with-pm=hydra:mpd:gforker"
-                 builds the three process managers hydra, mpd and gforker;
+                 will be installed.  Example: "--with-pm=hydra:gforker"
+                 builds the two process managers hydra and gforker;
                  only the mpiexec from hydra is installed into the bin
                  directory.]),,with_pm=default)
 
diff --git a/test/mpi/runtests.in b/test/mpi/runtests.in
index 9976d33..1659c8f 100644
--- a/test/mpi/runtests.in
+++ b/test/mpi/runtests.in
@@ -1006,8 +1006,6 @@ sub TestTimeout {
 	if (/[Tt]imeout/) { next; }
 	# Allow 'signaled with Interrupt' (see gforker mpiexec)
 	if (/signaled with Interrupt/) { next; }
-	# Allow 'job ending due to env var MPIEXEC_TIMEOUT' (mpd)
-	if (/job ending due to env var MPIEXEC_TIMEOUT/) { next; }
 	# Allow 'APPLICATION TIMED OUT' (hydra)
 	if (/\[mpiexec at .*\] APPLICATION TIMED OUT/) { last; }
 	# ANY output is an error (other than timeout) 

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

Summary of changes:
 CHANGES                          |    4 +
 README.vin                       |    7 -
 autogen.sh                       |    2 +-
 configure.ac                     |   23 +-
 doc/design/design.tex            |    2 +-
 doc/installguide/install.tex.vin |   12 +-
 doc/namepub/namepub.tex          |   37 +-
 doc/pmi/paper.tex                |   44 +-
 maint/checkbuilds.in             |   54 +--
 maint/createcoverage.in          |   51 +--
 maint/release.pl                 |    1 -
 maint/samplebuilds               |   25 -
 src/nameserv/Makefile.mk         |    1 -
 src/nameserv/mpd/Makefile.mk     |   14 -
 src/nameserv/mpd/mpd_nameserv.c  |  107 ---
 src/pm/Makefile.mk               |    6 -
 src/pm/gforker/mpiexec.c         |    3 +-
 src/pm/mpd/Makefile.am           |  205 -----
 src/pm/mpd/README                |  243 ------
 src/pm/mpd/Zeroconf.py           | 1577 ------------------------------------
 src/pm/mpd/autogen.sh            |    6 -
 src/pm/mpd/configure.ac          |  198 -----
 src/pm/mpd/edi2.xml              |   42 -
 src/pm/mpd/ex1.xml               |   19 -
 src/pm/mpd/ex2.xml               |   14 -
 src/pm/mpd/ex3.xml               |   23 -
 src/pm/mpd/exittest_nompi.c      |   14 -
 src/pm/mpd/infloop.c             |   27 -
 src/pm/mpd/install.sh            |   22 -
 src/pm/mpd/mpd.py                | 1647 -------------------------------------
 src/pm/mpd/mpdallexit.py         |   59 --
 src/pm/mpd/mpdboot.py            |  482 -----------
 src/pm/mpd/mpdcheck.py           |  583 --------------
 src/pm/mpd/mpdchkpyver.py        |   46 --
 src/pm/mpd/mpdcleanup.py         |  122 ---
 src/pm/mpd/mpdexit.py            |   78 --
 src/pm/mpd/mpdgdbdrv.py          |  232 ------
 src/pm/mpd/mpdhelp.py            |   34 -
 src/pm/mpd/mpdkilljob.py         |   88 --
 src/pm/mpd/mpdlib.py             | 1595 ------------------------------------
 src/pm/mpd/mpdlistjobs.py        |  159 ----
 src/pm/mpd/mpdman.py             | 1656 --------------------------------------
 src/pm/mpd/mpdringtest.py        |   75 --
 src/pm/mpd/mpdroot.c             |  104 ---
 src/pm/mpd/mpdroot.h             |   47 --
 src/pm/mpd/mpdsigjob.py          |  128 ---
 src/pm/mpd/mpdtrace.py           |   83 --
 src/pm/mpd/mpdwrapcli.py         |   25 -
 src/pm/mpd/mpichprereq           |   12 -
 src/pm/mpd/mpiexec.py            | 1449 ---------------------------------
 src/pm/mpd/mtv.c                 |  215 -----
 src/pm/mpd/mtv_setup.py          |   14 -
 src/pm/mpd/newboot.py            |  414 ----------
 src/pm/mpd/newkmpds.py           |  102 ---
 src/pm/mpd/pcp.c                 |  150 ----
 src/pm/mpd/pmitest.c             |  174 ----
 src/pm/mpd/proxy.c               |   31 -
 src/pm/mpd/setup_pm              |    3 -
 src/pm/mpd/sigcatcher.c          |   32 -
 src/pm/mpd/sleeploop.c           |   17 -
 src/pm/mpd/test/test1.py         |  158 ----
 src/pm/mpd/test/test2.py         |  441 ----------
 src/pm/mpd/test/test3.py         |  149 ----
 src/pm/mpd/test/test4.py         |  139 ----
 src/pm/mpd/test/test5.py         |  113 ---
 src/pm/mpd/test/testall.sh       |   17 -
 src/pm/mpd/test/testroot.py      |   65 --
 src/pm/mpd/test/tests.py         |  898 ---------------------
 src/pm/remshell/mpiexec.c        |    4 +-
 src/pm/subconfigure.m4           |    6 +-
 test/mpi/configure.ac            |    4 +-
 test/mpi/runtests.in             |    2 -
 72 files changed, 33 insertions(+), 14602 deletions(-)
 delete mode 100644 src/nameserv/mpd/Makefile.mk
 delete mode 100644 src/nameserv/mpd/mpd_nameserv.c
 delete mode 100644 src/pm/mpd/Makefile.am
 delete mode 100644 src/pm/mpd/README
 delete mode 100755 src/pm/mpd/Zeroconf.py
 delete mode 100755 src/pm/mpd/autogen.sh
 delete mode 100644 src/pm/mpd/configure.ac
 delete mode 100644 src/pm/mpd/edi2.xml
 delete mode 100644 src/pm/mpd/ex1.xml
 delete mode 100644 src/pm/mpd/ex2.xml
 delete mode 100644 src/pm/mpd/ex3.xml
 delete mode 100644 src/pm/mpd/exittest_nompi.c
 delete mode 100644 src/pm/mpd/infloop.c
 delete mode 100755 src/pm/mpd/install.sh
 delete mode 100755 src/pm/mpd/mpd.py
 delete mode 100755 src/pm/mpd/mpdallexit.py
 delete mode 100755 src/pm/mpd/mpdboot.py
 delete mode 100755 src/pm/mpd/mpdcheck.py
 delete mode 100644 src/pm/mpd/mpdchkpyver.py
 delete mode 100755 src/pm/mpd/mpdcleanup.py
 delete mode 100755 src/pm/mpd/mpdexit.py
 delete mode 100755 src/pm/mpd/mpdgdbdrv.py
 delete mode 100755 src/pm/mpd/mpdhelp.py
 delete mode 100755 src/pm/mpd/mpdkilljob.py
 delete mode 100644 src/pm/mpd/mpdlib.py
 delete mode 100755 src/pm/mpd/mpdlistjobs.py
 delete mode 100644 src/pm/mpd/mpdman.py
 delete mode 100755 src/pm/mpd/mpdringtest.py
 delete mode 100644 src/pm/mpd/mpdroot.c
 delete mode 100644 src/pm/mpd/mpdroot.h
 delete mode 100755 src/pm/mpd/mpdsigjob.py
 delete mode 100755 src/pm/mpd/mpdtrace.py
 delete mode 100755 src/pm/mpd/mpdwrapcli.py
 delete mode 100755 src/pm/mpd/mpichprereq
 delete mode 100755 src/pm/mpd/mpiexec.py
 delete mode 100644 src/pm/mpd/mtv.c
 delete mode 100755 src/pm/mpd/mtv_setup.py
 delete mode 100755 src/pm/mpd/newboot.py
 delete mode 100755 src/pm/mpd/newkmpds.py
 delete mode 100644 src/pm/mpd/pcp.c
 delete mode 100644 src/pm/mpd/pmitest.c
 delete mode 100644 src/pm/mpd/proxy.c
 delete mode 100644 src/pm/mpd/setup_pm
 delete mode 100644 src/pm/mpd/sigcatcher.c
 delete mode 100644 src/pm/mpd/sleeploop.c
 delete mode 100755 src/pm/mpd/test/test1.py
 delete mode 100755 src/pm/mpd/test/test2.py
 delete mode 100755 src/pm/mpd/test/test3.py
 delete mode 100755 src/pm/mpd/test/test4.py
 delete mode 100755 src/pm/mpd/test/test5.py
 delete mode 100755 src/pm/mpd/test/testall.sh
 delete mode 100755 src/pm/mpd/test/testroot.py
 delete mode 100755 src/pm/mpd/test/tests.py


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list