From a29d3c894a16d5d3bfcd554f83738588937cb760 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Thu, 11 Aug 2011 15:04:14 +0000 Subject: [PATCH] flush step after writing dataset --- src/h5core/h5_hdf5_private.h | 18 ++++++++++++++++++ src/h5core/h5u_readwrite.c | 1 + 2 files changed, 19 insertions(+) diff --git a/src/h5core/h5_hdf5_private.h b/src/h5core/h5_hdf5_private.h index 371dd76..0d26972 100644 --- a/src/h5core/h5_hdf5_private.h +++ b/src/h5core/h5_hdf5_private.h @@ -1087,6 +1087,24 @@ hdf5_close_file ( HDF5_WRAPPER_RETURN (H5_SUCCESS); } +static inline h5_err_t +hdf5_flush ( + hid_t obj_id, + H5F_scope_t scope + ) { + HDF5_WRAPPER_ENTER2 (h5_err_t, + "obj_id=%d (%s)", + obj_id, + hdf5_get_objname (obj_id)); + if (H5Fflush (obj_id, scope) < 0) + HDF5_WRAPPER_LEAVE ( + h5_error ( + H5_ERR_HDF5, + "Cannot flush data \"%s\".", + hdf5_get_objname (obj_id))); + HDF5_WRAPPER_RETURN (H5_SUCCESS); +} + /****** E r r o r h a n d l i n g ********************************************/ static inline h5_err_t diff --git a/src/h5core/h5u_readwrite.c b/src/h5core/h5u_readwrite.c index e9b864c..64cb41f 100644 --- a/src/h5core/h5u_readwrite.c +++ b/src/h5core/h5u_readwrite.c @@ -158,6 +158,7 @@ h5u_write_data ( TRY (hdf5_close_dataset (dset_id)); f->empty = 0; + TRY (hdf5_flush (f->step_gid, H5F_SCOPE_LOCAL)); H5_CORE_API_RETURN (H5_SUCCESS); }