ENH: add -verbose support into argList

- similar to -dry-run handling, can be interrogated from argList,
  which makes it simpler to add into utilities.

- support multiple uses of -dry-run and -verbose to increase the
  level. For example, could have

    someApplication -verbose -verbose

 and inside of the application:

    if (args.verbose() > 2) ...

BUG: error with empty distributed roots specification (fixes #2196)

- previously used the size of distributed roots to transmit if the
  case was running in distributed mode, but this behaves rather poorly
  with bad input. Specifically, the following questionable setup:

      distributed true;
      roots ( /*none*/ );

  Now transmit the ParRunControl distributed() value instead,
  and also emit a gentle warning for the user:

      WARNING: running distributed but did not specify roots!
This commit is contained in:
Mark Olesen
2021-11-05 21:02:21 +01:00
parent c45c649d15
commit 5a121119e6
16 changed files with 249 additions and 135 deletions

View File

@ -553,9 +553,8 @@ int main(int argc, char *argv[])
(
"Evaluate but do not write"
);
argList::addBoolOption
argList::addVerboseOption
(
"verbose",
"Additional verbosity",
true // Advanced option
);
@ -662,9 +661,6 @@ int main(int argc, char *argv[])
#include "createTime.H"
const bool dryrun = args.dryRun();
const bool verbose = args.found("verbose");
const word dictName("setExprFieldsDict");
instantList times = timeSelector::select0(runTime, args);
@ -797,7 +793,7 @@ int main(int argc, char *argv[])
setExprFieldsControl ctrl;
ctrl.dryRun = dryrun;
ctrl.dryRun = args.dryRun();
ctrl.debugParsing = args.found("debug-parser");
ctrl.cacheVariables = !args.found("no-variable-caching");
@ -869,7 +865,7 @@ int main(int argc, char *argv[])
setExprFieldsControl ctrl;
ctrl.dryRun = dryrun;
ctrl.dryRun = args.dryRun();
ctrl.debugParsing = args.found("debug-parser");
ctrl.cacheVariables = !args.found("no-variable-caching");
@ -934,7 +930,7 @@ int main(int argc, char *argv[])
ctrl.useDimensions = bool(dimPtr);
}
if (verbose && !timei)
if (args.verbose() && !timei)
{
// Report once
Info<< "Processing" << dict << nl;