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

balaji at mcs.anl.gov balaji at mcs.anl.gov
Mon Mar 23 18:54:51 CDT 2009


Author: balaji
Date: 2009-03-23 18:54:51 -0500 (Mon, 23 Mar 2009)
New Revision: 4173

Modified:
   mpich2/trunk/src/pm/hydra/README
   mpich2/trunk/src/pm/hydra/launcher/mpiexec/utils.c
Log:
Allow some more features to be controlled through the environment.


Modified: mpich2/trunk/src/pm/hydra/README
===================================================================
--- mpich2/trunk/src/pm/hydra/README	2009-03-23 09:29:01 UTC (rev 4172)
+++ mpich2/trunk/src/pm/hydra/README	2009-03-23 23:54:51 UTC (rev 4173)
@@ -69,6 +69,13 @@
     setenv HYDRA_HOST_FILE <path_to_host_file>/hosts
 
 
+MPIEXEC_DEBUG: Setting this to "1" enables debug mode; set it to "0"
+to disable.
+
+HYDRA_ENV: Setting this to "all" will pass all the environment to the
+application processes.
+
+
 Bootstrap servers
 -----------------
 
@@ -179,7 +186,10 @@
 host-file based mappings. So, if a mapping is given at both places,
 the host-file mappings are ignored.
 
+Binding options can also be controlled with the environment variable
+HYDRA_BINDING.
 
+
 X Forwarding
 ------------
 

Modified: mpich2/trunk/src/pm/hydra/launcher/mpiexec/utils.c
===================================================================
--- mpich2/trunk/src/pm/hydra/launcher/mpiexec/utils.c	2009-03-23 09:29:01 UTC (rev 4172)
+++ mpich2/trunk/src/pm/hydra/launcher/mpiexec/utils.c	2009-03-23 23:54:51 UTC (rev 4173)
@@ -33,7 +33,7 @@
 HYD_Status HYD_LCHI_get_parameters(char **t_argv)
 {
     int i;
-    char **argv = t_argv;
+    char **argv = t_argv, *tmp;
     char *env_name, *env_value, *str[4] = { NULL }, *progname = *argv;
     HYD_Env_t *env;
     struct HYD_Exec_info *exec_info;
@@ -265,6 +265,9 @@
         continue;
     }
 
+    tmp = getenv("MPIEXEC_DEBUG");
+    if (handle.debug == -1 && tmp)
+        handle.debug = atoi(tmp) ? 1 : 0;
     if (handle.debug == -1)
         handle.debug = 0;
 
@@ -278,24 +281,37 @@
                                 "allocated space is too small for absolute path\n");
     }
 
-    if (handle.bootstrap == NULL && getenv("HYDRA_BOOTSTRAP"))
-        handle.bootstrap = MPIU_Strdup(getenv("HYDRA_BOOTSTRAP"));
+    tmp = getenv("HYDRA_BOOTSTRAP");
+    if (handle.bootstrap == NULL && tmp)
+        handle.bootstrap = MPIU_Strdup(tmp);
     if (handle.bootstrap == NULL)
         handle.bootstrap = MPIU_Strdup(HYDRA_DEFAULT_BSS);
 
-    if (handle.host_file == NULL && getenv("HYDRA_HOST_FILE"))
-        handle.host_file = MPIU_Strdup(getenv("HYDRA_HOST_FILE"));
+    tmp = getenv("HYDRA_HOST_FILE");
+    if (handle.host_file == NULL && tmp)
+        handle.host_file = MPIU_Strdup(tmp);
     if (handle.host_file == NULL)
         handle.host_file = MPIU_Strdup("HYDRA_USE_LOCALHOST");
 
     status = HYDU_get_base_path(progname, handle.wdir, &handle.base_path);
     HYDU_ERR_POP(status, "unable to get base path\n");
 
+    tmp = getenv("HYDRA_BINDING");
+    if (handle.binding == HYD_BIND_UNSET && tmp)
+        handle.binding = !strcmp(tmp, "none") ? HYD_BIND_NONE :
+            !strcmp(tmp, "rr") ? HYD_BIND_RR :
+            !strcmp(tmp, "buddy") ? HYD_BIND_BUDDY :
+            !strcmp(tmp, "pack") ? HYD_BIND_PACK :
+            HYD_BIND_USER;
     if (handle.binding == HYD_BIND_UNSET)
         handle.binding = HYD_BIND_NONE;
 
+    /* Global environment setting */
+    tmp = getenv("HYDRA_ENV");
+    if (handle.prop == HYD_ENV_PROP_UNSET && tmp)
+        handle.prop = !strcmp(tmp, "all") ? HYD_ENV_PROP_ALL : HYD_ENV_PROP_NONE;
     if (handle.prop == HYD_ENV_PROP_UNSET)
-        handle.prop = HYD_ENV_PROP_ALL;
+        handle.prop = HYD_ENV_PROP_NONE;
 
     /* Check if any individual app has an environment preference */
     for (exec_info = handle.exec_info_list; exec_info; exec_info = exec_info->next) {



More information about the mpich2-commits mailing list