diff -uprN ../pvfs2-orig/configure.in ./configure.in
--- ../pvfs2-orig/configure.in	2006-11-16 18:40:18.000000000 -0500
+++ ./configure.in	2006-12-28 10:04:52.000000000 -0500
@@ -697,6 +697,25 @@ fi
 AC_SUBST(GM_HOME)
 AC_SUBST(BUILD_GM)
 
+dnl configure options for MX install path
+MX_HOME=
+AC_ARG_WITH(mx,
+[  --with-mx=<dir>         Location of the MX installation (default no MX)],
+    if test -z "$withval" -o "$withval" = yes ; then
+	AC_MSG_ERROR([Option --with-mx requires the path to your MX tree.])
+    elif test "$withval" != no ; then
+	MX_HOME="$withval"
+    fi
+)
+if test -n "$MX_HOME" ; then
+    CPPFLAGS="$CPPFLAGS -I ${MX_HOME}/include"
+    AC_CHECK_HEADER(myriexpress.h,, AC_MSG_ERROR([Header myriexpress.h not found.]))
+    BUILD_MX=1
+    CPPFLAGS="$CPPFLAGS_OLD"
+fi
+AC_SUBST(MX_HOME)
+AC_SUBST(BUILD_MX)
+
 dnl Configure options for IB install path.
 dnl --with-ib=<dir> is shorthand for
 dnl    --with-ib-includes=<dir>/include
@@ -1027,6 +1046,7 @@ src/common/statecomp/module.mk
 src/io/bmi/module.mk
 src/io/bmi/bmi_tcp/module.mk
 src/io/bmi/bmi_gm/module.mk
+src/io/bmi/bmi_mx/module.mk
 src/io/bmi/bmi_ib/module.mk
 src/io/description/module.mk
 src/io/flow/module.mk
diff -uprN ../pvfs2-orig/include/pvfs2-debug.h ./include/pvfs2-debug.h
--- ../pvfs2-orig/include/pvfs2-debug.h	2006-12-06 11:06:08.000000000 -0500
+++ ./include/pvfs2-debug.h	2006-12-28 10:07:06.000000000 -0500
@@ -69,6 +69,7 @@
 #define GOSSIP_DBPF_COALESCE_DEBUG     ((uint64_t)1 << 47)
 #define GOSSIP_ACCESS_HOSTNAMES        ((uint64_t)1 << 48)
 #define GOSSIP_FSCK_DEBUG              ((uint64_t)1 << 49)
+#define GOSSIP_BMI_DEBUG_MX            ((uint64_t)1 << 50)
 
 /* NOTE: if you want your gossip flag to be controllable from 
  * pvfs2-set-debugmask you have to add it in
@@ -77,7 +78,8 @@
 
 #define GOSSIP_BMI_DEBUG_ALL (uint64_t)                               \
 (GOSSIP_BMI_DEBUG_TCP + GOSSIP_BMI_DEBUG_CONTROL +                    \
- GOSSIP_BMI_DEBUG_GM + GOSSIP_BMI_DEBUG_OFFSETS + GOSSIP_BMI_DEBUG_IB)
+ GOSSIP_BMI_DEBUG_GM + GOSSIP_BMI_DEBUG_OFFSETS + GOSSIP_BMI_DEBUG_IB \
+ + GOSSIP_BMI_DEBUG_MX)
 
 uint64_t PVFS_debug_eventlog_to_mask(
     const char *event_logging);
diff -uprN ../pvfs2-orig/Makefile.in ./Makefile.in
--- ../pvfs2-orig/Makefile.in	2006-12-19 15:34:58.000000000 -0500
+++ ./Makefile.in	2006-12-28 10:09:12.000000000 -0500
@@ -64,6 +64,7 @@ INSTALL = @INSTALL@
 BISON = bison
 FLEX = flex
 BUILD_GM = @BUILD_GM@
+BUILD_MX = @BUILD_MX@
 BUILD_IB = @BUILD_IB@
 BUILD_OPENIB = @BUILD_OPENIB@
 BUILD_VIS = @BUILD_VIS@
@@ -294,6 +295,22 @@ ifdef BUILD_GM
 	SERVERLIBS += -lgm
 endif
 
+################################################################
+# enable MX if configure detected it
+
+ifdef BUILD_MX
+	CFLAGS += -I @MX_HOME@/include
+	CFLAGS += -D__STATIC_METHOD_BMI_MX__
+	# TODO: later on we will want the ability to modify this at configure
+	# time
+	CFLAGS += -g -O0
+	LDFLAGS += -L @MX_HOME@/lib
+	SERVER_LDFLAGS += -L @MX_HOME@/lib
+	LIBS += -lmyriexpress -lpthread
+	LIBS_THREADED += -lmyriexpress -lpthread
+	SERVERLIBS += -lmyriexpress -lpthread
+endif
+
 #####################################
 # enable IB if configure requested it
 
diff -uprN ../pvfs2-orig/pre-bmi_mx.patch ./pre-bmi_mx.patch
--- ../pvfs2-orig/pre-bmi_mx.patch	1969-12-31 19:00:00.000000000 -0500
+++ ./pre-bmi_mx.patch	2006-12-28 10:22:11.000000000 -0500
@@ -0,0 +1,92 @@
+diff -uprN ../pvfs2-orig/configure.in ./configure.in
+--- ../pvfs2-orig/configure.in	2006-11-16 18:40:18.000000000 -0500
++++ ./configure.in	2006-12-28 10:04:52.000000000 -0500
+@@ -697,6 +697,25 @@ fi
+ AC_SUBST(GM_HOME)
+ AC_SUBST(BUILD_GM)
+ 
++dnl configure options for MX install path
++MX_HOME=
++AC_ARG_WITH(mx,
++[  --with-mx=<dir>         Location of the MX installation (default no MX)],
++    if test -z "$withval" -o "$withval" = yes ; then
++	AC_MSG_ERROR([Option --with-mx requires the path to your MX tree.])
++    elif test "$withval" != no ; then
++	MX_HOME="$withval"
++    fi
++)
++if test -n "$MX_HOME" ; then
++    CPPFLAGS="$CPPFLAGS -I ${MX_HOME}/include"
++    AC_CHECK_HEADER(myriexpress.h,, AC_MSG_ERROR([Header myriexpress.h not found.]))
++    BUILD_MX=1
++    CPPFLAGS="$CPPFLAGS_OLD"
++fi
++AC_SUBST(MX_HOME)
++AC_SUBST(BUILD_MX)
++
+ dnl Configure options for IB install path.
+ dnl --with-ib=<dir> is shorthand for
+ dnl    --with-ib-includes=<dir>/include
+@@ -1027,6 +1046,7 @@ src/common/statecomp/module.mk
+ src/io/bmi/module.mk
+ src/io/bmi/bmi_tcp/module.mk
+ src/io/bmi/bmi_gm/module.mk
++src/io/bmi/bmi_mx/module.mk
+ src/io/bmi/bmi_ib/module.mk
+ src/io/description/module.mk
+ src/io/flow/module.mk
+diff -uprN ../pvfs2-orig/include/pvfs2-debug.h ./include/pvfs2-debug.h
+--- ../pvfs2-orig/include/pvfs2-debug.h	2006-12-06 11:06:08.000000000 -0500
++++ ./include/pvfs2-debug.h	2006-12-28 10:07:06.000000000 -0500
+@@ -69,6 +69,7 @@
+ #define GOSSIP_DBPF_COALESCE_DEBUG     ((uint64_t)1 << 47)
+ #define GOSSIP_ACCESS_HOSTNAMES        ((uint64_t)1 << 48)
+ #define GOSSIP_FSCK_DEBUG              ((uint64_t)1 << 49)
++#define GOSSIP_BMI_DEBUG_MX            ((uint64_t)1 << 50)
+ 
+ /* NOTE: if you want your gossip flag to be controllable from 
+  * pvfs2-set-debugmask you have to add it in
+@@ -77,7 +78,8 @@
+ 
+ #define GOSSIP_BMI_DEBUG_ALL (uint64_t)                               \
+ (GOSSIP_BMI_DEBUG_TCP + GOSSIP_BMI_DEBUG_CONTROL +                    \
+- GOSSIP_BMI_DEBUG_GM + GOSSIP_BMI_DEBUG_OFFSETS + GOSSIP_BMI_DEBUG_IB)
++ GOSSIP_BMI_DEBUG_GM + GOSSIP_BMI_DEBUG_OFFSETS + GOSSIP_BMI_DEBUG_IB \
++ + GOSSIP_BMI_DEBUG_MX)
+ 
+ uint64_t PVFS_debug_eventlog_to_mask(
+     const char *event_logging);
+diff -uprN ../pvfs2-orig/Makefile.in ./Makefile.in
+--- ../pvfs2-orig/Makefile.in	2006-12-19 15:34:58.000000000 -0500
++++ ./Makefile.in	2006-12-28 10:09:12.000000000 -0500
+@@ -64,6 +64,7 @@ INSTALL = @INSTALL@
+ BISON = bison
+ FLEX = flex
+ BUILD_GM = @BUILD_GM@
++BUILD_MX = @BUILD_MX@
+ BUILD_IB = @BUILD_IB@
+ BUILD_OPENIB = @BUILD_OPENIB@
+ BUILD_VIS = @BUILD_VIS@
+@@ -294,6 +295,22 @@ ifdef BUILD_GM
+ 	SERVERLIBS += -lgm
+ endif
+ 
++################################################################
++# enable MX if configure detected it
++
++ifdef BUILD_MX
++	CFLAGS += -I @MX_HOME@/include
++	CFLAGS += -D__STATIC_METHOD_BMI_MX__
++	# TODO: later on we will want the ability to modify this at configure
++	# time
++	CFLAGS += -g -O0
++	LDFLAGS += -L @MX_HOME@/lib
++	SERVER_LDFLAGS += -L @MX_HOME@/lib
++	LIBS += -lmyriexpress -lpthread
++	LIBS_THREADED += -lmyriexpress -lpthread
++	SERVERLIBS += -lmyriexpress -lpthread
++endif
++
+ #####################################
+ # enable IB if configure requested it
+ 
diff -uprN ../pvfs2-orig/src/apps/admin/pvfs2-genconfig ./src/apps/admin/pvfs2-genconfig
--- ../pvfs2-orig/src/apps/admin/pvfs2-genconfig	2006-12-19 16:30:32.000000000 -0500
+++ ./src/apps/admin/pvfs2-genconfig	2006-12-28 10:14:23.000000000 -0500
@@ -17,6 +17,7 @@ my $opt_protocol = '';
 my $opt_port = '';
 my $opt_tcpport = '';
 my $opt_gmport = '';
+my $opt_mxendpoint = '';
 my $opt_ibport = '';
 my $opt_ioservers = '';
 my $opt_metaservers = '';
@@ -379,7 +380,7 @@ sub specusage
   from the rest of the spec.  While the protocols and ports are different, the
   host for each uri must be the same.  For example:
 
-    --metaspec="[ib://myhosta:3335,gm://myhosta:6]:/psto,tcp://myhostb:3334"
+    --metaspec="[ib://myhosta:3335,gm://myhosta:6,mx://myhosta:0:3]:/psto,tcp://myhostb:3334"
 
   This specifies that one endpoint is at myhosta with the infiniband and myrinet
   protocols enabled, and the other endpoint is at myhostb with tcp enabled.
@@ -429,7 +430,7 @@ Usage: pvfs2-genconfig [OPTIONS] <fs.con
   One of the two [] grouped options below must be chosen (for non-interactive):
 
      [
-       --protocol    <PROTO>[,<PROTO>..] protocol(s) to use (tcp,gm,ib)
+       --protocol    <PROTO>[,<PROTO>..] protocol(s) to use (tcp,gm,mx,ib)
        --port        <NUM>      port to use (any single protocol)
        --ioservers   <STRING>   hostnames of data servers.  Can be 
                                 <prefix>{#-#,#,#-#,...}
@@ -446,6 +447,7 @@ Usage: pvfs2-genconfig [OPTIONS] <fs.con
 
      --tcpport     <NUM>               TCP port to use
      --gmport      <NUM>               GM port to use
+     --mxendpoint  <NUM>               MX endpoint to use (default is 3)
      --ibport      <NUM>               IB port to use
      --logging     <STRING>            debugging mask for log messages
      --logstamp    <STRING>            timestamp type for log messages 
@@ -531,7 +533,7 @@ sub get_protocol
             # get network type
             print $OUT <<"PROTOCOL"
 You must first select the network protocol that your file system will use.
-The only currently supported options are \"tcp\", \"gm\", and \"ib\".
+The only currently supported options are \"tcp\", \"gm\", \"mx\", and \"ib\".
 (For multi-homed configurations, use e.g. \"ib,tcp\".)
 PROTOCOL
             ;;
@@ -565,10 +567,12 @@ PROTOCOL
             }
         } elsif ($_ eq "gm") {
             $port{'gm'} = gm_get_port();
+        } elsif ($_ eq "mx") {
+            $port{'mx'} = mx_get_endpoint();
         } elsif ($_ eq "ib") {
             $port{'ib'} = ib_get_port();
         } else {
-            die "Sorry.  At this time, only the tcp, gm and ib protocols are available\nfor use with this configuration utility.\n";
+            die "Sorry.  At this time, only the tcp, gm, mx and ib protocols are available\nfor use with this configuration utility.\n";
         }
     }
 
@@ -744,6 +748,27 @@ sub gm_get_port
 
     return  $port;
 }
+sub mx_get_endpoint
+{
+    my $port;
+    if ($opt_mxendpoint) {
+        $port = $opt_mxendpoint;
+    } elsif ($opt_port) {
+        $port = $opt_port;
+        $opt_port = '';
+    } elsif (!$opt_iospec) {
+        if (!$opt_quiet) { 
+            print $OUT "Choose a MX endpoint (in the range of 0 to 7) for the servers to listen on. \n";
+            print $OUT "This script assumes that all servers will use the same port number.\n";
+        }
+        $port = prompt_num("Enter port number [Default is 3]: ","3");
+    }
+    # The number of endpoints in MX is configurable. The default value is 4 
+    # but may be changing to 8. It can be higher, but this is reasonable.
+    ($port < 8) or die "MX endpoint must be in the range 0 to 7";
+
+    return  $port;
+}
 sub ib_get_port
 {
     my $port;
@@ -1093,6 +1118,7 @@ GetOptions('protocol=s'    => \$opt_prot
     'port=i'        => \$opt_port,
     'tcpport=i'     => \$opt_tcpport,
     'gmport=i'      => \$opt_gmport,
+    'mxendpoint=i'  => \$opt_mxendpoint,
     'ibport=i'      => \$opt_ibport,
     'ioservers=s'   => \$opt_ioservers,
     'metaservers=s' => \$opt_metaservers,
diff -uprN ../pvfs2-orig/src/common/misc/server-config.c ./src/common/misc/server-config.c
--- ../pvfs2-orig/src/common/misc/server-config.c	2006-11-29 16:08:47.000000000 -0500
+++ ./src/common/misc/server-config.c	2006-12-28 10:16:14.000000000 -0500
@@ -221,6 +221,13 @@ static const configoption_t options[] =
      *
      * tcp://myhost.mydn:12345
      *
+     * while MX requires:
+     *
+     * mx://{hostname}:{board}:{endpoint}
+     *
+     * where {board} is the index of the NIC (if more than one, else 0)
+     * and {endpoint} is index of the endpoint.
+     *
      */
     {"HostID",ARG_STR, get_pvfs_server_id,NULL,CTX_GLOBAL,NULL},
     
@@ -585,6 +592,7 @@ static const configoption_t options[] =
      * bmi_tcp
      * bmi_ib
      * bmi_gm
+     * bmi_mx
      *
      * For example:
      *
diff -uprN ../pvfs2-orig/src/io/bmi/bmi.c ./src/io/bmi/bmi.c
--- ../pvfs2-orig/src/io/bmi/bmi.c	2006-12-09 11:28:24.000000000 -0500
+++ ./src/io/bmi/bmi.c	2006-12-28 10:10:17.000000000 -0500
@@ -48,6 +48,9 @@ extern struct bmi_method_ops bmi_tcp_ops
 #ifdef __STATIC_METHOD_BMI_GM__
 extern struct bmi_method_ops bmi_gm_ops;
 #endif
+#ifdef __STATIC_METHOD_BMI_MX__
+extern struct bmi_method_ops bmi_mx_ops;
+#endif
 #ifdef __STATIC_METHOD_BMI_IB__
 extern struct bmi_method_ops bmi_ib_ops;
 #endif
@@ -59,6 +62,9 @@ static struct bmi_method_ops *const stat
 #ifdef __STATIC_METHOD_BMI_GM__
     &bmi_gm_ops,
 #endif
+#ifdef __STATIC_METHOD_BMI_MX__
+    &bmi_mx_ops,
+#endif
 #ifdef __STATIC_METHOD_BMI_IB__
     &bmi_ib_ops,
 #endif
