From bbf7da16ffa09265b05eb39a782e3f2824b413d1 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Thu, 28 Jul 2005 13:00:32 +0000 Subject: [PATCH] Print a friendly message when the local exec can't find the orted. This commit was SVN r6643. --- orte/mca/pls/rsh/Makefile.am | 5 +++ orte/mca/pls/rsh/help-pls-rsh.txt | 30 ++++++++++++++++ orte/mca/pls/rsh/pls_rsh_module.c | 60 +++++++++++++++++++------------ 3 files changed, 72 insertions(+), 23 deletions(-) create mode 100644 orte/mca/pls/rsh/help-pls-rsh.txt diff --git a/orte/mca/pls/rsh/Makefile.am b/orte/mca/pls/rsh/Makefile.am index fb6333b59f..3d1b5697ed 100644 --- a/orte/mca/pls/rsh/Makefile.am +++ b/orte/mca/pls/rsh/Makefile.am @@ -18,6 +18,11 @@ include $(top_ompi_srcdir)/config/Makefile.options +EXTRA_DIST = $(pkgdata_DATA) +pkgdata_DATA = help-pls-rsh.txt + +AM_CPPFLAGS = -DOMPI_BINDIR="\"$(bindir)\"" + sources = \ pls_rsh.h \ pls_rsh_component.c \ diff --git a/orte/mca/pls/rsh/help-pls-rsh.txt b/orte/mca/pls/rsh/help-pls-rsh.txt new file mode 100644 index 0000000000..5c654cefe8 --- /dev/null +++ b/orte/mca/pls/rsh/help-pls-rsh.txt @@ -0,0 +1,30 @@ +# -*- text -*- +# +# Copyright (c) 2004-2005 The Trustees of Indiana University. +# All rights reserved. +# Copyright (c) 2004-2005 The Trustees of the University of Tennessee. +# 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$ +# +# This is the US/English general help file for Open RTE's orterun. +# +[no-local-orted] +The rsh PLS component was not able to find the executable "orted" in +your PATH or in the directory where Open MPI was initially installed, +and therefore cannot continue. + +For reference, your current PATH is: + + %s + +We also looked for orted in the following directory: + + %s diff --git a/orte/mca/pls/rsh/pls_rsh_module.c b/orte/mca/pls/rsh/pls_rsh_module.c index 806a0daa82..8e78c55a39 100644 --- a/orte/mca/pls/rsh/pls_rsh_module.c +++ b/orte/mca/pls/rsh/pls_rsh_module.c @@ -35,32 +35,31 @@ #include #include -#include "include/orte_constants.h" -#include "opal/util/argv.h" -#include "opal/util/opal_environ.h" -#include "opal/util/output.h" -#include "util/univ_info.h" -#include "util/session_dir.h" +#include "orte/include/orte_constants.h" +#include "orte/util/univ_info.h" +#include "orte/util/session_dir.h" +#include "orte/runtime/orte_wait.h" +#include "orte/mca/ns/ns.h" +#include "orte/mca/pls/pls.h" +#include "orte/mca/rml/rml.h" +#include "orte/mca/gpr/gpr.h" +#include "orte/mca/errmgr/errmgr.h" +#include "orte/mca/ras/base/ras_base_node.h" +#include "orte/mca/rmaps/base/rmaps_base_map.h" +#include "orte/mca/rmgr/base/base.h" +#include "orte/mca/soh/soh.h" +#include "orte/mca/soh/base/base.h" +#include "orte/mca/pls/rsh/pls_rsh.h" +#include "opal/mca/base/mca_base_param.h" +#include "opal/util/sys_info.h" +#include "opal/util/if.h" #include "opal/util/if.h" #include "opal/util/path.h" #include "opal/event/event.h" -#include "runtime/orte_wait.h" - -#include "mca/base/mca_base_param.h" - -#include "mca/ns/ns.h" -#include "util/sys_info.h" -#include "opal/util/if.h" -#include "mca/pls/pls.h" -#include "mca/rml/rml.h" -#include "mca/gpr/gpr.h" -#include "mca/errmgr/errmgr.h" -#include "mca/ras/base/ras_base_node.h" -#include "mca/rmaps/base/rmaps_base_map.h" -#include "mca/rmgr/base/base.h" -#include "mca/soh/soh.h" -#include "mca/soh/base/base.h" -#include "mca/pls/rsh/pls_rsh.h" +#include "opal/util/show_help.h" +#include "opal/util/argv.h" +#include "opal/util/opal_environ.h" +#include "opal/util/output.h" #define NUM_CONCURRENT 128 @@ -461,6 +460,21 @@ int orte_pls_rsh_launch(orte_jobid_t jobid) opal_ifislocal(node->node_name)) { exec_argv = &argv[local_exec_index]; exec_path = opal_path_findv(exec_argv[0], 0, environ, NULL); + + if (NULL == exec_path) { + struct stat buf; + + asprintf(&exec_path, "%s/orted", OMPI_BINDIR); + if (0 != stat(exec_path, &buf)) { + char *path = getenv("PATH"); + if (NULL == path) { + path = ("PATH is empty!"); + } + opal_show_help("help-pls-rsh.txt", "no-local-orted", + true, path, OMPI_BINDIR); + return ORTE_ERR_NOT_FOUND; + } + } } else { exec_argv = argv; exec_path = strdup(mca_pls_rsh_component.path);