idaholab / moose

Multiphysics Object Oriented Simulation Environment
https://www.mooseframework.org
GNU Lesser General Public License v2.1
1.72k stars 1.04k forks source link

MOOSE App Command Line Option Warning #13297

Open lefebvrera opened 5 years ago

lefebvrera commented 5 years ago

Bug Description

Several (most?) legal command line options produce a warning message indicating it was not used.

Steps to Reproduce

/projects/moose/app/app-opt --help
WARNING! There are options you set that were not used!
WARNING! could be spelling mistake, etc!
Option left: name:--help (no value)
Usage: /projects/app/app-opt [<options>]

I.e., using Argonne's System Analysis Module:

/projects/SAM/sam-opt --version

Application Version: C++03_final-8235-g1468cef582
WARNING! There are options you set that were not used!
WARNING! could be spelling mistake, etc!
Option left: name:--version (no value)

or using Idaho's BISON Fuel Performance code:

/projects/BISON/bison-opt --version

      ,-----.   ,--.
      |  |) /_  `--'  ,---.   ,---.  ,--,--,
      |  .-.  \ ,--. (  .-'  | .-. | |      \
      |  '--' / |  | .-'  `) ' '-' ' |  ||  |
      `------'  `--' `----'   `---'  `--''--'

                   _.-````'-,_
         _,.,_ ,-'`           `'-.,_
       /)     (\                   '``-.
      ((      ) )                      `\
       \)    (_/                        )\
        |       /)           '    ,'    / \
        `\    ^'            '     (    /  ))
          |      _/\ ,     /    ,,`\   (  "`
           \Y,   |  \  \  | ````| / \_ \
             `)_/    \  \  )    ( >  ( >
                      \( \(     |/   |/
                     /_(/_(    /_(  /_(

      Nuclear Fuel Performance Analysis Code
            Idaho National Laboratory
                Idaho Falls, Idaho

    Copyright 2015 Battelle Energy Alliance, LLC
                ALL RIGHTS RESERVED

     Prepared by Battelle Energy Alliance, LLC
        Under Contract No. DE-AC07-05ID14517
        With the U. S. Department of Energy

Command line: /projects/BISON/bison-opt --version
SI units:     meter, kilogram, second, kelvin, mole
...

Application Version: C++03_final-9804-ge2a1c4a
WARNING! There are options you set that were not used!
WARNING! could be spelling mistake, etc!
Option left: name:--version (no value)

Impact

This warning is emitted into the application's standard output. The MOOSE application's coupling to the NEAMS Workbench via the --definition command line option is broken because the WARNING messages cause syntax errors in the resulting processing of the input schematic in the NEAMS Workbench.

These WARNINGS do not appear to be accurate as the command line options are legal.

permcody commented 5 years ago

Yeah - we are aware of this issue. In fact it's one of our very oldest #727.

Those errors come from PETSc. We strip some options from the command line object but not all because we don't always know which options are ours, libMesh's, or PETSc's at the application or even MOOSE level. When they get passed to PETSc, it complains. Several developers have attempted fixes over the years but none of them completely satisfactory. The nasty problem is that PETSc can't know all of the options that it uses until the simulation has been completed. This is because many of the options are processed on-demand as the various modules in PETSc get loaded in used. There is no single up-front pass to do this checking.

That being said, it should be easy enough to fix the most egregious offenders as you've specified here.

@fdkong - Do you have anything to add?

fdkong commented 5 years ago

You are seeing these warnings possibly because you are using the debug version of PETSc. The optimized version of PETSc should not give any warnings.

It is nontrivial to get PETSc print the `right" left options because it is hard to distinguish which options should go to moose, which ones should go to libmesh, and others for PETSc. Even worse, users can define whatever command line options they want to use.

lefebvrera commented 5 years ago

@fdkong you make an interesting note regarding the debug version. @mbairdphys is investigating. He mentioned there appears to be potential that when building some of these MOOSE Apps in RELEASE the PETSc dependency can be built in DEBUG depending on the environment. I haven't heard a final summary. Does this sound familiar?

permcody commented 5 years ago

Yeah - the connection of debug PETSc and debug libMesh/MOOSE are separate and independent. In our package we only build release versions of PETSc so this must be intentional in the environments you are working with.

I think it's still reasonable to remove the parameters from the CLI args that we know about (e.g. MOOSE's parameters), which will remove many of these warnings when users do happen to have debug versions of PETSc. I'll leave this ticket open.