Issue #1844 performance idf open subdomains - #1886
Conversation
…ling merge_subdomains for one timestep.
|
Some notes:
EDIT: overhead is minimal; for 3000 time steps with 50 layers, 1000 by 1000 rows & columns, it's about 1 ms of overhead. |
…ys to get equal performance to oplossing_Huite.py
|
Update: I managed to further improve performance by a factor 2, so that it is equal to the original solution by avoiding excessive unnecessary casting to |
|
ClaireDons
left a comment
There was a problem hiding this comment.
Nice, it was quite interesting to go through the changes. I just have a couple of questions but otherwise looks good to me :)



Fixes #1844
Description
Reduce dask task graph considerably by only chunking per time (and optionally per species). To avoid having to construct the coords manually again from the headers like the previous implementation, we eagerly call merge_partitions on the first timestep to just get the coords (but do not load them into memory). This implementation has similar performance to the original code. I had to modify the return statements in
imod.typing.structured.pysomewhat to avoid unnecessary creation of xr.DataArrays and xr.Datasets. This might look a bit confusing at first, I added some docstrings to clarify.Other things I tried:
I also tried rechunking to layers after calling merge_partitions, so that not so much code had to be changed, but this still resulted in poor performance (5 minutes versus 6 seconds with 37400 idfs) as dask still had to optimize the task graph. (Still better than the 30+ minutes it cost before)
TODOs:
Checklist
Issue #nr, e.g.Issue #737pixi run generate-sbomand committed changes