Skip to content

ompi_info --help not working #10842

Closed
Closed
@gkatev

Description

@gkatev

Hi, the available command line options to ompi_info are not showing as they are supposed to with the --help flag.

$ ompi_info --help
--------------------------------------------------------------------------
The ompi_info command can be used to provide detailed information on
your Open MPI installation.  Syntax:


For additional mpirun arguments, run 'mpirun --help <category>'

The following categories exist: general (Defaults to this option), debug,
    output, input, mapping, ranking, binding, devel (arguments useful to OMPI
    Developers), compatibility (arguments supported for backwards compatibility),
    launch (arguments to modify launch options), and dvm (Distributed Virtual
    Machine arguments).
--------------------------------------------------------------------------

The command line options should appear right there in the middle after "Syntax:". This happens in main, and I'm also seeing it on my distribution's v4.1.4.

I dug a bit into it, but wasn't sure what the desired way to fix it is.

  • Printing takes place in opal_cmd_line_get_usage_msg()

  • The output type of the help argument (option->clo_otype) is OPAL_CMD_LINE_OTYPE_NULL

  • The problem likely originates in get_help_otype()

    • The return value from it is OPAL_CMD_LINE_OTYPE_GENERAL, which is the reason that the desired code block does not get activated.

It seems there is some confusion in get_help_otype() about the return value when arg = NULL. There are conflicting comments:

/* Initialize to NULL, if it remains so, the user asked for
       "full" help output */
    opal_cmd_line_otype_t otype = OPAL_CMD_LINE_OTYPE_NULL;
   /* If arg is still NULL, give them the General info by default */
    if (NULL == arg) {
        arg = "general";
    }

If I do something like this the problem is solved, but I'm not sure that I should :-)

diff --git a/opal/util/cmd_line.c b/opal/util/cmd_line.c
index 1283d3912f..9c9d54666f 100644
--- a/opal/util/cmd_line.c
+++ b/opal/util/cmd_line.c
@@ -1298,7 +1303,8 @@ static opal_cmd_line_otype_t get_help_otype(opal_cmd_line_t *cmd)
 
     /* If arg is still NULL, give them the General info by default */
     if (NULL == arg) {
-        arg = "general";
+        // arg = "general";
+        return otype;
     }
 
     if (0 == strcmp(arg, "debug")) {

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions