Changeset 4212

Show
Ignore:
Timestamp:
03/27/09 13:02:56 (12 months ago)
Author:
balaji
Message:

Fixing yet another bug with the environment variable passing that got
introduced in r4190.

Reviewed by Jayesh.

Location:
mpich2/trunk/src/pm/hydra/launcher
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • mpich2/trunk/src/pm/hydra/launcher/mpiexec/utils.c

    r4191 r4212  
    3232HYD_Status HYD_LCHI_get_parameters(char **t_argv) 
    3333{ 
    34     int i; 
     34    int i, local_env_set; 
    3535    char **argv = t_argv, *tmp; 
    3636    char *env_name, *env_value, *str[4] = { NULL }, *progname = *argv; 
     
    311311        handle.prop = !strcmp(tmp, "all") ? HYD_ENV_PROP_ALL : HYD_ENV_PROP_NONE; 
    312312 
    313     /* If nothing is set for the global environment, set it to the default */ 
    314     if (handle.prop == HYD_ENV_PROP_UNSET) 
    315         handle.prop = HYD_ENV_PROP_ALL; 
    316  
    317313    /* Make sure local executable is set */ 
     314    local_env_set = 0; 
    318315    for (exec_info = handle.exec_info_list; exec_info; exec_info = exec_info->next) { 
    319316        if (exec_info->exec[0] == NULL) 
     
    322319        if (exec_info->exec_proc_count == 0) 
    323320            exec_info->exec_proc_count = 1; 
     321 
     322        if (exec_info->prop != HYD_ENV_PROP_UNSET) 
     323            local_env_set = 1; 
    324324    } 
     325 
     326    /* If no global or local environment is set, use the default */ 
     327    if ((handle.prop == HYD_ENV_PROP_UNSET) && (local_env_set == 0)) 
     328        handle.prop = HYD_ENV_PROP_ALL; 
    325329 
    326330    if (handle.proxy_port == -1) 
  • mpich2/trunk/src/pm/hydra/launcher/utils/lchu.c

    r4191 r4212  
    128128                HYDU_ERR_POP(status, "unable to add env to list\n"); 
    129129            } 
     130        } 
     131    } 
     132    else if (handle.prop == HYD_ENV_PROP_UNSET) { 
     133        for (env = handle.user_env; env; env = env->next) { 
     134            status = HYDU_append_env_to_list(*env, &handle.prop_env); 
     135            HYDU_ERR_POP(status, "unable to add env to list\n"); 
    130136        } 
    131137    } 
     
    153159                    HYDU_ERR_POP(status, "unable to add env to list\n"); 
    154160                } 
     161            } 
     162        } 
     163        else if (exec_info->prop == HYD_ENV_PROP_UNSET) { 
     164            for (env = exec_info->user_env; env; env = env->next) { 
     165                status = HYDU_append_env_to_list(*env, &exec_info->prop_env); 
     166                HYDU_ERR_POP(status, "unable to add env to list\n"); 
    155167            } 
    156168        }