-
Notifications
You must be signed in to change notification settings - Fork 280
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
Read AMR domains lazily #4734
Read AMR domains lazily #4734
Conversation
@yt-fido test this please |
e5e2fa0
to
2c32713
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. Should more of the properties in the domain files be converted to cached_properties
to reduce the levels of indirection? Like for instance, amr_header
?
@@ -197,7 +204,7 @@ def __init__(self, ds, domain_id): | |||
for t in ["grav", "amr"]: | |||
setattr(self, f"{t}_fn", basename % t) | |||
self._part_file_descriptor = part_file_descriptor | |||
self._read_amr_header() | |||
self.max_level = self.ds.parameters["levelmax"] - self.ds.parameters["levelmin"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. I feel like I've seen this as an issue elsewhere. Are we correctly setting min_level
as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have to say I'm a bit confused about max_level
/min_level
. In RAMSES standard, these are simply related to the number of levels of refinement from the root, i.e. 1/2**level
is the current cell size.
But for yt, if max_level
is how more refined the deepest level is compared to the base grid, what does min_level
min? Should it be 0 if there are some cells that are at the resolution of the base grid?
I am not sure what you exactly mean. Are you suggesting to add more things as |
@yt-fido test this please. |
Co-authored-by: Clément Robert <cr52@protonmail.com>
Co-authored-by: Clément Robert <cr52@protonmail.com>
53a3e0a
to
685961f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All my points were addressed, thank you !
PR Summary
For RAMSES, we already have some domain-based decomposition following a Hilbert curve. This leverages this to quickly find which domain to read when selecting a subregion, allowing to (costly) reading of many AMR domains.
New things
This sits nicely on top of #4720 which allows much improved performances. I'd be happy to add some figures if required.