From e8387fcf88cd47f8a22b67e60baad35c1a47f47f Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Mon, 20 Apr 2015 15:42:20 -0700 Subject: [PATCH] Protect tools that can never run in distributed mode from getting confused by PMI. --- orte/tools/orte-checkpoint/orte-checkpoint.c | 5 +++++ orte/tools/orte-migrate/orte-migrate.c | 5 +++++ orte/tools/orte-ps/orte-ps.c | 6 +++++- orte/tools/orte-restart/orte-restart.c | 8 ++++++-- orte/tools/orte-server/orte-server.c | 3 ++- orte/tools/orte-top/orte-top.c | 7 ++++++- 6 files changed, 29 insertions(+), 5 deletions(-) diff --git a/orte/tools/orte-checkpoint/orte-checkpoint.c b/orte/tools/orte-checkpoint/orte-checkpoint.c index 22c113b28f..db98b5ff12 100644 --- a/orte/tools/orte-checkpoint/orte-checkpoint.c +++ b/orte/tools/orte-checkpoint/orte-checkpoint.c @@ -12,6 +12,7 @@ * Copyright (c) 2007 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -603,6 +604,10 @@ static int ckpt_init(int argc, char *argv[]) { free(tmp_env_var); tmp_env_var = NULL; + /* we are never allowed to operate as a distributed tool, + * so insist on the ess/tool component */ + opal_setenv("OMPI_MCA_ess", "tool", true, &environ); + /*************************** * We need all of OPAL and the TOOLS portion of ORTE - this * sets us up so we can talk to any HNP over the wire diff --git a/orte/tools/orte-migrate/orte-migrate.c b/orte/tools/orte-migrate/orte-migrate.c index 3346af0b9c..654339f7c6 100644 --- a/orte/tools/orte-migrate/orte-migrate.c +++ b/orte/tools/orte-migrate/orte-migrate.c @@ -3,6 +3,7 @@ * University Research and Technology * Corporation. All rights reserved. * Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -464,6 +465,10 @@ static int tool_init(int argc, char *argv[]) { free(tmp_env_var); tmp_env_var = NULL; + /* we are never allowed to operate as a distributed tool, + * so insist on the ess/tool component */ + opal_setenv("OMPI_MCA_ess", "tool", true, &environ); + /*************************** * We need all of OPAL and the TOOLS portion of ORTE - this * sets us up so we can talk to any HNP over the wire diff --git a/orte/tools/orte-ps/orte-ps.c b/orte/tools/orte-ps/orte-ps.c index a9a6959e08..ca513bd850 100644 --- a/orte/tools/orte-ps/orte-ps.c +++ b/orte/tools/orte-ps/orte-ps.c @@ -14,7 +14,7 @@ * Copyright (c) 2007 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014 Intel, Inc. All rights reserved. + * Copyright (c) 2014-2015 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -422,6 +422,10 @@ static int orte_ps_init(int argc, char *argv[]) { free(tmp_env_var); #endif + /* we are never allowed to operate as a distributed tool, + * so insist on the ess/tool component */ + opal_setenv("OMPI_MCA_ess", "tool", true, &environ); + /*************************** * We need all of OPAL and the TOOL portion of ORTE ***************************/ diff --git a/orte/tools/orte-restart/orte-restart.c b/orte/tools/orte-restart/orte-restart.c index aec3ec4d21..7063e0c363 100644 --- a/orte/tools/orte-restart/orte-restart.c +++ b/orte/tools/orte-restart/orte-restart.c @@ -12,6 +12,7 @@ * Copyright (c) 2007 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -356,8 +357,11 @@ static int initialize(int argc, char *argv[]) { /* Don't free the environment variable name. It is used again below */ /* - * Setup any ORTE stuff we might need - */ + /* we are never allowed to operate as a distributed tool, + * so insist on the ess/tool component */ + opal_setenv("OMPI_MCA_ess", "tool", true, &environ); + + /* Setup any ORTE stuff we might need */ if (OPAL_SUCCESS != (ret = orte_init(&argc, &argv, ORTE_PROC_TOOL))) { exit_status = ret; goto cleanup; diff --git a/orte/tools/orte-server/orte-server.c b/orte/tools/orte-server/orte-server.c index 9aaedea1de..45d5c8e61e 100644 --- a/orte/tools/orte-server/orte-server.c +++ b/orte/tools/orte-server/orte-server.c @@ -11,7 +11,8 @@ * All rights reserved. * Copyright (c) 2007-2013 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2007-2013 Los Alamos National Security, LLC. All rights - * reserved. + * reserved. + * Copyright (c) 2015 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow diff --git a/orte/tools/orte-top/orte-top.c b/orte/tools/orte-top/orte-top.c index 9148656ac0..477903262d 100644 --- a/orte/tools/orte-top/orte-top.c +++ b/orte/tools/orte-top/orte-top.c @@ -11,7 +11,8 @@ * All rights reserved. * Copyright (c) 2007-2012 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2007-2013 Los Alamos National Security, LLC. All rights - * reserved. + * reserved. + * Copyright (c) 2015 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -259,6 +260,10 @@ main(int argc, char *argv[]) return 0; } + /* we are never allowed to operate as a distributed tool, + * so insist on the ess/tool component */ + opal_setenv("OMPI_MCA_ess", "tool", true, &environ); + /*************************** * We need all of OPAL and the TOOL portion of ORTE ***************************/