From 006be92df58d75335852b71ee194daaf70710274 Mon Sep 17 00:00:00 2001 From: Thomas Naughton Date: Fri, 24 Feb 2017 16:55:32 -0500 Subject: [PATCH] dvm: Add envvar 'ORTE_HNP_DVM_URI' to schizo:ompi Add ability to pass DVM URI purely via environment to simplify invocation from command-line (e.g., start dvm, export URI, mpirun w/o needing to add `--hnp` arg). If user passes both envvar *and* cmdline, the cmdline wins. Signed-off-by: Thomas Naughton --- orte/mca/schizo/ompi/schizo_ompi.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/orte/mca/schizo/ompi/schizo_ompi.c b/orte/mca/schizo/ompi/schizo_ompi.c index 4ceec68b6a..54ac57842c 100644 --- a/orte/mca/schizo/ompi/schizo_ompi.c +++ b/orte/mca/schizo/ompi/schizo_ompi.c @@ -12,7 +12,8 @@ * Copyright (c) 2006-2013 Los Alamos National Security, LLC. * All rights reserved. * Copyright (c) 2009-2016 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2011 Oak Ridge National Labs. All rights reserved. + * Copyright (c) 2011-2017 Oak Ridge National Labs. All rights reserved. + * Copyright (c) 2017 UT-Battelle, LLC. All rights reserved. * Copyright (c) 2013-2017 Intel, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. @@ -480,6 +481,15 @@ static int define_cli(opal_cmd_line_t *cli) } } + /* + * Check if a HNP DVM URI is being passed via environment. + * Note: Place before opal_cmd_line_parse() so that + * if user passes both envvar & cmdln, the cmdln wins. + */ + if (NULL != getenv("ORTE_HNP_DVM_URI")) { + orte_cmd_options.hnp = strdup(getenv("ORTE_HNP_DVM_URI")); + } + /* just add ours to the end */ rc = opal_cmd_line_add(cli, cmd_line_init); return rc;