[mpich2-commits] r4212 - in mpich2/trunk/src/pm/hydra/launcher: mpiexec utils

balaji at mcs.anl.gov balaji at mcs.anl.gov
Fri Mar 27 13:02:56 CDT 2009


Author: balaji
Date: 2009-03-27 13:02:56 -0500 (Fri, 27 Mar 2009)
New Revision: 4212

Modified:
   mpich2/trunk/src/pm/hydra/launcher/mpiexec/utils.c
   mpich2/trunk/src/pm/hydra/launcher/utils/lchu.c
Log:
Fixing yet another bug with the environment variable passing that got
introduced in r4190.

Reviewed by Jayesh.


Modified: mpich2/trunk/src/pm/hydra/launcher/mpiexec/utils.c
===================================================================
--- mpich2/trunk/src/pm/hydra/launcher/mpiexec/utils.c	2009-03-27 06:12:37 UTC (rev 4211)
+++ mpich2/trunk/src/pm/hydra/launcher/mpiexec/utils.c	2009-03-27 18:02:56 UTC (rev 4212)
@@ -31,7 +31,7 @@
 
 HYD_Status HYD_LCHI_get_parameters(char **t_argv)
 {
-    int i;
+    int i, local_env_set;
     char **argv = t_argv, *tmp;
     char *env_name, *env_value, *str[4] = { NULL }, *progname = *argv;
     HYD_Env_t *env;
@@ -310,19 +310,23 @@
     if (handle.prop == HYD_ENV_PROP_UNSET && tmp)
         handle.prop = !strcmp(tmp, "all") ? HYD_ENV_PROP_ALL : HYD_ENV_PROP_NONE;
 
-    /* If nothing is set for the global environment, set it to the default */
-    if (handle.prop == HYD_ENV_PROP_UNSET)
-        handle.prop = HYD_ENV_PROP_ALL;
-
     /* Make sure local executable is set */
+    local_env_set = 0;
     for (exec_info = handle.exec_info_list; exec_info; exec_info = exec_info->next) {
         if (exec_info->exec[0] == NULL)
             HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR, "no executable specified\n");
 
         if (exec_info->exec_proc_count == 0)
             exec_info->exec_proc_count = 1;
+
+        if (exec_info->prop != HYD_ENV_PROP_UNSET)
+            local_env_set = 1;
     }
 
+    /* If no global or local environment is set, use the default */
+    if ((handle.prop == HYD_ENV_PROP_UNSET) && (local_env_set == 0))
+        handle.prop = HYD_ENV_PROP_ALL;
+
     if (handle.proxy_port == -1)
         handle.proxy_port = HYD_DEFAULT_PROXY_PORT;
 

Modified: mpich2/trunk/src/pm/hydra/launcher/utils/lchu.c
===================================================================
--- mpich2/trunk/src/pm/hydra/launcher/utils/lchu.c	2009-03-27 06:12:37 UTC (rev 4211)
+++ mpich2/trunk/src/pm/hydra/launcher/utils/lchu.c	2009-03-27 18:02:56 UTC (rev 4212)
@@ -129,6 +129,12 @@
             }
         }
     }
+    else if (handle.prop == HYD_ENV_PROP_UNSET) {
+        for (env = handle.user_env; env; env = env->next) {
+            status = HYDU_append_env_to_list(*env, &handle.prop_env);
+            HYDU_ERR_POP(status, "unable to add env to list\n");
+        }
+    }
 
     exec_info = handle.exec_info_list;
     while (exec_info) {
@@ -154,6 +160,12 @@
                 }
             }
         }
+        else if (exec_info->prop == HYD_ENV_PROP_UNSET) {
+            for (env = exec_info->user_env; env; env = env->next) {
+                status = HYDU_append_env_to_list(*env, &exec_info->prop_env);
+                HYDU_ERR_POP(status, "unable to add env to list\n");
+            }
+        }
         exec_info = exec_info->next;
     }
 



More information about the mpich2-commits mailing list