Skip to content

mpirun --help output revamp #3231

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 4, 2017

Conversation

nrgraham23
Copy link
Contributor

This commit modifies the output from the mpirun --help
command. The options have been split into groups, to
make the output smaller and more readable. The groups
are: general, debug, output, input, mapping, ranking,
binding, devel, compatibility, launch, dvm, and
unsupported. There is also a special "full" command
that can be used to get the old behaviour of printing
out all of the options. Unsupported options may only
be seen with this full output.

This commit also adds a special case for the help
argument. It makes it possible for the user to
enter 0 or 1 arguments instead of having to always
enter an argument. This defaults to printing out
the "general" help options so the user can then
see what help arguments there are.

Fixes #2931

Signed-off-by: Nathaniel Graham [email protected]

"This help message" },
{ NULL, 'h', NULL, "help", 1,
&orte_cmd_options.help, OPAL_CMD_LINE_TYPE_STRING,
"This help message. Argument options are:\n\t\t\t general - General arguments (Defaults to this option)\n\t\t\t debug - Arguments usefull for debugging\n\t\t\t output - Arguments to modify output options\n\t\t\t input - Arguments to modify input options\n\t\t\t mapping - Mapping arguments\n\t\t\t ranking - Ranking arguments\n\t\t\t binding - Binding arguments\n\t\t\t devel - Arguments usefull to OMPI Developers\n\t\t\t compatibility - Arguments supported for backwards compatibility\n\t\t\t launch - Arguments to modify launch options\n\t\t\t dvm - Distributed Virtual Machine arguments", OPAL_CMD_LINE_OTYPE_GENERAL },
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This message still needs to be cleaned up, but I wanted to get the everything up so people could look at it and comment on it.

@nrgraham23 nrgraham23 requested review from jsquyres and rhc54 March 23, 2017 19:10
@nrgraham23
Copy link
Contributor Author

@jsquyres @rhc54 @hppritcha Please review

@hppritcha
Copy link
Member

@nrgraham23 could you rebase to fix the conflicts?

@nrgraham23
Copy link
Contributor Author

@hppritcha #3242 created the conflict. I have rebased and fixed the help message, so this is good to go unless there is a request for a change.

@hjelmn
Copy link
Member

hjelmn commented Mar 30, 2017

@nrgraham23 For bonus points if you can add a --help-parsable (or something similar) that would be awesome. Right now the completion scripts hand-code the options so need to be updated every time an option is added/removed. You can take a look at ompi_info's parsable output for an example.

If you do that I will totally write bash/zsh completion scripts for all of our user-facing binaries.

@nrgraham23
Copy link
Contributor Author

@hjelmn I will check that out. Probably won't get to it until next week though.

This commit modifies the output from the mpirun --help
command.  The options have been split into groups, to
make the output smaller and more readable.  The groups
are: general, debug, output, input, mapping, ranking,
binding, devel, compatibility, launch, dvm, and
unsupported. There is also a special "full" command
that can be used to get the old behaviour of printing
out all of the options.  Unsupported options may only
be seen with this full output.

This commit also adds a special case for the help
argument.  It makes it possible for the user to
enter 0 or 1 arguments instead of having to always
enter an argument.  This defaults to printing out
the "general" help options so the user can then
see what help arguments there are.

Signed-off-by: Nathaniel Graham <[email protected]>
@nrgraham23 nrgraham23 force-pushed the revamp_mpirun_help branch from 5535078 to 19e5d15 Compare April 4, 2017 17:02
@nrgraham23
Copy link
Contributor Author

Going to merge this afternoon if there are no objections.

@nrgraham23
Copy link
Contributor Author

This has been up for a week, merging now.

@nrgraham23 nrgraham23 merged commit 7063f30 into open-mpi:master Apr 4, 2017
@jsquyres
Copy link
Member

I notice that after this PR, I get output like this:

$ mpirun --help
mpirun (Open MPI) 4.0.0a1

Usage: mpirun [OPTION]...  [PROGRAM]...
Start the given program using Open RTE

   -am <arg0>            Aggregate MCA parameter set file list
   --app <arg0>          Provide an appfile; ignore all other command line
                         options
-c|-np|--np <arg0>       Number of processes to run
   -fwd-mpirun-port|--fwd-mpirun-port 
                         Forward mpirun port to compute node daemons so all
                         will use it
-h|--help <arg0>         Help  messages.  Argument options are: general
                         (Defaults to this option), debug, output, input,
                         mapping, ranking, binding, devel (arguments usefull
                         to OMPI Developers), compatibility (arguments
                         supported for backwards compatibility) launch
                         (arguments to modify launch options), and dvm
                         (Distributed Virtual Machine arguments
   -N <arg0>             Launch n processes per node on all allocated nodes
                         (synonym for npernode)
   -n|--n <arg0>         Number of processes to run
-q|--quiet               Suppress helpful messages
   -report-pid|--report-pid <arg0>  
                         Printout pid on stdout [-], stderr [+], or a file
                         [anything else]
   -report-uri|--report-uri <arg0>  
                         Printout URI on stdout [-], stderr [+], or a file
                         [anything else]
   -tune <arg0>          Application profile options file list
-v|--verbose             Be verbose
-V|--version             Print version and exit
-x <arg0>                Export an environment variable, optionally
                         specifying a value (e.g., "-x foo" exports the
                         environment variable foo and takes its value from
                         the current environment; "-x foo=bar" exports the
                         environment variable name foo and sets its value to
                         "bar" in the started processes)

Report bugs to http://www.open-mpi.org/community/help/

I'm sorry I missed the review period, but I have two questions / observations:

  1. How were the default list of CLI params picked for mpirun --help? Some of them are fairly esoteric, and probably don't need to be in the default listing.
  2. There doesn't seem to be any information on this default help output telling you how to get more information. Can we add something? For example, here's what git does:
$ $ git --help | tail -n 3
'git help -a' and 'git help -g' list available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'
to read about a specific subcommand or concept.

@nrgraham23
Copy link
Contributor Author

1: The default list of options was picked from the "General" category of options from the categories listed in the google doc linked in #2931

2: Currently the optional arguments are listed in the help message:

-h|--help Help messages. Argument options are: general
(Defaults to this option), debug, output, input,
mapping, ranking, binding, devel (arguments usefull
to OMPI Developers), compatibility (arguments
supported for backwards compatibility) launch
(arguments to modify launch options), and dvm
(Distributed Virtual Machine arguments

I was a little surprised no one had any comments on the changes, but I would be happy to make changes.

@jsquyres
Copy link
Member

@nrgraham23 Ah, gotcha on both points. Sorry I missed these points during review. 😦

Let's do two things:

  1. Reclassify some of the params away from general:
    • -am: launch options
    • -app: launch options
    • -fwd-mpirun-port: launch options
    • -N: mapping options (right?) -- also, it's listed as a synonym for a backwards compat option. That should be fixed (is it is synonym for something else?)
    • -report-pid: debugging options
    • -report-uri: debugging options
    • -tune: debugging options
    • -x: launching options
  2. Move the bulk of the -h message (i.e., how to get more help) to a separate output at the bottom, sorta like git.

@nrgraham23
Copy link
Contributor Author

@jsquyres Thats alright. The first changes will be fairly simple. The second change may take a little hacking. I should have time to make the changes and get a PR up tomorrow.

@jsquyres
Copy link
Member

Thank you!

@rhc54 @hppritcha What do you guys think of my re-classifications (above)?

@hppritcha
Copy link
Member

Looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants