pencil.io.pc_hdf5 ================= .. py:module:: pencil.io.pc_hdf5 .. autoapi-nested-parse:: Contains optional h5 operations with and without hdf5-parallel, for exampe to open h5 file with/without MPI using common switches. TODO open h5 pencil var object etc, as alternative to var object for large datasets with memory limits. Functions --------- .. autoapisummary:: pencil.io.pc_hdf5.open_h5 pencil.io.pc_hdf5.group_h5 pencil.io.pc_hdf5.dataset_h5 Module Contents --------------- .. py:function:: open_h5(filename, status, driver=None, comm=None, overwrite=False, size=1, rank=0, lfs=False, MB=1, count=1) This function opens hdf5 file in serial or parallel. :keyword filename: relative or absolute path string for name of hdf5 file. :keyword status: open state of file 'w': write, 'r': read or 'a'/'r+': append. :keyword driver: 'mpio' required for parallel: version but absent for serial. :keyword comm: only present for parallel version of h5py. :keyword overwrite: flag to replace existing file. :keyword rank: processor rank with root = 0. .. py:function:: group_h5(h5obj, groupname, status='r', delete=False, overwrite=False, rank=0, size=1, comm=None) This function adds/removes hdf5 group objects. :keyword h5obj: h5 object, may be the file or a sub group within the file :keyword groupname: string for name of the group. :keyword status: open state of file 'w': write, 'r': read or 'a'/'r+': append. :keyword delete: flag to remove existing group from h5 object. :keyword overwrite: flag to replace existing group from h5 object. :keyword rank: processor rank with root = 0. :keyword comm: only present for parallel version of h5py. .. py:function:: dataset_h5(h5obj, dataname, status='r', data=None, shape=None, dtype=None, overwrite=False, delete=False, rank=0, size=1, comm=None) This function adds/removes hdf5 dataset objects. :keyword h5obj: h5 object, may be the file or a sub group within the file :keyword dataname: string for name of the dataset. :keyword status: open state of file 'w': write, 'r': read or 'a'/'r+': append. :keyword data: h5 compatible data object; float, integer, string, array :keyword shape: data shape tuple of length > 0 :keyword dtype: h5 compatible data type, eg. np.float64 :keyword delete: flag to remove existing group from h5 object. :keyword overwrite: flag to replace existing group from h5 object. :keyword rank: processor rank with root = 0. :keyword comm: only present for parallel version of h5py.