From 7e5ef6a240e01d387bfde9095c2806bb653bd5bd Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Fri, 6 May 2016 15:38:39 -0700 Subject: [PATCH] Fix the env_list support - the MCA param was being set way too early, so provide a "backdoor" way of providing the value --- opal/mca/base/mca_base_var.c | 8 +++++--- opal/mca/base/mca_base_var.h | 3 ++- orte/mca/schizo/ompi/schizo_ompi.c | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/opal/mca/base/mca_base_var.c b/opal/mca/base/mca_base_var.c index 5817efc687..5ba235b172 100644 --- a/opal/mca/base/mca_base_var.c +++ b/opal/mca/base/mca_base_var.c @@ -13,7 +13,7 @@ * Copyright (c) 2008-2015 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2014 Intel, Inc. All rights reserved. + * Copyright (c) 2014-2016 Intel, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ @@ -366,7 +366,7 @@ static void process_env_list(char *env_list, char ***argv, char sep) opal_argv_free(tokens); } -int mca_base_var_process_env_list(char ***argv) +int mca_base_var_process_env_list(char *list, char ***argv) { char sep; sep = ';'; @@ -379,7 +379,9 @@ int mca_base_var_process_env_list(char ***argv) return OPAL_SUCCESS; } } - if (NULL != mca_base_env_list) { + if (NULL != list) { + process_env_list(list, argv, sep); + } else if (NULL != mca_base_env_list) { process_env_list(mca_base_env_list, argv, sep); } diff --git a/opal/mca/base/mca_base_var.h b/opal/mca/base/mca_base_var.h index 46b8a2ce76..efca95c3c0 100644 --- a/opal/mca/base/mca_base_var.h +++ b/opal/mca/base/mca_base_var.h @@ -13,6 +13,7 @@ * Copyright (c) 2008-2011 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights * reserved. + * Copyright (c) 2016 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -729,7 +730,7 @@ OPAL_DECLSPEC int mca_base_var_dump(int vari, char ***out, mca_base_var_dump_typ * Parse a provided list of envars and add their local value, or * their assigned value, to the provided argv */ -OPAL_DECLSPEC int mca_base_var_process_env_list(char ***argv); +OPAL_DECLSPEC int mca_base_var_process_env_list(char *list, char ***argv); OPAL_DECLSPEC int mca_base_var_process_env_list_from_file(char ***argv); END_C_DECLS diff --git a/orte/mca/schizo/ompi/schizo_ompi.c b/orte/mca/schizo/ompi/schizo_ompi.c index dfc3999908..02374ebd3a 100644 --- a/orte/mca/schizo/ompi/schizo_ompi.c +++ b/orte/mca/schizo/ompi/schizo_ompi.c @@ -688,7 +688,7 @@ static int parse_env(char *path, if (!set_from_file) { /* set necessary env variables for external usage */ vars = NULL; - if (OPAL_SUCCESS == mca_base_var_process_env_list(&vars) && + if (OPAL_SUCCESS == mca_base_var_process_env_list(env_set_flag, &vars) && NULL != vars) { for (i=0; NULL != vars[i]; i++) { value = strchr(vars[i], '=');