1
1
mpirun/orterun now has an option to print the version number.  If -V/--version
is given, it will print the version number.  If it's the only option, we
exit cleanly.  Otherwise, we continue on as if --version wasn't given
(except we've printed the version number).
--This line, and th se below, will be ignored--

M    orte/tools/orterun/orterun.c
M    orte/tools/orterun/help-orterun.txt

This commit was SVN r10276.
Этот коммит содержится в:
Brian Barrett 2006-06-09 17:21:23 +00:00
родитель a7e849f58b
Коммит 5c89dc6946
2 изменённых файлов: 23 добавлений и 0 удалений

Просмотреть файл

@ -26,6 +26,8 @@ Usage: %s [OPTION]... [PROGRAM]...
Start the given program using Open RTE
%s
[orterun:version]
%s (%s) %s
[orterun:allocate-resources]
%s was unable to allocate enough resources to start your application.
This might be a transient error (too many nodes in the cluster were

Просмотреть файл

@ -50,6 +50,7 @@
#include "opal/util/output.h"
#include "opal/util/show_help.h"
#include "opal/util/trace.h"
#include "opal/version.h"
#include "orte/orte_constants.h"
@ -102,6 +103,7 @@ static char **global_mca_env = NULL;
*/
struct globals_t {
bool help;
bool version;
bool verbose;
bool exit;
bool no_wait_for_job_completion;
@ -132,6 +134,9 @@ opal_cmd_line_init_t cmd_line_init[] = {
{ NULL, NULL, NULL, 'h', NULL, "help", 0,
&orterun_globals.help, OPAL_CMD_LINE_TYPE_BOOL,
"This help message" },
{ NULL, NULL, NULL, 'V', NULL, "version", 0,
&orterun_globals.version, OPAL_CMD_LINE_TYPE_BOOL,
"Print version and exit" },
{ NULL, NULL, NULL, 'v', NULL, "verbose", 0,
&orterun_globals.verbose, OPAL_CMD_LINE_TYPE_BOOL,
"Be verbose" },
@ -787,6 +792,7 @@ static int init_globals(void)
false,
false,
false,
false,
0,
0,
NULL,
@ -829,6 +835,21 @@ static int parse_globals(int argc, char* argv[])
return ret;
}
/* print version if requested. Do this before check for help so
that --version --help works as one might expect. */
if (orterun_globals.version) {
char *project_name = NULL;
if (0 == strcmp(orterun_basename, "mpirun")) {
project_name = "Open MPI";
} else {
project_name = "OpenRTE";
}
opal_show_help("help-orterun.txt", "orterun:version", false,
orterun_basename, project_name, OPAL_VERSION);
/* if we were the only argument, exit */
if (2 == argc) exit(0);
}
/* Check for help request */
if (1 == argc || orterun_globals.help) {