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 reduced_diags general input #5479

Conversation

dpgrote
Copy link
Member

@dpgrote dpgrote commented Nov 21, 2024

This PR adds the reduced_diags input parameter group that allows setting of parameters common to all reduced diagnostics. For example 'reduced_diags.intervals` can be set once rather than having to set it for each individual reduced diagnostic.

@dpgrote dpgrote added the component: diagnostics all types of outputs label Nov 21, 2024
Copy link
Member

Choose a reason for hiding this comment

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

Unfortunately, I think ubuntu-23.10 is not an available runner: https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories. This might explain why the CI jobs are not starting.

I'm trying to remove the container and use ubuntu-24.04 in #5474, but I'm finding new bugs that I haven't been able to fix yet.

Copy link
Member

@roelof-groenewald roelof-groenewald left a comment

Choose a reason for hiding this comment

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

Thanks! These are helpful updates. In a follow-up PR we can also extend the picmi inputs to make use of this.
Once the clang_sanitizers.yml changes have been reverted we can merge.

Copy link
Member

Choose a reason for hiding this comment

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

@dpgrote I guess the changes to this file can be reverted now that the sanitizer tests have been fixed / disabled.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point about adding this to picmi. So it doesn't get forgotten, I'll add it to this PR. And I'll undo the change in the workflows script.

Copy link
Member Author

Choose a reason for hiding this comment

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

Though, looking at the picmi interface, this doesn't really apply there since each diagnostic is setup separately. There isn't a clear way to set a parameter for all reduced diagnostics. Do you have any suggestions?

Copy link
Member

@roelof-groenewald roelof-groenewald Dec 4, 2024

Choose a reason for hiding this comment

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

One option would be to add arguments to Simulation that set global diagnostic parameters (period and output directory, etc.). These parameters could then be passed along to diagnostic_initialize_inputs() to be used if the individual diagnostic did not have a value set. It will require changing some defaults, since currently the default period for reduced diagnostics is 1, but I guess we'd have to change it to None in order to check if a value was set.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, that could work. It can be a bit simpler too since Simulation could directly set the parameters, e.g. reduced_diags.intervals.

BTW, the default for the period in ReducedDiagnostic should be None anyway so that it doesn't override the default set in C++.

Comment on lines +2926 to +2931
reduced_diags = pywarpx.warpx.get_bucket("reduced_diags")
reduced_diags.path = self.reduced_diags_path
reduced_diags.extension = self.reduced_diags_extension
reduced_diags.intervals = self.reduced_diags_intervals
reduced_diags.separator = self.reduced_diags_separator
reduced_diags.precision = self.reduced_diags_precision
Copy link
Member

Choose a reason for hiding this comment

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

Nice! This is even cleaner than my original suggestion 🎉

@roelof-groenewald roelof-groenewald enabled auto-merge (squash) December 4, 2024 19:47
@roelof-groenewald roelof-groenewald merged commit 9e5346e into ECP-WarpX:development Dec 4, 2024
37 checks passed
@dpgrote dpgrote deleted the add_reduced_diags_general_input branch December 4, 2024 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: diagnostics all types of outputs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants