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

Add output:flush_frequency for OptionsNetCDF #2934

Open
wants to merge 7 commits into
base: next
Choose a base branch
from

Conversation

ZedThree
Copy link
Member

@ZedThree ZedThree commented Jul 3, 2024

Sort of fixes #2878

Two things:

  • output:flush_frequency can be used to reduce how often netCDF data is flushed to disk (maybe flush_period is a more accurate name?)
  • the Options used to store data to be written to disk is now reset after writing

These two together can significantly cut the time spent in IO:

Figure_1

(absolute time from the io timer for conduction example for 500 timesteps, rolling average over 100 steps)

The red line is basically current next

I'm a bit concerned that we still get an increase over time, but this seems to unavoidable.

This PR also includes some drive-by fixes for some minor OptionsIO issues.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

@@ -229,13 +230,19 @@ void PhysicsModel::writeOutputFile(const Options& options,
}

void PhysicsModel::finishOutputTimestep() const {
if (output_enabled) {
Timer timer("io");
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: variable 'timer' of type 'Timer' can be declared 'const' [misc-const-correctness]

Suggested change
Timer timer("io");
Timer const timer("io");

@@ -74,7 +76,7 @@ private:
};

namespace {
RegisterOptionsIO<OptionsNetCDF> registeroptionsnetcdf("netcdf");
const RegisterOptionsIO<OptionsNetCDF> registeroptionsnetcdf("netcdf");
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: variable 'registeroptionsnetcdf' defined in a header file; variable definitions in header files can lead to ODR violations [misc-definitions-in-headers]

const RegisterOptionsIO<OptionsNetCDF> registeroptionsnetcdf("netcdf");
                                       ^

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

Successfully merging this pull request may close these issues.

1 participant