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

Replace (time, node_id) order by (node_id, time) #601

Open
6 tasks
visr opened this issue Sep 14, 2023 · 0 comments
Open
6 tasks

Replace (time, node_id) order by (node_id, time) #601

visr opened this issue Sep 14, 2023 · 0 comments
Labels
performance Relates to runtime performance or convergence

Comments

@visr
Copy link
Member

visr commented Sep 14, 2023

I thought I fixed the sorting issue by updating the sorting functions as described in #597 (comment).

But this fixed sorting actually exposed as issue fixed in 8bc5895. That now filters the time tables to create contiguous vectors with the timeseries per node. For this access pattern it would be faster to have it first sorted on node_id, and then on time, instead of the other way around.

I initially went for time first since we were reading in time series at runtime, and then loading them in for all nodes. But now we create an interpolation object per node, that takes a vector of the entire timeseries. So it's better to sort by node_id first like all other tables.

  • update documented sort order in usage.qmd Fix and change table sorting in Python #903
  • update sort methods in python Fix and change table sorting in Python #903
  • update sort methods in julia
  • address TODO in 8bc5895 and use views like below
  • use interpolation objects instead of update_basin, which still relies on time being sorted first
  • use interpolation objects (which already seem to exist) instead of update_tabulated_rating_curve!, which still relies on time being sorted first
rows = searchsorted(time.node_id, node_id)
time_id = view(time, rows)
@github-project-automation github-project-automation bot moved this to To do in Ribasim Sep 14, 2023
@visr visr added the performance Relates to runtime performance or convergence label Sep 18, 2023
visr added a commit that referenced this issue Jan 15, 2024
Fixes the first two items of #601.

Also adds a test.
@visr visr changed the title replace (time, node_id) order by (node_id, time) Replace (time, node_id) order by (node_id, time) May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Relates to runtime performance or convergence
Projects
Status: To do
Development

No branches or pull requests

2 participants