In HDF5, a file driver is a mapping between the HDF5 format address space and storage. By default, HDF5 simply maps the format address space directly onto a single file.
However, users may want the ability to map the format address space onto different types of storage with various types of maps. With HDF5 we provide a small set of pre-defined file drivers, and users can implement their own mappings using the Virtual File Layer APIs. With HDF5-1.12 users can create Virtual Object Layer plugins to HDF5 to store objects with file drivers that they have created.
Detailed information on file drivers can be found under the Technical Notes documentation on the Virtual File Layer.
Following are the file drivers that HDF5 provides.
writeto perform I/O to a single file.
fapl = H5Pcreate (H5P_FILE_ACCESS);
H5Pset_fapl_followed by the driver name and which takes a file access property list as the first argument, followed by additional driver-dependent arguments. For example:
size_t member_size = 100*1024*1024; /* 100 MB */ status = H5Pset_fapl_family (fapl, member_size, H5P_DEFAULT);An alternative to using the driver initialization function is to set the driver directly using
H5Pset_driver, which is not covered here.
H5Fcreate, passing in the identifier of the property list just modified.
file_id = H5Fcreate (HDF5FILE, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
status = H5Pclose (fapl);
For example, the following sets the MPI-IO driver to use independent access for I/O operations:
dxpl = H5Pcreate (H5P_DATA_XFER); status = H5Pset_dxpl_mpio (dxpl, H5FD_MPIO_INDEPENDENT); status = H5Dread (dataset_id, type, mspace, fspace, buffer, dxpl);
These are out of the scope of this tutorial. Refer to the Technical Notes documentation on the Virtual File Layer.
A general application does not know what drivers were used to create a file. It would have to try different file drivers until it succeeds. An example of a general application is the h5dump tool that we provide with HDF5.