Write results also on an interrupt or crash#2191
Merged
SouthEndMusic merged 1 commit intomainfrom Mar 31, 2025
Merged
Conversation
SouthEndMusic
approved these changes
Mar 31, 2025
Merged
visr
added a commit
that referenced
this pull request
Apr 2, 2025
This is a follow-up of #2191. An issue with that is that it logged a warning about crashing simulations also when it succeeded. Also it didn't log the bottlenecks when you interrupt a (hanging) simulation. Now it does both, this is what is shown when interrupting a simulation, stacktrace is clipped off: ``` ┌ Info: Starting a Ribasim simulation. │ toml_path = c:\Users\visser_mn\Downloads\lhm-sel\lhm-sel.toml │ cli.ribasim_version = 2025.2.0 │ starttime = 2020-01-01T00:00:00 │ endtime = 2021-01-01T00:00:00 └ @ Ribasim C:\ProgramData\DevDrives\repo\ribasim\Ribasim\core\src\main.jl:40 ┌ Warning: Simulation crashed or interrupted. └ @ Ribasim C:\ProgramData\DevDrives\repo\ribasim\Ribasim\core\src\main.jl:51 ┌ Warning: Convergence bottlenecks in descending order of severity: │ Outlet #591225 = 48782.889544290454 │ Outlet #591226 = 48782.889544290454 │ ManningResistance #340784 = 0.04819449424793999 │ Pump #340303 = 0.045638255628477994 │ Pump #340194 = 0.04563825461806383 └ @ Ribasim C:\ProgramData\DevDrives\repo\ribasim\Ribasim\core\src\logging.jl:55 ERROR: InterruptException: Stacktrace: [1] bracketstrictlymontonic(v::Vector{Float64}, x::Float64, guess::Int64, o::Base.Order.ForwardOrdering) ``` This implements `Base.success(::Model)::Bool`. Before we checked the SciML retcode. I noticed that the retcode of an ongoing simulation that gets interrupted is also successfull. So now we check both the retcode and if it `is_finished`.
visr
added a commit
that referenced
this pull request
Apr 15, 2025
## [v2025.3.0] - 2025-04-14 The only breaking change in this release is to disallow connecting a single FlowBoundary to multiple Basins. There are large improvements in the ability to visualize results on the map in QGIS. We also welcome the Junction node to the family, which will help laying out networks in a recognizable manner. ### Added - Add spatio-temporal results layers to QGIS. [#2208](#2208) - Add topological (straight line) link view toggle to QGIS. [#2208](#2208) - Added [Junction](https://ribasim.org/reference/node/junction.html) node type. [#2175](#2175) - Write results and log bottlenecks also on an interrupt or crash. [#2191](#2191) [#2200](#2200) - Log computation time and save it to `solver_stats.arrow`. [#2209](https://github.com/Deltares/Ribasim/pull/) - Experimental support for writing the model network and results into files used by Delft-FEWS, [`model.to_fews`](`https://ribasim.org/reference/python/Model.html#ribasim.Model.to_fews`). [#2161](#2161) - Document [`results/concentration.arrow`](https://ribasim.org/reference/usage.html#concentration---concentration.arrow). [#2165](#2165) ### Changed - Allow max 1 outflow neighbour for FlowBoundary. [#2192](#2192) - Automatic differentiation is enabled by default again, `autodiff = true`, leading to better performance. [#2137](#2137) [#2183](#2183)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See #2177 (comment)
Instead of calling
run(config)this replaces it with the contents of that function:Ribasim/core/src/main.jl
Lines 10 to 15 in e81fa39
Such that we can
solve!in a try and callwrite_resultswhether it crashes or not.I don't know how we can easily test it. Perhaps not worth the effort? I tested it on a model that hangs, which I killed with ctrl+c. This works great for that, allowing you to inspect results right up to the hang.