-
Notifications
You must be signed in to change notification settings - Fork 311
Add support for distributed cholla datasets. #4702
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
Changes from all commits
4428058
5b51057
ae37959
448b483
a51fe81
0e531b1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,3 @@ | ||
| import numpy as np | ||
|
|
||
| from yt.utilities.io_handler import BaseIOHandler | ||
| from yt.utilities.on_demand_imports import _h5py as h5py | ||
|
|
||
|
|
@@ -14,22 +12,24 @@ def _read_particle_coords(self, chunks, ptf): | |
| def _read_particle_fields(self, chunks, ptf, selector): | ||
| raise NotImplementedError | ||
|
|
||
| def _read_fluid_selection(self, chunks, selector, fields, size): | ||
| data = {} | ||
| for field in fields: | ||
| data[field] = np.empty(size, dtype="float64") | ||
|
|
||
| with h5py.File(self.ds.parameter_filename, "r") as fh: | ||
| ind = 0 | ||
| for chunk in chunks: | ||
| for grid in chunk.objs: | ||
| nd = 0 | ||
| for field in fields: | ||
| ftype, fname = field | ||
| values = fh[fname][:].astype("=f8") | ||
| nd = grid.select(selector, values, data[field], ind) | ||
| ind += nd | ||
| return data | ||
| def io_iter(self, chunks, fields): | ||
| # this is loosely inspired by the implementation used for Enzo/Enzo-E | ||
| # - those other options use the lower-level hdf5 interface. Unclear | ||
| # whether that affords any advantages... | ||
| fh, filename = None, None | ||
| for chunk in chunks: | ||
| for obj in chunk.objs: | ||
| if obj.filename is None: # unclear when this case arises... | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. likely it will not here, unless you manually construct virtual grids
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Out of curiosity, what is a virtual grid? I realize this may be an involved answer - so if you could just point me to a frontend (or other area of the code) using virtual grids, I can probably investigate that on my own.
mabruzzo marked this conversation as resolved.
|
||
| continue | ||
| elif obj.filename != filename: | ||
| if fh is not None: | ||
| fh.close() | ||
| fh, filename = h5py.File(obj.filename, "r"), obj.filename | ||
| for field in fields: | ||
| ftype, fname = field | ||
| yield field, obj, fh[fname][:].astype("=f8") | ||
| if fh is not None: | ||
| fh.close() | ||
|
|
||
| def _read_chunk_data(self, chunk, fields): | ||
| raise NotImplementedError | ||
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 question. I think in the past it did because we avoided having to re-allocate temporary scratch space, but I am not sure that would hold up to current inquiries. I think the big advantage those have is tracking the groups within the iteration.