Write heterogeneous data to hdf5 file.