yt-project / yt_experiments

A repository containing some experimental packages and enhancements
BSD 3-Clause "New" or "Revised" License
0 stars 2 forks source link

Two-level indexing for parallelization of I/O #6

Open cphyc opened 9 months ago

cphyc commented 9 months ago

At the moment, yt employs a global index to locate data. For many datasets (incl. RAMSES), data are ever spread within files with a mapping that relies on some space-filling process (e.g. the Hilbert curve or the Z-curve).

This mapping is typically lightweight and could be used as an intermediate coarse-grained indexing (similar to what has been done with SPH, as far as I could understand).

Having a lightweight coarse-grained indexing (with no false-negative!) would allow it to be copied on however many MPI tasks yt is running on. As a second step, the current indexing (from file to position in file) would allow finer refinement (do we need to read any data? where is it located on disk?). This would allow distributing the list of files to be read to the different tasks deterministically based on the intersection with the coarse index, and each task would subsequently read the files that actually intersect.

Some of the code required for this is already in place for the RAMSES dataset (https://github.com/yt-project/yt/pull/4734 for having a two-level index, https://github.com/yt-project/yt/pull/4730 for how one could use this to parallelize I/O).

matthewturk commented 3 weeks ago

We should do this. I had an attempt at something related but not identical that I can no longer find; essentially, it was to make .index a list instead of a single attribute, and then have multiple grid index objects that could live on it. Same for particles, which are already closer to that.

Perhaps what we could try: