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

Make progress statements a part of time_step! #432

Closed
ali-ramadhan opened this issue Sep 27, 2019 · 5 comments · Fixed by #621
Closed

Make progress statements a part of time_step! #432

ali-ramadhan opened this issue Sep 27, 2019 · 5 comments · Fixed by #621
Labels
feature 🌟 Something new and shiny

Comments

@ali-ramadhan
Copy link
Member

Instead of having us manually print a progress statement in a while loop, maybe we can pass a progress_message(model) function to time_step! that does this.

This should help clean up the scripts a lot, and we could provide a couple of reasonable defaults instead of setting up this functionality in every script.

Eventually the progress_message(model) function can be made fancy as we wish with unicode plots, a curses interface for complex progress output, or even email updates.

@ali-ramadhan ali-ramadhan added the feature 🌟 Something new and shiny label Sep 27, 2019
@glwagner
Copy link
Member

This can also be done with a diagnostic?

@asinghvi17
Copy link
Contributor

If you want to integrate with the Julia "progress bar" system, you could put in something like:

@debug "this is a short description of my loop" progress=iteration/length_of_loop

This works in Juno, and with MicroLogging.jl in the REPL.

@ali-ramadhan
Copy link
Member Author

@glwagner True, we should just make use of the existing infrastructure. We don't have to call it a monitor but seems like this diagnostic would be closer in spirit to NaNChecker than HorizontalAverage.

We might want to have some way of accessing the TimeStepWizard from the diagnostic though. Although this could probably be done with an anonymous function.

@asinghvi17 Thanks for the tip! Had no idea you could pass a progress kwarg to logging macros. Will have to check it out along with #71

@glwagner
Copy link
Member

glwagner commented Oct 7, 2019

It could make sense to have a Simulation type for managing time stepping, including progress messages / utilities for logging output from diagnostics and maybe also plotting, eg

simulation = Simulation(model, dt, stop_time=8day, wall_time_limit=1day, progress=ProgressMessenger(diags=diags), ...)

run!(simulation)

@ali-ramadhan
Copy link
Member Author

I think we agreed that making pretty progress statements with UnicodePlots is not a good use of our time, but just to document the possibilities, here are a couple of packages for pretty printing traces:

https://github.com/jagot/SolverTraces.jl
https://github.com/c42f/TerminalLoggers.jl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 🌟 Something new and shiny
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants