From 2702f846cb097f1b9bd8f8c8f4b07554340bc051 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Thu, 26 Sep 2013 15:53:54 +0200 Subject: [PATCH] old file open API removed --- src/h5core/h5_openclose.c | 29 +------- src/h5core/h5_readwrite_private.h | 1 + src/h5core/h5t_store.c | 2 - src/include/H5.h | 115 +++++++++--------------------- 4 files changed, 36 insertions(+), 111 deletions(-) diff --git a/src/h5core/h5_openclose.c b/src/h5core/h5_openclose.c index cd3231e..01854c6 100644 --- a/src/h5core/h5_openclose.c +++ b/src/h5core/h5_openclose.c @@ -146,6 +146,9 @@ set_default_file_props ( H5_STEPNAME, H5_STEPNAME_LEN - 1); file_props->width_step_idx = H5_STEPWIDTH; +#ifdef PARALLEL_IO + file_props->comm = MPI_COMM_WORLD; +#endif H5_INLINE_FUNC_RETURN (H5_SUCCESS); } @@ -412,32 +415,6 @@ h5_open_file ( H5_CORE_API_RETURN (f); } -#if 0 -h5_file_t -h5_open_file ( - const char* filename, - h5_int32_t mode, - MPI_Comm comm, - h5_size_t align - ) { - H5_CORE_API_ENTER (h5_file_t, - "filename='%s', mode=%d, comm=?, align=%llu", - filename, mode, align); - h5_prop_file_t* props; - TRY (props = (h5_prop_file_t*)h5_create_prop (H5_PROP_FILE)); - TRY (set_default_file_props (props)); - - TRY (h5_set_prop_file_mpio ((h5_prop_t)props, &comm)); - TRY (h5_set_prop_file_align ((h5_prop_t)props, align)); - - h5_file_p f = NULL; - TRY (f = h5_calloc (1, sizeof (*f))); - f->props = props; - TRY (open_file (f, filename, mode)); - - H5_CORE_API_RETURN ((h5_file_t)f); -} -#endif /*! \ingroup h5_core_filehandling diff --git a/src/h5core/h5_readwrite_private.h b/src/h5core/h5_readwrite_private.h index eb10e70..6948607 100644 --- a/src/h5core/h5_readwrite_private.h +++ b/src/h5core/h5_readwrite_private.h @@ -15,6 +15,7 @@ #define is_writable(f) (f->props->mode != H5_O_RDONLY) #define is_readonly(f) (f->props->mode == H5_O_RDONLY) +#define is_appendonly(f) (f->props->mode == H5_O_APPEND) #define CHECK_WRITABLE_MODE(f) \ TRY (is_writable (f) ? H5_SUCCESS : h5_error ( \ diff --git a/src/h5core/h5t_store.c b/src/h5core/h5t_store.c index 9cff3d7..75ecfeb 100644 --- a/src/h5core/h5t_store.c +++ b/src/h5core/h5t_store.c @@ -1097,8 +1097,6 @@ h5t_end_store_ckd_elems ( // /* mesh specific finalize */ // TRY (m->methods->store->end_store_elems (m)); } -#endif // CHUNKING_OF_VTX - #endif H5_CORE_API_RETURN (H5_SUCCESS); } diff --git a/src/include/H5.h b/src/include/H5.h index d57e5ea..7e0162c 100644 --- a/src/include/H5.h +++ b/src/include/H5.h @@ -45,6 +45,22 @@ H5SetPropFileAlign ( H5_API_RETURN (h5_set_prop_file_align (prop, align)); } +/*! + \ingroup h5hut_file + + Set the `throttle` factor, which causes HDF5 write and read + calls to be issued in that number of batches. + + This can prevent large concurrency parallel applications that + use independent writes from overwhelming the underlying + parallel file system. + + Throttling only works with the H5_VFD_MPIPOSIX or + H5_VFD_MPIIO_IND drivers and is only available in + the parallel library. + + \return \c H5_SUCCESS or \c H5_FAILURE +*/ static inline h5_err_t H5SetPropFileThrottle ( h5_prop_t prop, @@ -71,7 +87,7 @@ H5CloseProp ( File mode flags are: - - \c H5_O_RDONLY: only reading allowed + - \c H5_O_RDONLY: Only reading allowed - \c H5_O_WRONLY: create new file, dataset must not exist - \c H5_O_APPEND: allows to append a new datasets to an existing file - \c H5_O_RDWR: dataset may exist @@ -90,18 +106,6 @@ H5CloseProp ( */ static inline h5_file_t H5OpenFile ( - const char* filename, ///< [in] file name. - h5_int32_t flags, ///< [in] file access mode flags. - MPI_Comm comm ///< [in] MPI communicator. - ) { - H5_API_ENTER (h5_file_t, - "filename='%s', flags=%d, ...", - filename, flags); - H5_API_RETURN (h5_open_file (filename, flags, comm, 0)); -} - -static inline h5_file_t -H5OpenFile2 ( const char* filename, h5_int64_t mode, h5_prop_t props @@ -112,47 +116,6 @@ H5OpenFile2 ( H5_API_RETURN (h5_open_file2 (filename, mode, props)); } -/*! - \ingroup h5hut_file - - - Opens file with specified filename, and also specifices an alignment - value used for HDF5 tuning parameters. In the serial case \c comm may have - any value. - - File modes and flags are bit values that can be combined with the bit operator \c | - and include: - - - \c H5_O_RDONLY: only reading allowed - - \c H5_O_WRONLY: create new file, dataset must not exist - - \c H5_O_APPEND: allows to append a new datasets to an existing file - - \c H5_O_RDWR: dataset may exist - - \c H5_FS_LUSTRE - enable optimizations for the Lustre file system - - \c H5_VFD_MPIPOSIX - use the HDF5 MPI-POSIX virtual file driver - - \c H5_VFD_MPIIO_IND - use MPI-IO in indepedent mode - - The typical file extension is \c .h5. - - \c h5_file_p should be treated as an essentially opaque - datastructure. It acts as the file handle, but internally - it maintains several key state variables associated with - the file. - - \return File handle or \c (void*)H5_FAILURE - */ -static inline h5_file_t -H5OpenFileAlign ( - const char* filename, ///< [in] name of the data file to open. - const h5_int32_t flags, ///< [in] file access mode flags. - MPI_Comm comm, ///< [in] MPI communicator. - const h5_size_t align ///< [in] alignment size in bytes. - ) { - H5_API_ENTER (h5_file_t, - "filename='%s', flags=%d, ...", - filename, flags); - H5_API_RETURN (h5_open_file (filename, flags, comm, align)); -} - /*! \ingroup h5hut_file @@ -187,35 +150,6 @@ H5CheckFile ( H5_API_RETURN (h5_check_filehandle (f)); } -/*! - \ingroup h5hut_file - - Set the `throttle` factor, which causes HDF5 write and read - calls to be issued in that number of batches. - - This can prevent large concurrency parallel applications that - use independent writes from overwhelming the underlying - parallel file system. - - Throttling only works with the H5_VFD_MPIPOSIX or - H5_VFD_MPIIO_IND drivers and is only available in - the parallel library. - - \return \c H5_SUCCESS or \c H5_FAILURE -*/ -#ifdef PARALLEL_IO -h5_err_t -static inline H5SetThrottle ( - const h5_file_t f, ///< [in] file handle. - int factor ///< [in] throttle factor - ) { - H5_API_ENTER (h5_err_t, - "f=%p, factor=%d", - (h5_file_p)f, factor); - H5_API_RETURN (h5_set_throttle(f, factor)); -} -#endif // PARALLEL_IO - /*! \ingroup h5hut_file @@ -294,6 +228,21 @@ H5SetErrorHandler ( H5_API_RETURN (h5_set_errorhandler (handler)); } +/*! + \ingroup h5hut_error + + Set the abort error handler. + + \return \c H5_SUCCESS +*/ +static inline h5_err_t +H5AbortOnError ( + void + ) { + H5_API_ENTER (h5_err_t, "%s", ""); + H5_API_RETURN (h5_set_errorhandler (h5_abort_errorhandler)); +} + /*! \ingroup h5hut_error