[mpich2-commits] r4073 - in mpich2/trunk/src/pm/hydra: . include launcher/mpiexec

balaji at mcs.anl.gov balaji at mcs.anl.gov
Sat Mar 14 19:52:19 CDT 2009


Author: balaji
Date: 2009-03-14 19:52:19 -0500 (Sat, 14 Mar 2009)
New Revision: 4073

Modified:
   mpich2/trunk/src/pm/hydra/configure.in
   mpich2/trunk/src/pm/hydra/include/hydra_base.h
   mpich2/trunk/src/pm/hydra/launcher/mpiexec/mpiexec.c
   mpich2/trunk/src/pm/hydra/launcher/mpiexec/utils.c
Log:
Added support for mpiexec --version.

Modified: mpich2/trunk/src/pm/hydra/configure.in
===================================================================
--- mpich2/trunk/src/pm/hydra/configure.in	2009-03-14 23:24:19 UTC (rev 4072)
+++ mpich2/trunk/src/pm/hydra/configure.in	2009-03-15 00:52:19 UTC (rev 4073)
@@ -69,6 +69,7 @@
 AC_MSG_CHECKING(boot-strap server)
 AC_MSG_RESULT($hydra_bss)
 hydra_bss_names="`echo $hydra_bss | sed -e 's/:/ /g' -e 's/,/ /g'`"
+AC_DEFINE_UNQUOTED(HYDRA_BSS_NAMES,"$hydra_bss_names",[Definition of enabled bootstrap servers])
 AC_SUBST(hydra_bss_names)
 
 dnl Check what process manager we should use

Modified: mpich2/trunk/src/pm/hydra/include/hydra_base.h
===================================================================
--- mpich2/trunk/src/pm/hydra/include/hydra_base.h	2009-03-14 23:24:19 UTC (rev 4072)
+++ mpich2/trunk/src/pm/hydra/include/hydra_base.h	2009-03-15 00:52:19 UTC (rev 4073)
@@ -60,6 +60,7 @@
 
 typedef enum {
     HYD_SUCCESS = 0,
+    HYD_GRACEFUL_ABORT,
     HYD_NO_MEM,
     HYD_SOCK_ERROR,
     HYD_INVALID_PARAM,

Modified: mpich2/trunk/src/pm/hydra/launcher/mpiexec/mpiexec.c
===================================================================
--- mpich2/trunk/src/pm/hydra/launcher/mpiexec/mpiexec.c	2009-03-14 23:24:19 UTC (rev 4072)
+++ mpich2/trunk/src/pm/hydra/launcher/mpiexec/mpiexec.c	2009-03-15 00:52:19 UTC (rev 4073)
@@ -54,9 +54,12 @@
     HYDU_FUNC_ENTER();
 
     status = HYD_LCHI_Get_parameters(argc, argv);
-    if (status != HYD_SUCCESS) {
+    if (status == HYD_GRACEFUL_ABORT) {
+        exit(0);
+    }
+    else if (status != HYD_SUCCESS) {
         usage();
-        exit(-1);
+        goto fn_fail;
     }
 
     if (handle.debug) {
@@ -130,7 +133,9 @@
 
   fn_exit:
     HYDU_FUNC_EXIT();
-    if (status != HYD_SUCCESS)
+    if (status == HYD_GRACEFUL_ABORT)
+        return 0;
+    else if (status != HYD_SUCCESS)
         return -1;
     else
         return exit_status;

Modified: mpich2/trunk/src/pm/hydra/launcher/mpiexec/utils.c
===================================================================
--- mpich2/trunk/src/pm/hydra/launcher/mpiexec/utils.c	2009-03-14 23:24:19 UTC (rev 4072)
+++ mpich2/trunk/src/pm/hydra/launcher/mpiexec/utils.c	2009-03-15 00:52:19 UTC (rev 4073)
@@ -8,6 +8,7 @@
 #include "hydra_utils.h"
 #include "mpiexec.h"
 #include "lchu.h"
+#include "mpi.h"
 
 #define HYDRA_MAX_PATH 4096
 
@@ -15,7 +16,7 @@
 
 #define CHECK_LOCAL_PARAM_START(start, status) \
     { \
-	if ((start)) {			 \
+	if ((start)) {                          \
 	    (status) = HYD_INTERNAL_ERROR;	\
 	    goto fn_fail; \
 	} \
@@ -91,6 +92,14 @@
 }
 
 
+static void show_version(void)
+{
+    printf("MPICH2 Version: %s\n", MPICH2_VERSION);
+    printf("Process Manager: HYDRA\n");
+    printf("Boot-strap servers available: %s\n", HYDRA_BSS_NAMES);
+}
+
+
 HYD_Status HYD_LCHI_Get_parameters(int t_argc, char **t_argv)
 {
     int argc = t_argc, i;
@@ -143,6 +152,20 @@
             continue;
         }
 
+        /* Version information */
+        if (!strcmp(*argv, "--version")) {
+            CHECK_LOCAL_PARAM_START(local_params_started, status);
+
+            /* Just show the version information and continue. This
+             * option can be used in conjunction with other
+             * options. */
+            show_version();
+            status = HYD_GRACEFUL_ABORT;
+            goto fn_fail;
+
+            continue;
+        }
+
         /* Check if X forwarding is explicitly set */
         if (!strcmp(*argv, "--enable-x") || !strcmp(*argv, "--disable-x")) {
             CHECK_LOCAL_PARAM_START(local_params_started, status);



More information about the mpich2-commits mailing list