1
1

Okay, this fixes the problem of MCA params spreading too far. Sorry for the multiple corrections.

This commit was SVN r12201.
Этот коммит содержится в:
Ralph Castain 2006-10-19 22:51:02 +00:00
родитель caefd6d0ee
Коммит ab196c3121
6 изменённых файлов: 101 добавлений и 16 удалений

Просмотреть файл

@ -24,6 +24,7 @@ libmca_odls_la_SOURCES += \
base/odls_base_close.c \ base/odls_base_close.c \
base/odls_base_open.c \ base/odls_base_open.c \
base/odls_base_select.c \ base/odls_base_select.c \
base/odls_base_support_fns.c \
base/data_type_support/odls_compare_fns.c \ base/data_type_support/odls_compare_fns.c \
base/data_type_support/odls_copy_fns.c \ base/data_type_support/odls_copy_fns.c \
base/data_type_support/odls_packing_fns.c \ base/data_type_support/odls_packing_fns.c \

61
orte/mca/odls/base/odls_base_support_fns.c Обычный файл
Просмотреть файл

@ -0,0 +1,61 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "orte_config.h"
#include "orte/orte_constants.h"
#include "opal/mca/base/mca_base_param.h"
#include "opal/util/opal_environ.h"
#include "orte/mca/odls/base/odls_private.h"
int orte_odls_base_purge_environment(char ***environ)
{
char *param;
if(NULL == (param = mca_base_param_environ_variable("rds",NULL,NULL))) {
return ORTE_ERR_OUT_OF_RESOURCE;
}
opal_unsetenv(param, environ);
free(param);
if(NULL == (param = mca_base_param_environ_variable("ras",NULL,NULL))) {
return ORTE_ERR_OUT_OF_RESOURCE;
}
opal_unsetenv(param, environ);
free(param);
if(NULL == (param = mca_base_param_environ_variable("rmaps",NULL,NULL))) {
return ORTE_ERR_OUT_OF_RESOURCE;
}
opal_unsetenv(param, environ);
free(param);
if(NULL == (param = mca_base_param_environ_variable("pls",NULL,NULL))) {
return ORTE_ERR_OUT_OF_RESOURCE;
}
opal_unsetenv(param, environ);
free(param);
if(NULL == (param = mca_base_param_environ_variable("rmgr",NULL,NULL))) {
return ORTE_ERR_OUT_OF_RESOURCE;
}
opal_unsetenv(param, environ);
free(param);
return ORTE_SUCCESS;
}

Просмотреть файл

@ -50,6 +50,8 @@ typedef struct orte_odls_globals_t {
ORTE_DECLSPEC extern orte_odls_globals_t orte_odls_globals; ORTE_DECLSPEC extern orte_odls_globals_t orte_odls_globals;
int orte_odls_base_purge_environment(char ***environ);
/* /*
* data type functions * data type functions
*/ */

Просмотреть файл

@ -532,11 +532,11 @@ static int odls_default_fork_local_proc(
environ_copy = opal_argv_copy(base_environ); environ_copy = opal_argv_copy(base_environ);
} }
/* purge any disallowed component directives */ /* purge any disallowed component directives */
opal_unsetenv("rds", &environ_copy); if (ORTE_SUCCESS != orte_odls_base_purge_environment(&environ_copy)) {
opal_unsetenv("ras", &environ_copy); /* Tell the parent that Badness happened */
opal_unsetenv("rmaps", &environ_copy); write(p[1], &i, sizeof(int));
opal_unsetenv("pls", &environ_copy); exit(-1);
opal_unsetenv("rmgr", &environ_copy); }
/* special case handling for --prefix: this is somewhat icky, /* special case handling for --prefix: this is somewhat icky,
but at least some users do this. :-\ It is possible that but at least some users do this. :-\ It is possible that

Просмотреть файл

@ -462,12 +462,12 @@ static int orte_odls_process_fork_local_proc(
environ_copy = opal_argv_copy(base_environ); environ_copy = opal_argv_copy(base_environ);
} }
/* purge any disallowed component directives */ /* purge any disallowed component directives */
opal_unsetenv("rds", &environ_copy); if (ORTE_SUCCESS != orte_odls_base_purge_environment(&environ_copy)) {
opal_unsetenv("ras", &environ_copy); /* Tell the parent that Badness happened */
opal_unsetenv("rmaps", &environ_copy); return ORTE_ERR_FATAL;
opal_unsetenv("pls", &environ_copy); }
opal_unsetenv("rmgr", &environ_copy);
/* special case handling for --prefix: this is somewhat icky, /* special case handling for --prefix: this is somewhat icky,
but at least some users do this. :-\ It is possible that but at least some users do this. :-\ It is possible that
when using --prefix, the user will also "-x PATH" and/or when using --prefix, the user will also "-x PATH" and/or

Просмотреть файл

@ -196,6 +196,7 @@ int main(int argc, char *argv[])
char *jobidstring; char *jobidstring;
orte_gpr_value_t *value; orte_gpr_value_t *value;
char *segment; char *segment;
char *param;
int i; int i;
/* initialize the globals */ /* initialize the globals */
@ -205,11 +206,31 @@ int main(int argc, char *argv[])
* specific components. We want to be free to select the proxy components, * specific components. We want to be free to select the proxy components,
* so we have to ensure that we aren't picking up directives intended for HNPs. * so we have to ensure that we aren't picking up directives intended for HNPs.
*/ */
opal_unsetenv("rds", &environ); if(NULL == (param = mca_base_param_environ_variable("rds",NULL,NULL))) {
opal_unsetenv("ras", &environ); return ORTE_ERR_OUT_OF_RESOURCE;
opal_unsetenv("rmaps", &environ); }
opal_unsetenv("pls", &environ); unsetenv(param);
opal_unsetenv("rmgr", &environ); free(param);
if(NULL == (param = mca_base_param_environ_variable("ras",NULL,NULL))) {
return ORTE_ERR_OUT_OF_RESOURCE;
}
unsetenv(param);
free(param);
if(NULL == (param = mca_base_param_environ_variable("rmaps",NULL,NULL))) {
return ORTE_ERR_OUT_OF_RESOURCE;
}
unsetenv(param);
free(param);
if(NULL == (param = mca_base_param_environ_variable("pls",NULL,NULL))) {
return ORTE_ERR_OUT_OF_RESOURCE;
}
unsetenv(param);
free(param);
if(NULL == (param = mca_base_param_environ_variable("rmgr",NULL,NULL))) {
return ORTE_ERR_OUT_OF_RESOURCE;
}
unsetenv(param);
free(param);
/* save the environment for use when launching application processes */ /* save the environment for use when launching application processes */
orted_globals.saved_environ = opal_argv_copy(environ); orted_globals.saved_environ = opal_argv_copy(environ);