[petsc-users] hdf5 and FILE_MODE_APPEND

Jed Brown jedbrown at mcs.anl.gov
Fri Jan 20 16:00:13 CST 2012


On Fri, Jan 20, 2012 at 15:55, Matthew Knepley <knepley at gmail.com> wrote:

> There is no need for append mode. HDF5 does not work that way. Just open
> it up and write.


As written, that would truncate the old file. Making this work might be as
simple as adding a case for FILE_MODE_APPEND that opened the file
H5F_ACC_RDWR.

  /* Create or open the file collectively */
  switch (hdf5->btype) {
    case FILE_MODE_READ:
      hdf5->file_id = H5Fopen(name, H5F_ACC_RDONLY, plist_id);
      break;
    case FILE_MODE_WRITE:
      hdf5->file_id = H5Fcreate(name, H5F_ACC_TRUNC, H5P_DEFAULT, plist_id);
      break;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120120/8e088c54/attachment.htm>


More information about the petsc-users mailing list