Deltares / Ribasim

Water resources modeling
https://ribasim.org/
MIT License
40 stars 5 forks source link

Derive Julia call stacks #1472

Open evetion opened 5 months ago

evetion commented 5 months ago

For problems such as allocation. As discussed during a knowledge sharing session.

With a call stack it's easier to understand how a computational feature works, and how new code can be designed/integrated, or old code refactored.

edit: I envision something like https://juliadocs.org/DocumenterMermaid.jl/stable/ Image

evetion commented 3 weeks ago

If this is not doable (in a sprint), let's just describe the different parts of the codebase. That would also probably solve #1104.

evetion commented 2 weeks ago

Ok, so ideally we get a call stack in Julia that implements the AbstracTreeInterface, which we then could easily put into a markdown with mermaidjs backticks.

However, I've tested the gist partially based on the old TraceCalls and this crashed on a Ribasim.run (after ~20min). I've tested TraceFuns, and it only prints, not stores, and even that crashed (but printed a lot of nice output).

So the proper way of doing this is editing TraceCalls, or following this documentation of Cassette.jl to actually keep track of all the calls.

However, that seems out of scope here, so I would propose to do a manual documentation of the call stack for: