Skip to content

Implement HDF5 parallel features for H5MDReader #2865

@edisj

Description

@edisj

Is your feature request related to a problem?

To use h5py's parallel features, you need to pass driver and comm arguments when you open a file, like this:

f = h5py.File('parallel_test.hdf5', 'w', driver='mpio', comm=MPI.COMM_WORLD)

We'd like to add the ability to use these arguments with the H5MDReader (see PR#2787), but there are some methods (below) that could be a problem due to the stream not being reopened in the same way with driver and comm.

Updated:
Following up on issue #2890, to pickle H5MD files opened with driver="mpio" and comm=MPI.COMM_WORLD, we need a way to store the MPI.Comm object used to open the file.

Describe the solution you'd like

I would pull the keyword arguments, driver and comm, out of the mda.Universe arguments and store them as self.driver and self.comm prior to this line:

def open_trajectory(self):

Then, perhaps _reopen and open_trajectory could perform checks to see if the arguments are passed and instead of closing the file, it rewinds it to the first frame.

Updated:
Store comm as an argument in an __init()__ method when calling H5PYPicklable, and use some sort of functions that can pickle the MPI.Comm object similar to https://bitbucket.org/mpi4py/mpi4py/issues/104/pickling-of-mpi-comm

Describe alternatives you've considered

Can't think of any other way at the moment

Additional context

H5MD format
pyh5md package
H5PY documentation


EDIT: Updated issue text after issue #2890

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions