-
Notifications
You must be signed in to change notification settings - Fork 8
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
Automatically resize chunks after merging parallel results #252
Comments
5 tasks
Merged
Merged
63 tasks
A reproducible example from the Verschillentool experiences: import dfm_tools as dfmt
file_nc1 = r"P:\dflowfm\projects\2021_verschilanalyse\modellen_2022_2023\dcsm_0.5nm\computations\hist\2013-2017_structure_ini_aangepast\2024.01_DFM_OUTPUT_DCSM-FM_0_5nm_goed/*0*_map.nc"
uds1 = dfmt.open_partitioned_dataset(file_nc1)
file_nc2 = r"p:/dflowfm/projects/2021_verschilanalyse/modellen_2022_2023/dcsm_0.5nm/computations/hist/2013-2017/202301_DFM_OUTPUT_DCSM-FM_0_5nm/*0*_map.nc"
uds2 = dfmt.open_partitioned_dataset(file_nc2)
uds1_new = uds1.ugrid.reindex_like(uds2) Gives the following warning:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The current merging of parallel results can bring a lot of chunking overhead with it. In many cases, you will want to merge results, then reindex them to match an original grid topology. If the original chunks of the parallel partitions persist, the reindexing becomes wildly inefficient, as dask will try to respect the chunks.
It's clear the the reindex result is shuffled around, and the chunks should not be maintained. The only thing dask can do here -- I guess -- is schedule the operation per chunk, and then repeat them very inefficienctly.
What should likely be the default option here, is resizing all the chunks automatically when merging to ensure all the ugrid dimensions are in a single chunk:
Almost all subsequent operations will run much smoother with a single spatial chunk. I was thinking of setting a
merge_ugrid_chunks=True
argument, but is there really any case where you would want to merge the grids, but not merge chunks? Maybe if you're interested in individual cells -- but again it likely won't be more efficient in almost all cases, I reckon.The text was updated successfully, but these errors were encountered: