Fixes trac:377
Add --enable-orterun-prefix-by-default (and a synonym: --enable-mpirun-prefix-by-default) to make orterun always behave as if "--prefix $prefix" was given on the command line (where $prefix is the value given to the --prefix option to configure). This prevents many rsh/ssh users from needing to modify their shell startup files to set the LD_LIBRARY_PATH for Open MPI (they will still need to set PATH or otherwise find the OMPI executables to mpicc/mpirun/etc. their MPI applications). Also added --noprefix option to orterun to disable this behavior. Finally, note that even if --enable-orterun-prefix-by-default is specified, if the user specifies --prefix or /path/to/mpirun, these options will override the default value of the prefix ($prefix). This commit was SVN r11669. The following Trac tickets were found above: Ticket 377 --> https://svn.open-mpi.org/trac/ompi/ticket/377
Этот коммит содержится в:
родитель
c62b671fba
Коммит
8226dab86c
3
NEWS
3
NEWS
@ -27,6 +27,9 @@ version 1.0.
|
||||
1.3
|
||||
---
|
||||
|
||||
- Add new --enable-mpirun-prefix-by-default configure option to always
|
||||
imply the --prefix option to mpirun, preventing many rsh/ssh-based
|
||||
users from needing to modify their shell startup files.
|
||||
- Addition of OpenIB-based unreliable datagram BTL ("ud").
|
||||
|
||||
|
||||
|
12
README
12
README
@ -395,6 +395,18 @@ for a full list); a summary of the more commonly used ones follows:
|
||||
generates these bindings at compile time with a maximum number of
|
||||
dimensions as specified by this parameter. The default value is 4.
|
||||
|
||||
--enable-mpirun-prefix-by-default
|
||||
This option forces the "mpirun" command to always behave as if
|
||||
"--prefix $prefix" was present on the command line (where $prefix is
|
||||
the value given to the --prefix option to configure). This prevents
|
||||
most rsh/ssh-based users from needing to modify their shell startup
|
||||
files to set the PATH and/or LD_LIBRARY_PATH for Open MPI on remote
|
||||
nodes. Note, however, that such users may still desire to set PATH
|
||||
-- perhaps even in their shell startup files -- so that executables
|
||||
such as mpicc and mpirun can be found without needing to type long
|
||||
path names. --enable-orterun-prefix-by-default is a synonym for
|
||||
this option.
|
||||
|
||||
--disable-shared
|
||||
By default, libmpi is built as a shared library, and all components
|
||||
are built as dynamic shared objects (DSOs). This switch disables
|
||||
|
@ -515,4 +515,28 @@ else
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED([OPAL_ENABLE_IPV6], [$opal_want_ipv6],
|
||||
[Enable IPv6 support, but only if the underlying system supports it])
|
||||
|
||||
#
|
||||
# Do we want orterun's --prefix behavior to be enabled by default?
|
||||
#
|
||||
AC_MSG_CHECKING([if want orterun "--prefix" behavior to be enabled by default])
|
||||
AC_ARG_ENABLE([orterun-prefix-by-default],
|
||||
[AC_HELP_STRING([--enable-orterun-prefix-by-default],
|
||||
[Make "orterun ..." behave exactly the same as "orterun --prefix \$prefix" (where \$prefix is the value given to --prefix in configure)])])
|
||||
AC_ARG_ENABLE([mpirun-prefix-by-default],
|
||||
[AC_HELP_STRING([--enable-mpirun-prefix-by-default],
|
||||
[Synonym for --enable-orterun-prefix-by-default])])
|
||||
if test "$enable_orterun_prefix_by_default" = ""; then
|
||||
enable_orterun_prefix_by_default=$enable_mpirun_prefix_by_default
|
||||
fi
|
||||
if test "$enable_orterun_prefix_by_default" = "yes"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
orte_want_orterun_prefix_by_default=1
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
orte_want_orterun_prefix_by_default=0
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED([ORTE_WANT_ORTERUN_PREFIX_BY_DEFAULT],
|
||||
[$orte_want_orterun_prefix_by_default],
|
||||
[Whether we want orterun to effect "--prefix $prefix" by default])
|
||||
])
|
||||
|
@ -348,6 +348,8 @@ void ompi_info::do_config(bool want_all)
|
||||
1 == MPI_PARAM_CHECK ? "always" : "runtime");
|
||||
string threads;
|
||||
const string want_libltdl(OMPI_WANT_LIBLTDL ? "yes" : "no");
|
||||
const string mpirun_prefix_by_default(ORTE_WANT_ORTERUN_PREFIX_BY_DEFAULT ?
|
||||
"yes" : "no");
|
||||
|
||||
if (OMPI_HAVE_SOLARIS_THREADS || OMPI_HAVE_POSIX_THREADS) {
|
||||
threads = OMPI_HAVE_SOLARIS_THREADS ? "solaris" :
|
||||
@ -579,4 +581,6 @@ void ompi_info::do_config(bool want_all)
|
||||
out("Memory profiling support", "option:mem-profile", memprofile);
|
||||
out("Memory debugging support", "option:mem-debug", memdebug);
|
||||
out("libltdl support", "option:dlopen", want_libltdl);
|
||||
out("mpirun default --prefix", "mpirun:prefix_by_default",
|
||||
mpirun_prefix_by_default);
|
||||
}
|
||||
|
@ -41,6 +41,7 @@
|
||||
#endif
|
||||
|
||||
#include "opal/event/event.h"
|
||||
#include "opal/install_dirs.h"
|
||||
#include "opal/mca/base/base.h"
|
||||
#include "opal/threads/condition.h"
|
||||
#include "opal/util/argv.h"
|
||||
@ -93,6 +94,7 @@ static int num_killed = 0;
|
||||
static char **global_mca_env = NULL;
|
||||
static bool have_zero_np = false;
|
||||
static orte_std_cntr_t total_num_apps = 0;
|
||||
static bool want_prefix_by_default = (bool) ORTE_WANT_ORTERUN_PREFIX_BY_DEFAULT;
|
||||
|
||||
/*
|
||||
* setup globals for catching orterun command line options
|
||||
@ -255,6 +257,9 @@ opal_cmd_line_init_t cmd_line_init[] = {
|
||||
{ NULL, NULL, NULL, '\0', NULL, "prefix", 1,
|
||||
NULL, OPAL_CMD_LINE_TYPE_STRING,
|
||||
"Prefix where Open MPI is installed on remote nodes" },
|
||||
{ NULL, NULL, NULL, '\0', NULL, "noprefix", 1,
|
||||
NULL, OPAL_CMD_LINE_TYPE_STRING,
|
||||
"Disable automatic --prefix behavior" },
|
||||
|
||||
/* End of list */
|
||||
{ NULL, NULL, NULL, '\0', NULL, NULL, 0,
|
||||
@ -1316,16 +1321,25 @@ static int create_app(int argc, char* argv[], orte_app_context_t **app_ptr,
|
||||
app->user_specified_cwd = false;
|
||||
}
|
||||
|
||||
/* Check to see if the user explicitly wanted to disable automatic
|
||||
--prefix behavior */
|
||||
|
||||
if (opal_cmd_line_is_taken(&cmd_line, "noprefix")) {
|
||||
want_prefix_by_default = false;
|
||||
}
|
||||
|
||||
/* Did the user specify a specific prefix for this app_context_t
|
||||
or provide an absolute path name to argv[0]? */
|
||||
if (opal_cmd_line_is_taken(&cmd_line, "prefix") ||
|
||||
'/' == argv[0][0]) {
|
||||
'/' == argv[0][0] || want_prefix_by_default) {
|
||||
size_t param_len;
|
||||
|
||||
/* The --prefix option takes precedence over /path/to/orterun */
|
||||
if (opal_cmd_line_is_taken(&cmd_line, "prefix")) {
|
||||
param = opal_cmd_line_get_param(&cmd_line, "prefix", 0, 0);
|
||||
} else {
|
||||
}
|
||||
/* /path/to/orterun */
|
||||
else if ('/' == argv[0][0]) {
|
||||
char* tmp_basename = NULL;
|
||||
/* If they specified an absolute path, strip off the
|
||||
/bin/<exec_name>" and leave just the prefix */
|
||||
@ -1345,6 +1359,10 @@ static int create_app(int argc, char* argv[], orte_app_context_t **app_ptr,
|
||||
}
|
||||
free(tmp_basename);
|
||||
}
|
||||
/* --enable-orterun-prefix-default was given to orterun */
|
||||
else {
|
||||
param = strdup(OPAL_PREFIX);
|
||||
}
|
||||
|
||||
if (NULL != param) {
|
||||
/* "Parse" the param, aka remove superfluous path_sep. */
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user