Skip to content
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

use _console for app header #29662

Open
tophmatthews opened this issue Jan 8, 2025 · 3 comments · May be fixed by #29669
Open

use _console for app header #29662

tophmatthews opened this issue Jan 8, 2025 · 3 comments · May be fixed by #29669
Labels
T: task An enhancement to the software.

Comments

@tophmatthews
Copy link
Contributor

tophmatthews commented Jan 8, 2025

Motivation

When running multiapps, a nice color indentation appears for outputs from the sub apps that looks like:

Time Step 0, time = 0

Time Step 1, time = 0.25, dt = 0.25
sub0: 
sub0: Time Step 1, time = 0.25, dt = 0.25
sub0_sub0: 
sub0_sub0: Time Step 1, time = 0.25, dt = 0.25

Some subapps have headers defined in SomeApp::header() const. The current implementation of the header call in MooseApp::setupOptions() gets close by coloring the header and adding :, but misses out on the subapp:

// Print the header, this is as early as possible
  auto hdr = header();
  if (hdr.length() != 0)
  {
    if (multiAppLevel() > 0)
      MooseUtils::indentMessage(_name, hdr);
    Moose::out << hdr << std::endl;
  }

Sometimes there are things in that header that are worth seeing for each sub app instance, so having sub0: output before the header would be nice.

Even other times, it would be nice to suppress it all together.

Design

Change the header output to simply

// Print the header, this is as early as possible
  _console << header() << std::endl;

Second, use command line options to provide a flag to suppress output altogether.

Impact

More consistant multiapps.

@tophmatthews tophmatthews added the T: task An enhancement to the software. label Jan 8, 2025
tophmatthews added a commit to tophmatthews/moose that referenced this issue Jan 8, 2025
@pbehne
Copy link
Contributor

pbehne commented Jan 8, 2025

The current implementation of the header call in MooseApp::setupOptions() gets close by coloring the header and adding :, but misses out on the subapp:

Sometimes there are things in that header that are worth seeing for each sub app instance, so having sub0: output before the header would be nice.

I don't fully understand these statements. Could you please elaborate?

@tophmatthews
Copy link
Contributor Author

tophmatthews commented Jan 8, 2025

Sure. It's basically this:

sub009: Centipede version:  git commit da4a829 on 2024-12-17
sub009: Units:              nanometer, second, kelvin, eV
sub009: Command line:       some_value=2.9276796160740592
sub009: 
sub009: The following total 20 aux variables:

vs this:

: Centipede version:  git commit da4a829 on 2024-12-17
: Units:              nanometer, second, kelvin, eV
: Command line:       some_value=2.9276796160740592
: 
: The following total 20 aux variables:

@tophmatthews
Copy link
Contributor Author

Since some_value might be different depending on which app, I would like to be able to correlate header to subapp number.

tophmatthews added a commit to tophmatthews/moose that referenced this issue Jan 9, 2025
@tophmatthews tophmatthews linked a pull request Jan 9, 2025 that will close this issue
tophmatthews added a commit to tophmatthews/moose that referenced this issue Jan 9, 2025
tophmatthews added a commit to tophmatthews/moose that referenced this issue Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: task An enhancement to the software.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants