Simplify and correct tipsy sub-chunking. #2278
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #2276.
The tipsy chunking was not correctly subchunking, and this seemed to only show up when the particular ordering and sizes of the particle types was set in a specific way. This would always have a "hard fail", so there have to my knowledge this has not been the source of any quiet failures.
What this does is simplify the particle offset calculation. Instead of our previous way of doing things, which I could not quite parse out (and which was probably dating from before we did any subchunking) the new way is to compute a global offset for each particle type and then offset into that based on
data_file.start
. I also terminate earlier when trying to read particles that aren't in a sub-chunk.This uses data from @claytonstrawn .
My verification script, which I ran with changing
CHUNKSIZE
inyt/geometry/particle_geometry_handler.py
to a big number and leaving it at the small number:The results are identical between the two. I should note that for some reason reading "smoothing_length" doesn't work, which is a bit confusing for me.