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

Print summary_callback as finalizer #1783

Open
ranocha opened this issue Dec 18, 2023 · 5 comments
Open

Print summary_callback as finalizer #1783

ranocha opened this issue Dec 18, 2023 · 5 comments

Comments

@ranocha
Copy link
Member

ranocha commented Dec 18, 2023

Since SciML/OrdinaryDiffEq.jl#2061 (comment) just got merged, we could consider printing the output of the summary_callback automatically after finishing solve without having to call it manually. However, I would consider this to be breaking since it will just be annoying to print it twice if it's already called manually.

@JoshuaLampert
Copy link
Member

I like printing the summary_callback automatically after finishing solve. As a side note: I implemented something like this without a finalize function also here. But of course it would be nicer with a proper finalize function.

@ranocha
Copy link
Member Author

ranocha commented Dec 19, 2023

Yeah,

https://github.com/JoshuaLampert/DispersiveShallowWater.jl/blob/492f918f040f3103f9b062d21538d36e9a2c877a/src/callbacks_step/summary.jl#L16-L17

is already nice. However, our default setup is to have the summary callback as first callback. Thus, if we activate it like this in the last step, the report will miss calls to the other callbacks in the final step (such as the final IO etc.). As far as I understand, finalize should be better since it should capture also the last call to other callbacks.

@JoshuaLampert
Copy link
Member

Yes, that's true. That's also why I just opened a PR there to use finalize and it works nicely.

@JoshuaLampert
Copy link
Member

If this is something we want to have in Trixi.jl, I am happy to prepare a PR that can be included in the next breaking release.

@ranocha
Copy link
Member Author

ranocha commented Dec 19, 2023

Let's gather some opinions first. What do @trixi-framework/principal-developers think about this?

Pro

  • No need to call summary_callback() at the end of a simulation manually

Con

  • Requires a new version of OrdinaryDiffEq.jl that supports only Julia v1.9 and newer (not v1.8, the minimum required version we have so far)

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

No branches or pull requests

2 participants