A bunch of fixes and improvements to Open MPI's various command line tools.
* fixed some bugs where "unknown" tokens were allowed on the command line (which should really only be used for ortertun). * if an unknown token is encountered, print a short error to stderr and quit with a nonzero exit status * if we don't find the right number of parameters to an option, print a short error to stderr and quit with a nonzero exit status * when --help is given, print the help message to stdout (not stderr) and quit with a zero exit status * added --showme:help option to the wrapper compilers * updated docs in opal/util/cmd_line.h * other small/miscellaneous CLI parsing bugs in various tools I won't bore you with what we did before. :-) Here's some examples of what the new behavior looks like: {{{ % ompi_info --bogus ompi_info: Error: unknown option "--bogus" Type 'ompi_info --help' for usage. % ompi_info --param bogus ompi_info: Error: option "--param" did not have enough parameters (2) Type 'ompi_info --help' for usage. % }}} This commit was SVN r26072.
Этот коммит содержится в:
родитель
b2f1bade37
Коммит
97b3603036
@ -10,6 +10,7 @@
|
||||
# University of Stuttgart. All rights reserved.
|
||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
# All rights reserved.
|
||||
# Copyright (c) 2012 Cisco Systems, Inc. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
@ -24,4 +25,3 @@ Start an Open MPI data server
|
||||
Usage: %s [OPTIONS]
|
||||
|
||||
%s
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2007-2012 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2007 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
@ -47,7 +47,7 @@
|
||||
#include "opal/util/cmd_line.h"
|
||||
#include "opal/util/output.h"
|
||||
#include "opal/util/opal_sos.h"
|
||||
#include "orte/util/show_help.h"
|
||||
#include "opal/util/show_help.h"
|
||||
#include "opal/util/daemon_init.h"
|
||||
#include "opal/runtime/opal.h"
|
||||
#include "opal/runtime/opal_cr.h"
|
||||
@ -123,22 +123,27 @@ int main(int argc, char *argv[])
|
||||
mca_base_cmd_line_setup(cmd_line);
|
||||
if (OPAL_SUCCESS != (ret = opal_cmd_line_parse(cmd_line, false,
|
||||
argc, argv))) {
|
||||
char *args = NULL;
|
||||
args = opal_cmd_line_get_usage_msg(cmd_line);
|
||||
orte_show_help("help-ompi-server.txt", "ompiserver:usage", false,
|
||||
argv[0], args);
|
||||
free(args);
|
||||
return ret;
|
||||
if (OPAL_ERR_SILENT != ret) {
|
||||
fprintf(stderr, "%s: command line error (%s)\n", argv[0],
|
||||
opal_strerror(ret));
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* check for help request */
|
||||
if (help) {
|
||||
char *args = NULL;
|
||||
char *str, *args = NULL;
|
||||
args = opal_cmd_line_get_usage_msg(cmd_line);
|
||||
orte_show_help("help-ompi-server.txt", "ompiserver:usage", false,
|
||||
argv[0], args);
|
||||
str = opal_show_help_string("help-ompi-server.txt",
|
||||
"ompiserver:usage", false,
|
||||
argv[0], args);
|
||||
if (NULL != str) {
|
||||
printf("%s", str);
|
||||
free(str);
|
||||
}
|
||||
free(args);
|
||||
return 1;
|
||||
/* If we show the help message, that should be all we do */
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -9,7 +9,7 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copryight (c) 2007-2010 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2007-2012 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2011 University of Houston. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
@ -42,7 +42,9 @@
|
||||
#include "opal/runtime/opal_cr.h"
|
||||
#endif
|
||||
#include "opal/util/cmd_line.h"
|
||||
#include "opal/util/error.h"
|
||||
#include "opal/util/argv.h"
|
||||
#include "opal/util/show_help.h"
|
||||
#include "opal/mca/base/base.h"
|
||||
|
||||
#include "orte/util/show_help.h"
|
||||
@ -145,18 +147,33 @@ int main(int argc, char *argv[])
|
||||
|
||||
/* Do the parsing */
|
||||
|
||||
if (OMPI_SUCCESS != opal_cmd_line_parse(ompi_info_cmd_line, false, argc, argv)) {
|
||||
ret = opal_cmd_line_parse(ompi_info_cmd_line, false, argc, argv);
|
||||
if (OMPI_SUCCESS != ret) {
|
||||
cmd_error = true;
|
||||
if (OPAL_ERR_SILENT != ret) {
|
||||
fprintf(stderr, "%s: command line error (%s)\n", argv[0],
|
||||
opal_strerror(ret));
|
||||
}
|
||||
}
|
||||
if (!cmd_error &&
|
||||
(opal_cmd_line_is_taken(ompi_info_cmd_line, "help") ||
|
||||
opal_cmd_line_is_taken(ompi_info_cmd_line, "h"))) {
|
||||
char *str, *usage;
|
||||
|
||||
want_help = true;
|
||||
}
|
||||
if (cmd_error || want_help) {
|
||||
char *usage = opal_cmd_line_get_usage_msg(ompi_info_cmd_line);
|
||||
orte_show_help("help-ompi_info.txt", "usage", true, usage);
|
||||
usage = opal_cmd_line_get_usage_msg(ompi_info_cmd_line);
|
||||
str = opal_show_help_string("help-ompi_info.txt", "usage",
|
||||
true, usage);
|
||||
if (NULL != str) {
|
||||
printf("%s", str);
|
||||
free(str);
|
||||
}
|
||||
free(usage);
|
||||
}
|
||||
|
||||
/* If we had a cmd line parse error, or we showed the help
|
||||
message, it's time to exit. */
|
||||
if (cmd_error || want_help) {
|
||||
mca_base_close();
|
||||
OBJ_RELEASE(ompi_info_cmd_line);
|
||||
opal_finalize_util();
|
||||
|
@ -10,6 +10,7 @@
|
||||
# University of Stuttgart. All rights reserved.
|
||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
# All rights reserved.
|
||||
# Copyright (c) 2012 Cisco Systems, Inc. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
@ -23,20 +24,20 @@ opal-checkpoint PID
|
||||
Open PAL Single Process Checkpoint Tool
|
||||
|
||||
%s
|
||||
|
||||
#
|
||||
[invalid_pid]
|
||||
Error: The PID (%d) is invalid because either you have not provided a PID
|
||||
or provided an invalid PID.
|
||||
Please see --help for usage.
|
||||
|
||||
#
|
||||
[ckpt_failure]
|
||||
Error: The application (PID = %d) failed to checkpoint properly.
|
||||
Returned %d, state %d.
|
||||
|
||||
#
|
||||
[restart_cmd_failure]
|
||||
Error: Unable to obtain the proper restart command to restart from the
|
||||
checkpoint file (%s). Returned %d.
|
||||
|
||||
#
|
||||
[pid_does_not_exist]
|
||||
Error: The process with PID %d is not checkpointable.
|
||||
This could be due to one of the following:
|
||||
@ -46,13 +47,16 @@ Error: The process with PID %d is not checkpointable.
|
||||
We were looking for the named files:
|
||||
%s
|
||||
%s
|
||||
#
|
||||
[ckpt:in_progress]
|
||||
The process with PID %d is currently not checkpointable.
|
||||
This is because it is already checkpointing itself.
|
||||
Wait until the checkpoint completes then try again.
|
||||
#
|
||||
[ckpt:req_error]
|
||||
The process with PID %d is currently not checkpointable.
|
||||
This is due to an error during the checkpointing process.
|
||||
#
|
||||
[ckpt:req_null]
|
||||
The process with PID %d is not checkpointable.
|
||||
This can be due to one of the following reasons:
|
||||
|
@ -11,6 +11,7 @@
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2007 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -60,6 +61,7 @@
|
||||
#include "opal/util/argv.h"
|
||||
#include "opal/util/show_help.h"
|
||||
#include "opal/util/opal_environ.h"
|
||||
#include "opal/util/error.h"
|
||||
#include "opal/util/output.h"
|
||||
#include "opal/mca/base/base.h"
|
||||
#include "opal/mca/base/mca_base_param.h"
|
||||
@ -276,6 +278,7 @@ static int parse_args(int argc, char *argv[]) {
|
||||
opal_cmd_line_t cmd_line;
|
||||
char **app_env = NULL, **global_env = NULL;
|
||||
char * tmp_env_var = NULL;
|
||||
char *argv0 = NULL;
|
||||
|
||||
memset(&opal_checkpoint_globals, 0, sizeof(opal_checkpoint_globals_t));
|
||||
|
||||
@ -287,6 +290,27 @@ static int parse_args(int argc, char *argv[]) {
|
||||
mca_base_open();
|
||||
mca_base_cmd_line_setup(&cmd_line);
|
||||
ret = opal_cmd_line_parse(&cmd_line, true, argc, argv);
|
||||
|
||||
if (OPAL_SUCCESS != ret) {
|
||||
if (OPAL_ERR_SILENT != ret) {
|
||||
fprintf(stderr, "%s: command line error (%s)\n", argv[0],
|
||||
opal_strerror(ret));
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
if (opal_checkpoint_globals.help) {
|
||||
char *str, *args = NULL;
|
||||
args = opal_cmd_line_get_usage_msg(&cmd_line);
|
||||
str = opal_show_help_string("help-opal-checkpoint.txt", "usage", true,
|
||||
args);
|
||||
if (NULL != str) {
|
||||
printf("%s", str);
|
||||
free(str);
|
||||
}
|
||||
free(args);
|
||||
/* If we show the help message, that should be all we do */
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Put all of the MCA arguments in the environment
|
||||
@ -313,16 +337,6 @@ static int parse_args(int argc, char *argv[]) {
|
||||
/**
|
||||
* Now start parsing our specific arguments
|
||||
*/
|
||||
if (OPAL_SUCCESS != ret ||
|
||||
opal_checkpoint_globals.help ||
|
||||
1 >= argc) {
|
||||
char *args = NULL;
|
||||
args = opal_cmd_line_get_usage_msg(&cmd_line);
|
||||
opal_show_help("help-opal-checkpoint.txt", "usage", true,
|
||||
args);
|
||||
free(args);
|
||||
return OPAL_ERROR;
|
||||
}
|
||||
|
||||
if( NULL == opal_checkpoint_globals.snapshot_name )
|
||||
opal_checkpoint_globals.snapshot_name = strdup("");
|
||||
@ -331,8 +345,17 @@ static int parse_args(int argc, char *argv[]) {
|
||||
}
|
||||
|
||||
/* get the remaining bits */
|
||||
argv0 = strdup(argv[0]);
|
||||
opal_cmd_line_get_tail(&cmd_line, &argc, &argv);
|
||||
|
||||
if (0 == argc) {
|
||||
fprintf(stderr, "%s: Nothing to do\n", argv0);
|
||||
fprintf(stderr, "Type '%s --help' for usage.\n", argv0);
|
||||
free(argv0);
|
||||
return OPAL_ERROR;
|
||||
}
|
||||
free(argv0);
|
||||
|
||||
opal_checkpoint_globals.pid = atoi(argv[0]);
|
||||
if ( 0 >= opal_checkpoint_globals.pid ) {
|
||||
opal_show_help("help-opal-checkpoint.txt", "invalid_pid", true,
|
||||
|
@ -13,6 +13,7 @@
|
||||
# Copyright (c) 2007 Evergrid, Inc. All rights reserved.
|
||||
# Copyright (c) 2011 Oak Ridge National Labs. All rights reserved.
|
||||
#
|
||||
# Copyright (c) 2012 Cisco Systems, Inc. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
@ -26,46 +27,49 @@ opal-restart -r FILENAME
|
||||
Open PAL Single Process Restart Tool
|
||||
|
||||
%s
|
||||
|
||||
#
|
||||
[invalid_filename]
|
||||
Error: The filename (%s) is invalid because either you have not provided a filename
|
||||
Error: The filename is invalid because either you have not provided a filename
|
||||
or provided an invalid filename.
|
||||
Please see --help for usage.
|
||||
|
||||
Filename: %s
|
||||
|
||||
Please see --help for usage.
|
||||
#
|
||||
[invalid_metadata]
|
||||
Error: The local checkpoint contains invalid or incomplete metadata.
|
||||
This usually indicates that the original checkpoint was invalid.
|
||||
Check the metadata file (%s) in the following directory:
|
||||
%s
|
||||
|
||||
#
|
||||
[restart_cmd_failure]
|
||||
Error: Unable to obtain the proper restart command to restart from the
|
||||
checkpoint file (%s). Returned %d.
|
||||
Check the installation of the %s checkpoint/restart service
|
||||
on all of the machines in your system.
|
||||
|
||||
#
|
||||
[comp_open_failure]
|
||||
Error: Unable to open the %s framework.
|
||||
|
||||
#
|
||||
[comp_select_failure]
|
||||
Error: Unable to select the %s component needed to restart this
|
||||
application. (Returned %d)
|
||||
This likely indicates that the checkpointer needed is not
|
||||
available on this machine. You should move to a machine that
|
||||
has this checkpointer enabled.
|
||||
|
||||
#
|
||||
[comp_select_mismatch]
|
||||
Error: For an unknown reason the selected and requested components do
|
||||
not match.
|
||||
|
||||
Expected Component: %s
|
||||
Selected Component: %s
|
||||
|
||||
#
|
||||
[restart_failure]
|
||||
Error: The restart command:
|
||||
shell$ %s
|
||||
returned an error code %d, and was unable to restart properly.
|
||||
|
||||
#
|
||||
[failed-to-exec]
|
||||
Error: The restart command failed to properly exec the process per
|
||||
the user's request. It is possible that the incorrect OPAL CRS
|
||||
@ -73,10 +77,9 @@ Error: The restart command failed to properly exec the process per
|
||||
|
||||
Expected Component: %s
|
||||
Selected Component: %s
|
||||
|
||||
#
|
||||
[cache_not_avail]
|
||||
Warning: Recommended cache directory could not be accessed. Falling back
|
||||
to the snapshot location.
|
||||
Cache Dir : %s
|
||||
Snapshot Dir: %s
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
* reserved.
|
||||
* Copyright (c) 2007 Evergrid, Inc. All rights reserved.
|
||||
* Copyright (c) 2011 Oak Ridge National Labs. All rights reserved.
|
||||
*
|
||||
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -62,6 +62,7 @@
|
||||
#include "opal/util/show_help.h"
|
||||
#include "opal/util/output.h"
|
||||
#include "opal/util/opal_environ.h"
|
||||
#include "opal/util/error.h"
|
||||
#include "opal/util/basename.h"
|
||||
#include "opal/mca/base/base.h"
|
||||
#include "opal/mca/base/mca_base_param.h"
|
||||
@ -514,7 +515,27 @@ static int parse_args(int argc, char *argv[])
|
||||
|
||||
mca_base_open();
|
||||
mca_base_cmd_line_setup(&cmd_line);
|
||||
ret = opal_cmd_line_parse(&cmd_line, true, argc, argv);
|
||||
ret = opal_cmd_line_parse(&cmd_line, false, argc, argv);
|
||||
if (OPAL_SUCCESS != ret) {
|
||||
if (OPAL_ERR_SILENT != ret) {
|
||||
fprintf(stderr, "%s: command line error (%s)\n", argv[0],
|
||||
opal_strerror(ret));
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
if (opal_restart_globals.help ) {
|
||||
char *str, *args = NULL;
|
||||
args = opal_cmd_line_get_usage_msg(&cmd_line);
|
||||
str = opal_show_help_string("help-opal-restart.txt", "usage", true,
|
||||
args);
|
||||
if (NULL != str) {
|
||||
printf("%s", str);
|
||||
free(str);
|
||||
}
|
||||
free(args);
|
||||
/* If we show the help message, that should be all we do */
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Put all of the MCA arguments in the environment
|
||||
@ -534,23 +555,13 @@ static int parse_args(int argc, char *argv[])
|
||||
/**
|
||||
* Now start parsing our specific arguments
|
||||
*/
|
||||
if (OPAL_SUCCESS != ret ||
|
||||
opal_restart_globals.help ) {
|
||||
char *args = NULL;
|
||||
args = opal_cmd_line_get_usage_msg(&cmd_line);
|
||||
opal_show_help("help-opal-restart.txt", "usage", true,
|
||||
args);
|
||||
free(args);
|
||||
return OPAL_ERROR;
|
||||
}
|
||||
|
||||
/* get the remaining bits */
|
||||
opal_cmd_line_get_tail(&cmd_line, &argc, &argv);
|
||||
|
||||
if ( NULL == opal_restart_globals.snapshot_ref ||
|
||||
0 >= strlen(opal_restart_globals.snapshot_ref) ) {
|
||||
opal_show_help("help-opal-restart.txt", "invalid_filename", true,
|
||||
opal_restart_globals.snapshot_ref);
|
||||
"<none provided>");
|
||||
return OPAL_ERROR;
|
||||
}
|
||||
|
||||
@ -590,9 +601,6 @@ static int check_file(void)
|
||||
path_to_check);
|
||||
|
||||
if (0 > (ret = access(path_to_check, F_OK)) ) {
|
||||
opal_output(opal_restart_globals.output,
|
||||
"Error: Unable to access the path [%s]!",
|
||||
path_to_check);
|
||||
exit_status = OPAL_ERROR;
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
.\" Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
|
||||
.\" Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
|
||||
.\" Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
|
||||
.TH #COMMAND# 1 "#OMPI_DATE#" "#PACKAGE_VERSION#" "#PACKAGE_NAME#"
|
||||
.
|
||||
.SH NAME
|
||||
@ -56,6 +56,9 @@ application. For example: "mpi open-rte open-pal util".
|
||||
.TP
|
||||
--showme:version
|
||||
Outputs the version number of Open MPI.
|
||||
.TP
|
||||
--showme:help
|
||||
Output a brief usage help message.
|
||||
.PP
|
||||
See the man page for your underlying #LANGUAGE# compiler for other
|
||||
options that can be passed through #COMMAND#.
|
||||
|
@ -11,6 +11,7 @@
|
||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
# All rights reserved.
|
||||
# Copyright (c) 2006-2010 Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2012 Cisco Systems, Inc. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
@ -46,7 +47,7 @@ one of several possible environment variables.
|
||||
#
|
||||
[usage]
|
||||
%s [-showme[:<command,compile,link,incdirs,
|
||||
libdirs,libs,version>]] args
|
||||
libdirs,libs,version,help>]] args
|
||||
|
||||
-showme:command Show command used to invoke real compiler
|
||||
-showme:compile Show flags added when compiling
|
||||
@ -55,6 +56,7 @@ one of several possible environment variables.
|
||||
-showme:libdirs Show list of library dirs added when linking
|
||||
-showme:libs Show list of libraries added when linking
|
||||
-showme:version Show version of %s
|
||||
-showme:help This help message
|
||||
#
|
||||
[file-not-found]
|
||||
%s could not find the file %s, needed for %s support.
|
||||
|
@ -9,7 +9,7 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2007-2012 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2007 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
|
||||
@ -395,9 +395,9 @@ data_init(const char *appname)
|
||||
if (NULL == datafile) return OPAL_ERR_TEMP_OUT_OF_RESOURCE;
|
||||
|
||||
ret = opal_util_keyval_parse(datafile, data_callback);
|
||||
if( OPAL_SUCCESS != ret ) {
|
||||
fprintf(stderr, "Cannot open configuration file %s\n", datafile );
|
||||
}
|
||||
if( OPAL_SUCCESS != ret ) {
|
||||
fprintf(stderr, "Cannot open configuration file %s\n", datafile );
|
||||
}
|
||||
free(datafile);
|
||||
|
||||
return ret;
|
||||
@ -637,13 +637,36 @@ main(int argc, char *argv[])
|
||||
goto cleanup;
|
||||
} else if (0 == strncmp(user_argv[i], "-showme:version", strlen("-showme:version")) ||
|
||||
0 == strncmp(user_argv[i], "--showme:version", strlen("--showme:version"))) {
|
||||
opal_show_help("help-opal-wrapper.txt", "version", false,
|
||||
argv[0], options_data[user_data_idx].project, options_data[user_data_idx].version, options_data[user_data_idx].language, NULL);
|
||||
char * str;
|
||||
str = opal_show_help_string("help-opal-wrapper.txt",
|
||||
"version", false,
|
||||
argv[0], options_data[user_data_idx].project, options_data[user_data_idx].version, options_data[user_data_idx].language, NULL);
|
||||
if (NULL != str) {
|
||||
printf("%s", str);
|
||||
free(str);
|
||||
}
|
||||
goto cleanup;
|
||||
} else if (0 == strncmp(user_argv[i], "-showme:help", strlen("-showme:help")) ||
|
||||
0 == strncmp(user_argv[i], "--showme:help", strlen("--showme:help"))) {
|
||||
char *str;
|
||||
str = opal_show_help_string("help-opal-wrapper.txt", "usage",
|
||||
false, argv[0],
|
||||
options_data[user_data_idx].project,
|
||||
NULL);
|
||||
if (NULL != str) {
|
||||
printf("%s", str);
|
||||
free(str);
|
||||
}
|
||||
|
||||
exit_status = 0;
|
||||
goto cleanup;
|
||||
} else if (0 == strncmp(user_argv[i], "-showme:", strlen("-showme:")) ||
|
||||
0 == strncmp(user_argv[i], "--showme:", strlen("--showme:"))) {
|
||||
opal_show_help("help-opal-wrapper.txt", "usage", true,
|
||||
argv[0], options_data[user_data_idx].project, NULL);
|
||||
fprintf(stderr, "%s: unrecognized option: %s\n", argv[0],
|
||||
user_argv[i]);
|
||||
fprintf(stderr, "Type '%s --showme:help' for usage.\n",
|
||||
argv[0]);
|
||||
exit_status = 1;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
|
@ -11,6 +11,7 @@
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2012 Los Alamos National Security, LLC.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2012 Cisco Systems, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -272,6 +273,8 @@ int opal_cmd_line_parse(opal_cmd_line_t *cmd, bool ignore_unknown,
|
||||
char **shortsv;
|
||||
int shortsc;
|
||||
int num_args_used;
|
||||
bool have_help_option = false;
|
||||
bool printed_error = false;
|
||||
|
||||
/* Bozo check */
|
||||
|
||||
@ -292,6 +295,13 @@ int opal_cmd_line_parse(opal_cmd_line_t *cmd, bool ignore_unknown,
|
||||
cmd->lcl_argc = argc;
|
||||
cmd->lcl_argv = opal_argv_copy(argv);
|
||||
|
||||
/* Check up front: do we have a --help option? */
|
||||
|
||||
option = find_option(cmd, "help");
|
||||
if (NULL != option) {
|
||||
have_help_option = true;
|
||||
}
|
||||
|
||||
/* Now traverse the easy-to-parse sequence of tokens. Note that
|
||||
incrementing i must happen elsehwere; it can't be the third
|
||||
clause in the "if" statement. */
|
||||
@ -407,25 +417,36 @@ int opal_cmd_line_parse(opal_cmd_line_t *cmd, bool ignore_unknown,
|
||||
/* If we run out of parameters, error */
|
||||
|
||||
if (i >= cmd->lcl_argc) {
|
||||
opal_output(0, "Error: option \"%s\" did not have "
|
||||
"enough parameters (%d)",
|
||||
cmd->lcl_argv[orig],
|
||||
option->clo_num_params);
|
||||
fprintf(stderr, "%s: Error: option \"%s\" did not "
|
||||
"have enough parameters (%d)\n",
|
||||
cmd->lcl_argv[0],
|
||||
cmd->lcl_argv[orig],
|
||||
option->clo_num_params);
|
||||
if (have_help_option) {
|
||||
fprintf(stderr, "Type '%s --help' for usage.\n",
|
||||
cmd->lcl_argv[0]);
|
||||
}
|
||||
OBJ_RELEASE(param);
|
||||
i = cmd->lcl_argc;
|
||||
break;
|
||||
printed_error = true;
|
||||
goto error;
|
||||
} else {
|
||||
if (0 == strcmp(cmd->lcl_argv[i],
|
||||
special_empty_token)) {
|
||||
opal_output(0, "Error: option \"%s\" did not have "
|
||||
"enough parameters (%d)",
|
||||
cmd->lcl_argv[orig],
|
||||
option->clo_num_params);
|
||||
if (NULL != param->clp_argv)
|
||||
fprintf(stderr, "%s: Error: option \"%s\" did not "
|
||||
"have enough parameters (%d)\n",
|
||||
cmd->lcl_argv[0],
|
||||
cmd->lcl_argv[orig],
|
||||
option->clo_num_params);
|
||||
if (have_help_option) {
|
||||
fprintf(stderr, "Type '%s --help' for usage.\n",
|
||||
cmd->lcl_argv[0]);
|
||||
}
|
||||
if (NULL != param->clp_argv) {
|
||||
opal_argv_free(param->clp_argv);
|
||||
}
|
||||
OBJ_RELEASE(param);
|
||||
i = cmd->lcl_argc;
|
||||
break;
|
||||
printed_error = true;
|
||||
goto error;
|
||||
}
|
||||
|
||||
/* Otherwise, save this parameter */
|
||||
@ -474,20 +495,26 @@ int opal_cmd_line_parse(opal_cmd_line_t *cmd, bool ignore_unknown,
|
||||
/* If we figured out above that this was an unknown option,
|
||||
handle it. Copy everything (including the current token)
|
||||
into the tail. If we're not ignoring unknowns, then print
|
||||
an error and return.
|
||||
*/
|
||||
|
||||
an error and return. */
|
||||
if (is_unknown) {
|
||||
has_unknowns = true;
|
||||
if (!ignore_unknown) {
|
||||
opal_output(0, "Error: unknown option \"%s\"",
|
||||
cmd->lcl_argv[i]);
|
||||
fprintf(stderr, "%s: Error: unknown option \"%s\"\n",
|
||||
cmd->lcl_argv[0], cmd->lcl_argv[i]);
|
||||
printed_error = true;
|
||||
if (have_help_option) {
|
||||
fprintf(stderr, "Type '%s --help' for usage.\n",
|
||||
cmd->lcl_argv[0]);
|
||||
}
|
||||
}
|
||||
error:
|
||||
while (i < cmd->lcl_argc) {
|
||||
opal_argv_append(&cmd->lcl_tail_argc, &cmd->lcl_tail_argv,
|
||||
cmd->lcl_argv[i]);
|
||||
++i;
|
||||
}
|
||||
|
||||
/* Because i has advanced, we'll fall out of the loop */
|
||||
}
|
||||
}
|
||||
|
||||
@ -496,8 +523,8 @@ int opal_cmd_line_parse(opal_cmd_line_t *cmd, bool ignore_unknown,
|
||||
opal_mutex_unlock(&cmd->lcl_mutex);
|
||||
|
||||
/* All done */
|
||||
if(has_unknowns && !ignore_unknown) {
|
||||
return OPAL_ERR_BAD_PARAM;
|
||||
if (printed_error) {
|
||||
return OPAL_ERR_SILENT;
|
||||
}
|
||||
|
||||
return OPAL_SUCCESS;
|
||||
@ -1190,8 +1217,8 @@ static int set_dest(cmd_line_option_t *option, char *sval)
|
||||
/* show help isn't going to be available yet, so just
|
||||
* print the msg
|
||||
*/
|
||||
fprintf(stderr, "-----------------------------------------------------------\n");
|
||||
fprintf(stderr, "Open MPI has detected that a parameter given to a cmd line\n");
|
||||
fprintf(stderr, "----------------------------------------------------------------------------\n");
|
||||
fprintf(stderr, "Open MPI has detected that a parameter given to a command line\n");
|
||||
fprintf(stderr, "option does not match the expected format:\n\n");
|
||||
if (NULL != option->clo_long_name) {
|
||||
fprintf(stderr, " Option: %s\n", option->clo_long_name);
|
||||
@ -1202,8 +1229,8 @@ static int set_dest(cmd_line_option_t *option, char *sval)
|
||||
}
|
||||
fprintf(stderr, " Param: %s\n\n", sval);
|
||||
fprintf(stderr, "This is frequently caused by omitting to provide the parameter\n");
|
||||
fprintf(stderr, "to an option that requires one. Please check the cmd line and try again.\n");
|
||||
fprintf(stderr, "-----------------------------------------------------------\n\n");
|
||||
fprintf(stderr, "to an option that requires one. Please check the command line and try again.\n");
|
||||
fprintf(stderr, "----------------------------------------------------------------------------\n");
|
||||
return OPAL_ERR_SILENT;
|
||||
}
|
||||
}
|
||||
@ -1216,8 +1243,8 @@ static int set_dest(cmd_line_option_t *option, char *sval)
|
||||
/* show help isn't going to be available yet, so just
|
||||
* print the msg
|
||||
*/
|
||||
fprintf(stderr, "-----------------------------------------------------------\n");
|
||||
fprintf(stderr, "Open MPI has detected that a parameter given to a cmd line\n");
|
||||
fprintf(stderr, "----------------------------------------------------------------------------\n");
|
||||
fprintf(stderr, "Open MPI has detected that a parameter given to a command line\n");
|
||||
fprintf(stderr, "option does not match the expected format:\n\n");
|
||||
if (NULL != option->clo_long_name) {
|
||||
fprintf(stderr, " Option: %s\n", option->clo_long_name);
|
||||
@ -1228,8 +1255,8 @@ static int set_dest(cmd_line_option_t *option, char *sval)
|
||||
}
|
||||
fprintf(stderr, " Param: %s\n\n", sval);
|
||||
fprintf(stderr, "This is frequently caused by omitting to provide the parameter\n");
|
||||
fprintf(stderr, "to an option that requires one. Please check the cmd line and try again.\n");
|
||||
fprintf(stderr, "-----------------------------------------------------------\n\n");
|
||||
fprintf(stderr, "to an option that requires one. Please check the command line and try again.\n");
|
||||
fprintf(stderr, "----------------------------------------------------------------------------\n");
|
||||
return OPAL_ERR_SILENT;
|
||||
}
|
||||
}
|
||||
|
@ -9,6 +9,7 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2012 Cisco Systems, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -349,6 +350,9 @@ BEGIN_C_DECLS
|
||||
* @param argv Array of strings from the command line.
|
||||
*
|
||||
* @retval OPAL_SUCCESS Upon success.
|
||||
* @retval OPAL_ERR_SILENT If an error message was printed. This
|
||||
* value will only be returned if the command line was not
|
||||
* successfully parsed.
|
||||
*
|
||||
* Parse a series of command line tokens according to the option
|
||||
* descriptions from a OPAL command line handle. The OPAL command line
|
||||
@ -361,15 +365,25 @@ BEGIN_C_DECLS
|
||||
* is displayed. If ignore_unknown is true, the error message is
|
||||
* not displayed.
|
||||
*
|
||||
* Error messages are always displayed (to stderr, and
|
||||
* OPAL_ERR_SILENT is returned) if a token was encountered that
|
||||
* required N parameters, but <N parameters were found (e.g., "cmd
|
||||
* --param foo", but --param was registered to require 2 option
|
||||
* tokens).
|
||||
*
|
||||
* The contents of argc and argv are not changed during parsing.
|
||||
* argv[0] is assumed to be the executable name, and is ignored during
|
||||
* parsing. It can later be retrieved with
|
||||
* parsing, except when printing error messages.
|
||||
*
|
||||
* Parsing will stop in the following conditions:
|
||||
*
|
||||
* - all argv tokens are processed
|
||||
* - the token "--" is found
|
||||
* - an unrecognized token is found
|
||||
* - a parameter registered with an integer type option finds a
|
||||
* non-integer option token
|
||||
* - a parameted registered N option tokens, but finds less then
|
||||
* <N tokens available
|
||||
*
|
||||
* Upon any of these conditions, any remaining tokens will be placed
|
||||
* in the "tail" (and therefore not examined by the parser),
|
||||
|
@ -10,6 +10,7 @@
|
||||
# University of Stuttgart. All rights reserved.
|
||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
# All rights reserved.
|
||||
# Copyright (c) 2012 Cisco Systems, Inc. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
@ -23,7 +24,7 @@ ompi-checkpoint PID_OF_MPIRUN
|
||||
Open MPI Checkpoint Tool
|
||||
|
||||
%s
|
||||
|
||||
#
|
||||
[usage-no-cr]
|
||||
This build of Open MPI does *not* include Checkpoint/Restart functionality.
|
||||
If you require this functionality re-configure Open MPI with the proper
|
||||
@ -33,16 +34,16 @@ ompi-checkpoint PID_OF_MPIRUN
|
||||
Open MPI Checkpoint Tool
|
||||
|
||||
%s
|
||||
|
||||
#
|
||||
[invalid_pid]
|
||||
Error: The PID (%d) is invalid because either you have not provided a PID
|
||||
or provided an invalid PID.
|
||||
Please see --help for usage.
|
||||
|
||||
#
|
||||
[ckpt_failure]
|
||||
Error: The application (PID = %d) failed to checkpoint properly.
|
||||
Returned %d.
|
||||
|
||||
#
|
||||
[pid_does_not_exist]
|
||||
Error: The process with PID %d is not checkpointable.
|
||||
This could be due to one of the following:
|
||||
@ -51,7 +52,7 @@ Error: The process with PID %d is not checkpointable.
|
||||
- The application with this PID isn't an Open MPI application.
|
||||
We were looking for the named file:
|
||||
%s
|
||||
|
||||
#
|
||||
[no_hnps]
|
||||
Error: Unable to find a list of active MPIRUN processes on this machine.
|
||||
This could be due to one of the following:
|
||||
@ -64,7 +65,7 @@ Error: Unable to find a list of active MPIRUN processes on this machine.
|
||||
process is running.
|
||||
|
||||
Return Code: %d (%s)
|
||||
|
||||
#
|
||||
[no_universe]
|
||||
Error: Unable to find the requested, active MPIRUN process on this machine.
|
||||
This could be due to one of the following:
|
||||
@ -77,7 +78,7 @@ Error: Unable to find the requested, active MPIRUN process on this machine.
|
||||
|
||||
ompi-checkpoint attempted to use the session directory:
|
||||
%s/%s
|
||||
|
||||
#
|
||||
[unable_to_connect]
|
||||
Error: Unable to connect to the Head Node Process to initiate the
|
||||
checkpoint of the application.
|
||||
@ -87,7 +88,7 @@ Error: Unable to connect to the Head Node Process to initiate the
|
||||
- The PID is not that of an active MPIRUN.
|
||||
- The application with this PID isn't checkpointable
|
||||
- The application with this PID isn't an Open MPI application.
|
||||
|
||||
#
|
||||
[non-ckptable]
|
||||
Error: The job with pid %d is not checkpointable.
|
||||
This could be caused by one of the following:
|
||||
@ -96,6 +97,7 @@ Error: The job with pid %d is not checkpointable.
|
||||
To enable checkpointing in an application use the following AMCA parameter
|
||||
argument to mpirun:
|
||||
-am ft-enable-cr
|
||||
#
|
||||
[not_impl]
|
||||
The following feature was requested, but is not currently implemented.
|
||||
%s
|
||||
@ -106,6 +108,6 @@ Error: The process with PID %d is not checkpointable.
|
||||
This could be due to one of the following:
|
||||
- An application with this PID doesn't currently exist
|
||||
- The application with this PID isn't an Open MPI application.
|
||||
|
||||
#
|
||||
[hnp_not_found]
|
||||
Error: The jobid specified by the '--hnp-jobid' option does not exist.
|
||||
|
@ -11,6 +11,7 @@
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2007 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -345,6 +346,7 @@ static int parse_args(int argc, char *argv[]) {
|
||||
opal_cmd_line_t cmd_line;
|
||||
char **app_env = NULL, **global_env = NULL;
|
||||
char * tmp_env_var = NULL;
|
||||
char *argv0 = NULL;
|
||||
|
||||
/* Init structure */
|
||||
memset(&orte_checkpoint_globals, 0, sizeof(orte_checkpoint_globals_t));
|
||||
@ -370,12 +372,52 @@ static int parse_args(int argc, char *argv[]) {
|
||||
orte_checkpoint_globals.detach_debugger = false;
|
||||
#endif
|
||||
|
||||
#if OPAL_ENABLE_FT_CR == 0
|
||||
/* Warn and exit if not configured with Checkpoint/Restart */
|
||||
{
|
||||
char *str, *args = NULL;
|
||||
args = opal_cmd_line_get_usage_msg(&cmd_line);
|
||||
str = opal_show_help_string("help-orte-checkpoint.txt", "usage-no-cr",
|
||||
true, args);
|
||||
if (NULL != str) {
|
||||
printf("%s", str);
|
||||
free(str);
|
||||
}
|
||||
free(args);
|
||||
exit_status = ORTE_ERROR;
|
||||
goto cleanup;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Parse the command line options */
|
||||
opal_cmd_line_create(&cmd_line, cmd_line_opts);
|
||||
mca_base_open();
|
||||
mca_base_cmd_line_setup(&cmd_line);
|
||||
ret = opal_cmd_line_parse(&cmd_line, true, argc, argv);
|
||||
|
||||
ret = opal_cmd_line_parse(&cmd_line, false, argc, argv);
|
||||
|
||||
if (OPAL_SUCCESS != ret) {
|
||||
if (OPAL_ERR_SILENT != ret) {
|
||||
fprintf(stderr, "%s: command line error (%s)\n", argv[0],
|
||||
opal_strerror(ret));
|
||||
}
|
||||
exit_status = 1;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (orte_checkpoint_globals.help) {
|
||||
char *str, *args = NULL;
|
||||
args = opal_cmd_line_get_usage_msg(&cmd_line);
|
||||
str = opal_show_help_string("help-orte-checkpoint.txt", "usage", true,
|
||||
args);
|
||||
if (NULL != str) {
|
||||
printf("%s", str);
|
||||
free(str);
|
||||
}
|
||||
free(args);
|
||||
/* If we show the help message, that should be all we do */
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Put all of the MCA arguments in the environment
|
||||
*/
|
||||
@ -402,6 +444,7 @@ static int parse_args(int argc, char *argv[]) {
|
||||
* Now start parsing our specific arguments
|
||||
*/
|
||||
/* get the remaining bits */
|
||||
argv0 = strdup(argv[0]);
|
||||
opal_cmd_line_get_tail(&cmd_line, &argc, &argv);
|
||||
|
||||
if(orte_checkpoint_globals.list_only ) {
|
||||
@ -409,28 +452,10 @@ static int parse_args(int argc, char *argv[]) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
#if OPAL_ENABLE_FT_CR == 0
|
||||
/* Warn and exit if not configured with Checkpoint/Restart */
|
||||
{
|
||||
char *args = NULL;
|
||||
args = opal_cmd_line_get_usage_msg(&cmd_line);
|
||||
opal_show_help("help-orte-checkpoint.txt", "usage-no-cr",
|
||||
true, args);
|
||||
free(args);
|
||||
exit_status = ORTE_ERROR;
|
||||
goto cleanup;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (OPAL_SUCCESS != ret ||
|
||||
orte_checkpoint_globals.help ||
|
||||
(0 >= argc && ORTE_JOBID_INVALID == orte_checkpoint_globals.req_hnp)) {
|
||||
char *args = NULL;
|
||||
args = opal_cmd_line_get_usage_msg(&cmd_line);
|
||||
opal_show_help("help-orte-checkpoint.txt", "usage", true,
|
||||
args);
|
||||
free(args);
|
||||
exit_status = ORTE_ERROR;
|
||||
if (0 >= argc && ORTE_JOBID_INVALID == orte_checkpoint_globals.req_hnp) {
|
||||
fprintf(stderr, "%s: Nothing to do\n", argv0);
|
||||
fprintf(stderr, "Type '%s --help' for usage.\n", argv0);
|
||||
exit_status = 1;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@ -482,6 +507,10 @@ static int parse_args(int argc, char *argv[]) {
|
||||
}
|
||||
|
||||
cleanup:
|
||||
if (NULL != argv0) {
|
||||
free(argv0);
|
||||
}
|
||||
|
||||
return exit_status;
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,7 @@
|
||||
# University of Stuttgart. All rights reserved.
|
||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
# All rights reserved.
|
||||
# Copyright (c) 2012 Cisco Systems, Inc. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
@ -23,4 +24,3 @@ ompi-clean [OPTIONS]
|
||||
Open MPI Runtime Environment Cleaning tool
|
||||
|
||||
%s
|
||||
|
||||
|
@ -12,6 +12,7 @@
|
||||
* Copyright (c) 2007-2008 Sun Microsystems, Inc. All rights reserved.
|
||||
* Copyright (c) 2007 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -56,10 +57,11 @@
|
||||
#include "opal/util/opal_environ.h"
|
||||
#include "opal/util/os_dirpath.h"
|
||||
#include "opal/util/basename.h"
|
||||
#include "opal/util/error.h"
|
||||
#include "opal/mca/base/base.h"
|
||||
#include "opal/mca/base/mca_base_param.h"
|
||||
#include "opal/util/show_help.h"
|
||||
|
||||
#include "orte/util/show_help.h"
|
||||
#include "orte/util/proc_info.h"
|
||||
|
||||
#include "opal/runtime/opal.h"
|
||||
@ -200,19 +202,31 @@ static int parse_args(int argc, char *argv[]) {
|
||||
* Initialize list of available command line options.
|
||||
*/
|
||||
opal_cmd_line_create(&cmd_line, cmd_line_opts);
|
||||
ret = opal_cmd_line_parse(&cmd_line, true, argc, argv);
|
||||
ret = opal_cmd_line_parse(&cmd_line, false, argc, argv);
|
||||
|
||||
if (OPAL_SUCCESS != ret) {
|
||||
if (OPAL_ERR_SILENT != ret) {
|
||||
fprintf(stderr, "%s: command line error (%s)\n", argv[0],
|
||||
opal_strerror(ret));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Now start parsing our specific arguments
|
||||
*/
|
||||
if (OPAL_SUCCESS != ret ||
|
||||
orte_clean_globals.help) {
|
||||
char *args = NULL;
|
||||
if (orte_clean_globals.help) {
|
||||
char *str, *args = NULL;
|
||||
args = opal_cmd_line_get_usage_msg(&cmd_line);
|
||||
orte_show_help("help-orte-clean.txt", "usage", true,
|
||||
args);
|
||||
str = opal_show_help_string("help-orte-clean.txt", "usage", true,
|
||||
args);
|
||||
if (NULL != str) {
|
||||
printf("%s", str);
|
||||
free(str);
|
||||
}
|
||||
free(args);
|
||||
return ORTE_ERROR;
|
||||
/* If we show the help message, that should be all we do */
|
||||
exit(0);
|
||||
}
|
||||
|
||||
OBJ_DESTRUCT(&cmd_line);
|
||||
|
@ -10,7 +10,7 @@
|
||||
# University of Stuttgart. All rights reserved.
|
||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
# All rights reserved.
|
||||
# Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
||||
# Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
@ -25,6 +25,7 @@ The orte-info command can be used to provide detailed information on
|
||||
your ORTE installation. Syntax:
|
||||
|
||||
%s
|
||||
#
|
||||
[lib-call-fail]
|
||||
A library call unexpectedly failed. This is a terminal error; please
|
||||
show this message to an ORTE wizard:
|
||||
|
@ -9,7 +9,7 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copryight (c) 2007-2010 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2007-2012 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2010 Los Alamos National Security, LLC.
|
||||
* All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
@ -40,9 +40,12 @@
|
||||
#include "opal/class/opal_pointer_array.h"
|
||||
#include "opal/runtime/opal.h"
|
||||
#include "opal/util/cmd_line.h"
|
||||
#include "opal/util/error.h"
|
||||
#include "opal/util/argv.h"
|
||||
#include "opal/mca/base/base.h"
|
||||
#include "opal/util/show_help.h"
|
||||
|
||||
#include "orte/constants.h"
|
||||
#include "orte/util/show_help.h"
|
||||
#include "orte/runtime/orte_locks.h"
|
||||
|
||||
@ -142,18 +145,30 @@ int main(int argc, char *argv[])
|
||||
|
||||
/* Do the parsing */
|
||||
|
||||
if (ORTE_SUCCESS != opal_cmd_line_parse(orte_info_cmd_line, false, argc, argv)) {
|
||||
ret = opal_cmd_line_parse(orte_info_cmd_line, false, argc, argv);
|
||||
if (OPAL_SUCCESS != ret) {
|
||||
if (OPAL_ERR_SILENT != ret) {
|
||||
fprintf(stderr, "%s: command line error (%s)\n", argv[0],
|
||||
opal_strerror(ret));
|
||||
}
|
||||
cmd_error = true;
|
||||
}
|
||||
if (!cmd_error &&
|
||||
(opal_cmd_line_is_taken(orte_info_cmd_line, "help") ||
|
||||
opal_cmd_line_is_taken(orte_info_cmd_line, "h"))) {
|
||||
char *str, *usage;
|
||||
|
||||
want_help = true;
|
||||
usage = opal_cmd_line_get_usage_msg(orte_info_cmd_line);
|
||||
str = opal_show_help_string("help-orte-info.txt", "usage", true,
|
||||
usage);
|
||||
if (NULL != str) {
|
||||
printf("%s", str);
|
||||
free(str);
|
||||
}
|
||||
free(usage);
|
||||
}
|
||||
if (cmd_error || want_help) {
|
||||
char *usage = opal_cmd_line_get_usage_msg(orte_info_cmd_line);
|
||||
orte_show_help("help-orte-info.txt", "usage", true, usage);
|
||||
free(usage);
|
||||
mca_base_close();
|
||||
OBJ_RELEASE(orte_info_cmd_line);
|
||||
opal_finalize_util();
|
||||
|
@ -4,6 +4,7 @@
|
||||
# University Research and Technology
|
||||
# Corporation. All rights reserved.
|
||||
#
|
||||
# Copyright (c) 2012 Cisco Systems, Inc. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
@ -17,12 +18,12 @@ ompi-migrate PID_OF_MPIRUN
|
||||
Open MPI Process Migration Tool
|
||||
|
||||
%s
|
||||
|
||||
#
|
||||
[invalid_pid]
|
||||
Error: The PID (%d) is invalid because either you have not provided a PID
|
||||
or provided an invalid PID.
|
||||
Please see --help for usage.
|
||||
|
||||
#
|
||||
[no_universe]
|
||||
Error: Unable to find the contact information for PID %d.
|
||||
This could be due to one of the following:
|
||||
@ -31,7 +32,7 @@ Error: Unable to find the contact information for PID %d.
|
||||
- The application with this PID isn't an Open MPI application.
|
||||
ompi-migrate attempted to find the session directory:
|
||||
%s
|
||||
|
||||
#
|
||||
[unable_to_connect]
|
||||
Error: Unable to connect to the Head Node Process to initiate the
|
||||
migration of the application.
|
||||
@ -39,16 +40,17 @@ Error: Unable to connect to the Head Node Process to initiate the
|
||||
- The PID is not that of an active MPIRUN.
|
||||
- The application with this PID isn't migratable
|
||||
- The application with this PID isn't an Open MPI application.
|
||||
|
||||
#
|
||||
[not_impl]
|
||||
The following feature was requested, but is not currently implemented.
|
||||
%s
|
||||
If you require this feature contact the Open MPI development group.
|
||||
|
||||
#
|
||||
[err-inprogress]
|
||||
Error: The Job identified by PID (%d) is currently migrating other processes.
|
||||
Only one migration request can be processed at a time. Please try again
|
||||
later.
|
||||
#
|
||||
[err-other]
|
||||
Error: The Job identified by PID (%d) was not able to migrate processes in this
|
||||
job. This could be caused by any of the following:
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Copyright (c) 2009-2010 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
*
|
||||
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -245,6 +245,7 @@ static int parse_args(int argc, char *argv[]) {
|
||||
opal_cmd_line_t cmd_line;
|
||||
char **app_env = NULL, **global_env = NULL;
|
||||
char * tmp_env_var = NULL;
|
||||
char *argv0 = NULL;
|
||||
|
||||
/* Init structure */
|
||||
memset(&orte_migrate_globals, 0, sizeof(orte_migrate_globals_t));
|
||||
@ -258,12 +259,52 @@ static int parse_args(int argc, char *argv[]) {
|
||||
orte_migrate_globals.off_procs = NULL;
|
||||
orte_migrate_globals.onto_nodes = NULL;
|
||||
|
||||
#if OPAL_ENABLE_FT_CR == 0
|
||||
/* Warn and exit if not configured with Migrate/Restart */
|
||||
{
|
||||
char *str, *args = NULL;
|
||||
args = opal_cmd_line_get_usage_msg(&cmd_line);
|
||||
str = opal_show_help_string("help-orte-migrate.txt", "usage-no-cr",
|
||||
true, args);
|
||||
if (NULL != str) {
|
||||
printf("%s", str);
|
||||
free(str);
|
||||
}
|
||||
free(args);
|
||||
exit_status = ORTE_ERROR;
|
||||
goto cleanup;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Parse the command line options */
|
||||
opal_cmd_line_create(&cmd_line, cmd_line_opts);
|
||||
mca_base_open();
|
||||
mca_base_cmd_line_setup(&cmd_line);
|
||||
ret = opal_cmd_line_parse(&cmd_line, true, argc, argv);
|
||||
ret = opal_cmd_line_parse(&cmd_line, false, argc, argv);
|
||||
|
||||
if (OPAL_SUCCESS != ret) {
|
||||
if (OPAL_ERR_SILENT != ret) {
|
||||
fprintf(stderr, "%s: command line error (%s)\n", argv[0],
|
||||
opal_strerror(ret));
|
||||
}
|
||||
exit_status = 1;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (orte_migrate_globals.help) {
|
||||
char *str, *args = NULL;
|
||||
args = opal_cmd_line_get_usage_msg(&cmd_line);
|
||||
str = opal_show_help_string("help-orte-migrate.txt", "usage", true,
|
||||
args);
|
||||
if (NULL != str) {
|
||||
printf("%s", str);
|
||||
free(str);
|
||||
}
|
||||
free(args);
|
||||
/* If we show the help message, that should be all we do */
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Put all of the MCA arguments in the environment
|
||||
*/
|
||||
@ -290,31 +331,14 @@ static int parse_args(int argc, char *argv[]) {
|
||||
* Now start parsing our specific arguments
|
||||
*/
|
||||
/* get the remaining bits */
|
||||
argv0 = strdup(argv[0]);
|
||||
opal_cmd_line_get_tail(&cmd_line, &argc, &argv);
|
||||
|
||||
#if OPAL_ENABLE_FT_CR == 0
|
||||
/* Warn and exit if not configured with Migrate/Restart */
|
||||
{
|
||||
char *args = NULL;
|
||||
args = opal_cmd_line_get_usage_msg(&cmd_line);
|
||||
opal_show_help("help-orte-migrate.txt", "usage-no-cr",
|
||||
true, args);
|
||||
free(args);
|
||||
exit_status = ORTE_ERROR;
|
||||
goto cleanup;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (OPAL_SUCCESS != ret ||
|
||||
orte_migrate_globals.help ||
|
||||
0 >= argc ||
|
||||
(NULL == orte_migrate_globals.off_nodes && NULL == orte_migrate_globals.off_procs) ) {
|
||||
char *args = NULL;
|
||||
args = opal_cmd_line_get_usage_msg(&cmd_line);
|
||||
opal_show_help("help-orte-migrate.txt", "usage", true,
|
||||
args);
|
||||
free(args);
|
||||
exit_status = ORTE_ERROR;
|
||||
if (NULL == orte_migrate_globals.off_nodes &&
|
||||
NULL == orte_migrate_globals.off_procs) {
|
||||
fprintf(stderr, "%s: Nothing to do\n", argv0);
|
||||
fprintf(stderr, "Type '%s --help' for usage.\n", argv0);
|
||||
exit_status = 1;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@ -331,7 +355,10 @@ static int parse_args(int argc, char *argv[]) {
|
||||
* supply the PID of MPIRUN
|
||||
*/
|
||||
if(0 >= argc ) {
|
||||
exit_status = ORTE_SUCCESS;
|
||||
fprintf(stderr, "%s: Nothing to do\n", argv[0]);
|
||||
fprintf(stderr, "Type '%s --help' for usage.\n", argv[0]);
|
||||
|
||||
exit_status = ORTE_ERROR;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@ -352,6 +379,10 @@ static int parse_args(int argc, char *argv[]) {
|
||||
}
|
||||
|
||||
cleanup:
|
||||
if (NULL != argv0) {
|
||||
free(argv0);
|
||||
}
|
||||
|
||||
return exit_status;
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,7 @@
|
||||
# University of Stuttgart. All rights reserved.
|
||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
# All rights reserved.
|
||||
# Copyright (c) 2012 Cisco Systems, Inc. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
@ -23,14 +24,18 @@ ompi-ps [OPTIONS]
|
||||
Open MPI Job and Process Status Tool
|
||||
|
||||
%s
|
||||
|
||||
#
|
||||
[vpid-usage]
|
||||
Error: You specified a vpid (%d) without also specifying a jobid.
|
||||
Use the '-j' option to specify a jobid.
|
||||
|
||||
#
|
||||
[need-vpid]
|
||||
Error: You specified a jobid (%d) without also specifying a vpid.
|
||||
Use the '-p' option to specify a vpid.
|
||||
#
|
||||
[invalid-vpid]
|
||||
Error: The specified vpid (%d) is not valid for job %d.
|
||||
|
||||
#
|
||||
[stale-hnp]
|
||||
An attempt was made to obtain ps information from a non-responsive
|
||||
HNP:
|
||||
|
@ -9,7 +9,7 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
|
||||
* Copyright (c) 2007 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
@ -58,6 +58,7 @@
|
||||
#include "opal/util/cmd_line.h"
|
||||
#include "opal/util/output.h"
|
||||
#include "opal/util/opal_environ.h"
|
||||
#include "opal/util/show_help.h"
|
||||
#include "opal/mca/base/base.h"
|
||||
#include "opal/mca/base/mca_base_param.h"
|
||||
#include "opal/runtime/opal.h"
|
||||
@ -327,29 +328,38 @@ static int parse_args(int argc, char *argv[]) {
|
||||
|
||||
mca_base_open();
|
||||
mca_base_cmd_line_setup(&cmd_line);
|
||||
ret = opal_cmd_line_parse(&cmd_line, true, argc, argv);
|
||||
ret = opal_cmd_line_parse(&cmd_line, false, argc, argv);
|
||||
|
||||
if (OPAL_SUCCESS != ret) {
|
||||
if (OPAL_ERR_SILENT != ret) {
|
||||
fprintf(stderr, "%s: command line error (%s)\n", argv[0],
|
||||
opal_strerror(ret));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Now start parsing our specific arguments
|
||||
*/
|
||||
if (OPAL_SUCCESS != ret ||
|
||||
orte_ps_globals.help) {
|
||||
char *args = NULL;
|
||||
if (orte_ps_globals.help) {
|
||||
char *str, *args = NULL;
|
||||
args = opal_cmd_line_get_usage_msg(&cmd_line);
|
||||
orte_show_help("help-orte-ps.txt", "usage", true,
|
||||
args);
|
||||
str = opal_show_help_string("help-orte-ps.txt", "usage", true,
|
||||
args);
|
||||
if (NULL != str) {
|
||||
printf("%s", str);
|
||||
free(str);
|
||||
}
|
||||
free(args);
|
||||
return ORTE_ERROR;
|
||||
/* If we show the help message, that should be all we do */
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/* if the jobid is given, then we need a pid */
|
||||
if (ORTE_JOBID_WILDCARD != orte_ps_globals.jobid &&
|
||||
0 == orte_ps_globals.pid) {
|
||||
char *args = NULL;
|
||||
args = opal_cmd_line_get_usage_msg(&cmd_line);
|
||||
orte_show_help("help-orte-ps.txt", "usage", true,
|
||||
args);
|
||||
free(args);
|
||||
orte_show_help("help-orte-ps.txt", "need-vpid", true,
|
||||
orte_ps_globals.jobid);
|
||||
return ORTE_ERROR;
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,7 @@
|
||||
# University of Stuttgart. All rights reserved.
|
||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
# All rights reserved.
|
||||
# Copyright (c) 2012 Cisco Systems, Inc. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
@ -23,7 +24,7 @@ ompi-restart GLOBAL_SNAPSHOT_REF
|
||||
Open MPI Parallel Job Restart Tool
|
||||
|
||||
%s
|
||||
|
||||
#
|
||||
[usage-no-cr]
|
||||
This build of Open MPI does *not* include Checkpoint/Restart functionality.
|
||||
If you require this functionality re-configure Open MPI with the proper
|
||||
@ -33,7 +34,7 @@ ompi-restart GLOBAL_SNAPSHOT_REF
|
||||
Open MPI Parallel Job Restart Tool
|
||||
|
||||
%s
|
||||
|
||||
#
|
||||
[invalid_filename]
|
||||
Error: The filename provided (referenced below) could not be used for
|
||||
restarting the job. This could be for a variety of reasons:
|
||||
@ -43,28 +44,28 @@ Error: The filename provided (referenced below) could not be used for
|
||||
Please see --help for usage.
|
||||
|
||||
Filename: %s
|
||||
|
||||
#
|
||||
[restart_cmd_failure]
|
||||
Error: Unable to obtain the proper restart command to restart from the
|
||||
checkpoint file (%s). Returned %d.
|
||||
|
||||
#
|
||||
[comp_select_failure]
|
||||
Error: Unable to select the %s component needed to restart this
|
||||
application. (Returned %d)
|
||||
This likely indicates that the checkpointer needed is not
|
||||
available on this machine. You should move to a machine that
|
||||
has this checkpointer enabled.
|
||||
|
||||
#
|
||||
[restart_failure]
|
||||
Error: The restart command:
|
||||
shell$ %s
|
||||
returned an error code %d, and was unable to restart properly.
|
||||
|
||||
#
|
||||
[invalid_seq_num]
|
||||
Error: The filename (%s) and sequence number (%d) could not be used.
|
||||
This may be caused by an invalid sequence number. Try using the
|
||||
'-i' option to determine a correct value.
|
||||
|
||||
#
|
||||
[amca_param_not_found]
|
||||
Warning: Unable to find the AMCA parameter in the checkpoint metadata.
|
||||
This is the option supplied to mpirun as '-am '. Restart will
|
||||
|
@ -11,6 +11,7 @@
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2007 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -55,6 +56,7 @@
|
||||
#include "opal/util/argv.h"
|
||||
#include "opal/util/opal_environ.h"
|
||||
#include "opal/util/basename.h"
|
||||
#include "opal/util/error.h"
|
||||
#include "opal/util/path.h"
|
||||
#include "opal/mca/base/base.h"
|
||||
#include "opal/mca/base/mca_base_param.h"
|
||||
@ -398,6 +400,7 @@ static int parse_args(int argc, char *argv[])
|
||||
opal_cmd_line_t cmd_line;
|
||||
char **app_env = NULL, **global_env = NULL;
|
||||
char * tmp_env_var = NULL;
|
||||
char *argv0 = NULL;
|
||||
orte_restart_globals_t tmp = { false, /* help */
|
||||
NULL, /* filename */
|
||||
NULL, /* appfile */
|
||||
@ -416,6 +419,22 @@ static int parse_args(int argc, char *argv[])
|
||||
orte_restart_globals.enable_crdebug = false;
|
||||
#endif
|
||||
|
||||
#if OPAL_ENABLE_FT_CR == 0
|
||||
/* Warn and exit if not configured with Checkpoint/Restart */
|
||||
{
|
||||
char *str, *args = NULL;
|
||||
args = opal_cmd_line_get_usage_msg(&cmd_line);
|
||||
str = opal_show_help_string("help-orte-restart.txt", "usage-no-cr",
|
||||
true, args);
|
||||
if (NULL != str) {
|
||||
printf("%s", str);
|
||||
free(str);
|
||||
}
|
||||
free(args);
|
||||
return ORTE_ERROR;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Parse the command line options */
|
||||
opal_cmd_line_create(&cmd_line, cmd_line_opts);
|
||||
|
||||
@ -423,6 +442,28 @@ static int parse_args(int argc, char *argv[])
|
||||
mca_base_cmd_line_setup(&cmd_line);
|
||||
ret = opal_cmd_line_parse(&cmd_line, true, argc, argv);
|
||||
|
||||
if (OPAL_SUCCESS != ret) {
|
||||
if (OPAL_ERR_SILENT != ret) {
|
||||
fprintf(stderr, "%s: command line error (%s)\n", argv[0],
|
||||
opal_strerror(ret));
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (orte_restart_globals.help) {
|
||||
char *str, *args = NULL;
|
||||
args = opal_cmd_line_get_usage_msg(&cmd_line);
|
||||
str = opal_show_help_string("help-orte-restart.txt", "usage", true,
|
||||
args);
|
||||
if (NULL != str) {
|
||||
printf("%s", str);
|
||||
free(str);
|
||||
}
|
||||
free(args);
|
||||
/* If we show the help message, that should be all we do */
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Put all of the MCA arguments in the environment
|
||||
*/
|
||||
@ -449,45 +490,22 @@ static int parse_args(int argc, char *argv[])
|
||||
* Now start parsing our specific arguments
|
||||
*/
|
||||
|
||||
#if OPAL_ENABLE_FT_CR == 0
|
||||
/* Warn and exit if not configured with Checkpoint/Restart */
|
||||
{
|
||||
char *args = NULL;
|
||||
args = opal_cmd_line_get_usage_msg(&cmd_line);
|
||||
opal_show_help("help-orte-restart.txt", "usage-no-cr",
|
||||
true, args);
|
||||
free(args);
|
||||
return ORTE_ERROR;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (OPAL_SUCCESS != ret ||
|
||||
orte_restart_globals.help ||
|
||||
1 >= argc) {
|
||||
char *args = NULL;
|
||||
args = opal_cmd_line_get_usage_msg(&cmd_line);
|
||||
opal_show_help("help-orte-restart.txt", "usage", true,
|
||||
args);
|
||||
free(args);
|
||||
return ORTE_ERROR;
|
||||
}
|
||||
|
||||
/* get the remaining bits */
|
||||
argv0 = strdup(argv[0]);
|
||||
opal_cmd_line_get_tail(&cmd_line, &argc, &argv);
|
||||
if ( 1 > argc ) {
|
||||
char *args = NULL;
|
||||
args = opal_cmd_line_get_usage_msg(&cmd_line);
|
||||
opal_show_help("help-orte-restart.txt", "usage", true,
|
||||
args);
|
||||
free(args);
|
||||
if (0 == argc) {
|
||||
fprintf(stderr, "%s: Nothing to do\n", argv0);
|
||||
fprintf(stderr, "Type '%s --help' for usge.\n", argv0);
|
||||
free(argv0);
|
||||
return ORTE_ERROR;
|
||||
}
|
||||
free(argv0);
|
||||
|
||||
orte_restart_globals.snapshot_ref = strdup(argv[0]);
|
||||
if ( NULL == orte_restart_globals.snapshot_ref ||
|
||||
0 >= strlen(orte_restart_globals.snapshot_ref) ) {
|
||||
opal_show_help("help-orte-restart.txt", "invalid_filename", true,
|
||||
orte_restart_globals.snapshot_ref);
|
||||
"<none provided>");
|
||||
return ORTE_ERROR;
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,7 @@
|
||||
# University of Stuttgart. All rights reserved.
|
||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
# All rights reserved.
|
||||
# Copyright (c) 2012 Cisco Systems, Inc. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
@ -29,12 +30,10 @@ Usage: %s [OPTIONS]
|
||||
We could not find an mpirun matching the provided pid on this machine.
|
||||
|
||||
Pid provided: %d
|
||||
|
||||
#
|
||||
[orte-top:no-contact-given]
|
||||
This tool requires that you specify contact info for the mpirun executing
|
||||
the specified rank(s). Please use the --help option for more information.
|
||||
|
||||
#
|
||||
[orte-top:hnp-filename-bad]
|
||||
We are unable to parse the filename where contact info for the
|
||||
|
@ -9,7 +9,7 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2007-2012 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2007 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
@ -39,9 +39,10 @@
|
||||
|
||||
#include "opal/util/cmd_line.h"
|
||||
#include "opal/util/argv.h"
|
||||
#include "opal/util/show_help.h"
|
||||
#include "opal/util/opal_environ.h"
|
||||
#include "opal/dss/dss.h"
|
||||
#include "opal/mca/base/base.h"
|
||||
#include "opal/util/opal_environ.h"
|
||||
#include "opal/runtime/opal.h"
|
||||
#include "opal/mca/event/event.h"
|
||||
|
||||
@ -240,17 +241,30 @@ main(int argc, char *argv[])
|
||||
|
||||
mca_base_open();
|
||||
mca_base_cmd_line_setup(&cmd_line);
|
||||
ret = opal_cmd_line_parse(&cmd_line, true, argc, argv);
|
||||
ret = opal_cmd_line_parse(&cmd_line, false, argc, argv);
|
||||
if (OPAL_SUCCESS != ret) {
|
||||
if (OPAL_ERR_SILENT != ret) {
|
||||
fprintf(stderr, "%s: command line error (%s)\n", argv[0],
|
||||
opal_strerror(ret));
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Now start parsing our specific arguments
|
||||
*/
|
||||
if (OPAL_SUCCESS != ret || help) {
|
||||
char *args = NULL;
|
||||
if (help) {
|
||||
char *str, *args = NULL;
|
||||
args = opal_cmd_line_get_usage_msg(&cmd_line);
|
||||
orte_show_help("help-orte-top.txt", "orte-top:usage", true, "orte-top", args);
|
||||
str = opal_show_help_string("help-orte-top.txt", "orte-top:usage",
|
||||
true, "orte-top", args);
|
||||
if (NULL != str) {
|
||||
printf("%s", str);
|
||||
free(str);
|
||||
}
|
||||
free(args);
|
||||
return ORTE_ERROR;
|
||||
/* If we show the help message, that should be all we do */
|
||||
return 0;
|
||||
}
|
||||
|
||||
/***************************
|
||||
|
@ -10,7 +10,7 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2006-2011 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2007-2009 Sun Microsystems, Inc. All rights reserved.
|
||||
* Copyright (c) 2007-2012 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
@ -67,7 +67,7 @@
|
||||
#include "opal/util/cmd_line.h"
|
||||
#include "opal/util/opal_environ.h"
|
||||
#include "opal/util/opal_getcwd.h"
|
||||
#include "orte/util/show_help.h"
|
||||
#include "opal/util/show_help.h"
|
||||
#include "opal/sys/atomic.h"
|
||||
#if OPAL_ENABLE_FT_CR == 1
|
||||
#include "opal/runtime/opal_cr.h"
|
||||
@ -84,6 +84,7 @@
|
||||
#include "orte/util/pre_condition_transports.h"
|
||||
#include "orte/util/session_dir.h"
|
||||
#include "orte/util/hnp_contact.h"
|
||||
#include "orte/util/show_help.h"
|
||||
|
||||
#include "orte/mca/odls/odls.h"
|
||||
#include "orte/mca/plm/plm.h"
|
||||
@ -546,8 +547,12 @@ int orterun(int argc, char *argv[])
|
||||
init_globals();
|
||||
opal_cmd_line_create(&cmd_line, cmd_line_init);
|
||||
mca_base_cmd_line_setup(&cmd_line);
|
||||
if (ORTE_SUCCESS != (rc = opal_cmd_line_parse(&cmd_line, true,
|
||||
if (OPAL_SUCCESS != (rc = opal_cmd_line_parse(&cmd_line, true,
|
||||
argc, argv)) ) {
|
||||
if (OPAL_ERR_SILENT != rc) {
|
||||
fprintf(stderr, "%s: command line error (%s)\n", argv[0],
|
||||
opal_strerror(rc));
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
@ -926,24 +931,27 @@ static int parse_globals(int argc, char* argv[], opal_cmd_line_t *cmd_line)
|
||||
{
|
||||
/* print version if requested. Do this before check for help so
|
||||
that --version --help works as one might expect. */
|
||||
if (orterun_globals.version &&
|
||||
!(1 == argc || orterun_globals.help)) {
|
||||
char *project_name = NULL;
|
||||
if (orterun_globals.version) {
|
||||
char *str, *project_name = NULL;
|
||||
if (0 == strcmp(orte_basename, "mpirun")) {
|
||||
project_name = "Open MPI";
|
||||
} else {
|
||||
project_name = "OpenRTE";
|
||||
}
|
||||
orte_show_help("help-orterun.txt", "orterun:version", false,
|
||||
orte_basename, project_name, OPAL_VERSION,
|
||||
PACKAGE_BUGREPORT);
|
||||
/* if we were the only argument, exit */
|
||||
if (2 == argc) exit(0);
|
||||
str = opal_show_help_string("help-orterun.txt", "orterun:version",
|
||||
false,
|
||||
orte_basename, project_name, OPAL_VERSION,
|
||||
PACKAGE_BUGREPORT);
|
||||
if (NULL != str) {
|
||||
printf("%s", str);
|
||||
free(str);
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/* Check for help request */
|
||||
if (1 == argc || orterun_globals.help) {
|
||||
char *args = NULL;
|
||||
if (orterun_globals.help) {
|
||||
char *str, *args = NULL;
|
||||
char *project_name = NULL;
|
||||
if (0 == strcmp(orte_basename, "mpirun")) {
|
||||
project_name = "Open MPI";
|
||||
@ -951,10 +959,14 @@ static int parse_globals(int argc, char* argv[], opal_cmd_line_t *cmd_line)
|
||||
project_name = "OpenRTE";
|
||||
}
|
||||
args = opal_cmd_line_get_usage_msg(cmd_line);
|
||||
orte_show_help("help-orterun.txt", "orterun:usage", false,
|
||||
orte_basename, project_name, OPAL_VERSION,
|
||||
orte_basename, args,
|
||||
PACKAGE_BUGREPORT);
|
||||
str = opal_show_help_string("help-orterun.txt", "orterun:usage", false,
|
||||
orte_basename, project_name, OPAL_VERSION,
|
||||
orte_basename, args,
|
||||
PACKAGE_BUGREPORT);
|
||||
if (NULL != str) {
|
||||
printf("%s", str);
|
||||
free(str);
|
||||
}
|
||||
free(args);
|
||||
|
||||
/* If someone asks for help, that should be all we do */
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user