summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/H5AC.c2
-rw-r--r--src/H5C.c2
-rw-r--r--src/H5Dchunk.c2
-rw-r--r--src/H5Dcontig.c2
-rw-r--r--src/H5Dint.c6
-rw-r--r--src/H5Dio.c7
-rw-r--r--src/H5F.c15
-rw-r--r--src/H5FD.c56
-rw-r--r--src/H5FDcore.c10
-rw-r--r--src/H5FDcore.h4
-rw-r--r--src/H5FDdirect.c12
-rw-r--r--src/H5FDdirect.h4
-rw-r--r--src/H5FDfamily.c22
-rw-r--r--src/H5FDfamily.h4
-rw-r--r--src/H5FDlog.c8
-rw-r--r--src/H5FDlog.h3
-rw-r--r--src/H5FDmpi.h4
-rw-r--r--src/H5FDmpio.c14
-rw-r--r--src/H5FDmpio.h2
-rw-r--r--src/H5FDmpiposix.c16
-rw-r--r--src/H5FDmpiposix.h1
-rw-r--r--src/H5FDmulti.c9
-rw-r--r--src/H5FDmulti.h6
-rw-r--r--src/H5FDpublic.h16
-rw-r--r--src/H5FDsec2.c8
-rw-r--r--src/H5FDsec2.h3
-rw-r--r--src/H5FDstdio.c9
-rw-r--r--src/H5FDstdio.h1
-rw-r--r--src/H5FDwindows.c17
-rw-r--r--src/H5FDwindows.h4
-rw-r--r--src/hdf5.h2
31 files changed, 119 insertions, 152 deletions
diff --git a/src/H5AC.c b/src/H5AC.c
index cfb8a17..1c005a8 100644
--- a/src/H5AC.c
+++ b/src/H5AC.c
@@ -485,7 +485,7 @@ H5AC_create(const H5F_t *f,
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Bad cache configuration")
#ifdef H5_HAVE_PARALLEL
- if(IS_H5FD_MPI(f)) {
+ if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) {
MPI_Comm mpi_comm;
int mpi_rank;
int mpi_size;
diff --git a/src/H5C.c b/src/H5C.c
index aed2b90..5a4f5e9 100644
--- a/src/H5C.c
+++ b/src/H5C.c
@@ -8133,7 +8133,7 @@ H5C_flush_single_entry(H5F_t * f,
*/
if ( ( ! clear_only ) &&
( entry_ptr->is_dirty ) &&
- ( IS_H5FD_MPI(f) ) ) {
+ (H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI) ) ) {
H5P_genplist_t *dxpl; /* Dataset transfer property list */
H5FD_mpio_xfer_t xfer_mode; /* I/O xfer mode property value */
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c
index 64efc8a..643e1cb 100644
--- a/src/H5Dchunk.c
+++ b/src/H5Dchunk.c
@@ -3164,7 +3164,7 @@ H5D_chunk_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite,
#ifdef H5_HAVE_PARALLEL
/* Retrieve MPI parameters */
- if(IS_H5FD_MPI(dset->oloc.file)) {
+ if(H5F_HAS_FEATURE(dset->oloc.file, H5FD_FEAT_HAS_MPI)) {
/* Get the MPI communicator */
if(MPI_COMM_NULL == (mpi_comm = H5F_mpi_get_comm(dset->oloc.file)))
HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "Can't retrieve MPI communicator")
diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c
index 9a6e08f..c578d27 100644
--- a/src/H5Dcontig.c
+++ b/src/H5Dcontig.c
@@ -225,7 +225,7 @@ H5D_contig_fill(H5D_t *dset, hid_t dxpl_id)
#ifdef H5_HAVE_PARALLEL
/* Retrieve MPI parameters */
- if(IS_H5FD_MPI(dset->oloc.file)) {
+ if(H5F_HAS_FEATURE(dset->oloc.file, H5FD_FEAT_HAS_MPI)) {
/* Get the MPI communicator */
if(MPI_COMM_NULL == (mpi_comm = H5F_mpi_get_comm(dset->oloc.file)))
HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "Can't retrieve MPI communicator")
diff --git a/src/H5Dint.c b/src/H5Dint.c
index 8c73888..e51f001 100644
--- a/src/H5Dint.c
+++ b/src/H5Dint.c
@@ -1003,7 +1003,7 @@ H5D_create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id,
HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, NULL, "compact dataset must have early space allocation")
/* If MPI VFD is used, no filter support yet. */
- if(IS_H5FD_MPI(file) && pline->nused > 0)
+ if(H5F_HAS_FEATURE(file, H5FD_FEAT_HAS_MPI) && pline->nused > 0)
HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, NULL, "Parallel I/O does not support filters yet")
/* Get the dataset's external file list information */
@@ -1023,7 +1023,7 @@ H5D_create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id,
} /* end if */
/* Check if this dataset is going into a parallel file and set space allocation time */
- if(IS_H5FD_MPI(file))
+ if(H5F_HAS_FEATURE(file, H5FD_FEAT_ALLOCATE_EARLY))
new_dset->shared->dcpl_cache.fill.alloc_time = H5D_ALLOC_TIME_EARLY;
/* Set the dataset's I/O operations */
@@ -1305,7 +1305,7 @@ H5D_open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id)
*/
if((H5F_INTENT(dataset->oloc.file) & H5F_ACC_RDWR)
&& !(*dataset->shared->layout.ops->is_space_alloc)(&dataset->shared->layout.storage)
- && IS_H5FD_MPI(dataset->oloc.file)) {
+ && H5F_HAS_FEATURE(dataset->oloc.file, H5FD_FEAT_ALLOCATE_EARLY)) {
if(H5D_alloc_storage(dataset, dxpl_id, H5D_ALLOC_OPEN, FALSE, NULL) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize file storage")
} /* end if */
diff --git a/src/H5Dio.c b/src/H5Dio.c
index b7c2ecb..7ee304c 100644
--- a/src/H5Dio.c
+++ b/src/H5Dio.c
@@ -339,7 +339,8 @@ H5D_read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space,
#ifdef H5_HAVE_PARALLEL
/* Collective access is not permissible without a MPI based VFD */
- if(dxpl_cache->xfer_mode == H5FD_MPIO_COLLECTIVE && !IS_H5FD_MPI(dataset->oloc.file))
+ if(dxpl_cache->xfer_mode == H5FD_MPIO_COLLECTIVE &&
+ !(H5F_HAS_FEATURE(dataset->oloc.file, H5FD_FEAT_HAS_MPI)))
HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "collective access for MPI-based drivers only")
#endif /*H5_HAVE_PARALLEL*/
@@ -543,7 +544,7 @@ H5D_write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space,
/* Various MPI based checks */
#ifdef H5_HAVE_PARALLEL
- if(IS_H5FD_MPI(dataset->oloc.file)) {
+ if H5F_HAS_FEATURE(dataset->oloc.file, H5FD_FEAT_HAS_MPI) {
/* If MPI based VFD is used, no VL datatype support yet. */
/* This is because they use the global heap in the file and we don't */
/* support parallel access of that yet */
@@ -768,7 +769,7 @@ H5D_ioinfo_init(H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id,
#ifdef H5_HAVE_PARALLEL
/* Determine if the file was opened with an MPI VFD */
- io_info->using_mpi_vfd = IS_H5FD_MPI(dset->oloc.file);
+ io_info->using_mpi_vfd = H5F_HAS_FEATURE(dset->oloc.file, H5FD_FEAT_HAS_MPI);
#endif /* H5_HAVE_PARALLEL */
FUNC_LEAVE_NOAPI(SUCCEED)
diff --git a/src/H5F.c b/src/H5F.c
index 5b3c84b..f9941e7 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -35,19 +35,6 @@
#include "H5SMprivate.h" /* Shared Object Header Messages */
#include "H5Tprivate.h" /* Datatypes */
-/* Predefined file drivers */
-#include "H5FDcore.h" /*temporary in-memory files */
-#include "H5FDfamily.h" /*family of files */
-#include "H5FDlog.h" /* sec2 driver with logging, for debugging */
-#include "H5FDmpi.h" /* MPI-based file drivers */
-#include "H5FDmulti.h" /*multiple files partitioned by mem usage */
-#include "H5FDsec2.h" /*Posix unbuffered I/O */
-#include "H5FDstdio.h" /* Standard C buffered I/O */
-#ifdef H5_HAVE_WINDOWS
-#include "H5FDwindows.h" /* Windows buffered I/O */
-#endif
-#include "H5FDdirect.h" /*Linux direct I/O */
-
/* Struct only used by functions H5F_get_objects and H5F_get_objects_cb */
typedef struct H5F_olist_t {
H5I_type_t obj_type; /* Type of object to look for */
@@ -934,7 +921,7 @@ H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id, H5FD_t *lf)
* merged into the trunk and journaling is enabled, at least until
* we make it work. - QAK)
*/
- f->shared->use_tmp_space = !(IS_H5FD_MPI(f));
+ f->shared->use_tmp_space = !H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI);
/*
* Create a metadata cache with the specified number of elements.
diff --git a/src/H5FD.c b/src/H5FD.c
index d0683e1..6c2a024 100644
--- a/src/H5FD.c
+++ b/src/H5FD.c
@@ -43,17 +43,6 @@
#include "H5Eprivate.h" /* Error handling */
#include "H5Fpkg.h" /* File access */
#include "H5FDpkg.h" /* File Drivers */
-#include "H5FDcore.h" /* Files stored entirely in memory */
-#include "H5FDfamily.h" /* File families */
-#include "H5FDlog.h" /* sec2 driver with I/O logging (for debugging) */
-#include "H5FDmpi.h" /* MPI-based file drivers */
-#include "H5FDmulti.h" /* Usage-partitioned file family */
-#include "H5FDsec2.h" /* POSIX unbuffered file I/O */
-#include "H5FDstdio.h" /* Standard C buffered I/O */
-#ifdef H5_HAVE_WINDOWS
-#include "H5FDwindows.h" /* Windows buffered I/O */
-#endif
-#include "H5FDdirect.h" /* Direct file I/O */
#include "H5Iprivate.h" /* IDs */
#include "H5MMprivate.h" /* Memory management */
#include "H5Pprivate.h" /* Property lists */
@@ -108,7 +97,7 @@ static herr_t H5FD_free_cls(H5FD_class_t *cls);
* object and the file is closed and re-opened, the 'fileno' value will
* be different.
*/
-static unsigned long file_serial_no;
+static unsigned long H5FD_file_serial_no_g;
/*-------------------------------------------------------------------------
@@ -164,7 +153,7 @@ H5FD_init_interface(void)
HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize interface")
/* Reset the file serial numbers */
- file_serial_no = 0;
+ H5FD_file_serial_no_g = 0;
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -201,26 +190,6 @@ H5FD_term_interface(void)
if(H5_interface_initialize_g) {
if((n=H5I_nmembers(H5I_VFL))!=0) {
H5I_clear_type(H5I_VFL, FALSE, FALSE);
-
- /* Reset the VFL drivers, if they've been closed */
- if(H5I_nmembers(H5I_VFL)==0) {
- H5FD_sec2_term();
-#ifdef H5_HAVE_DIRECT
- H5FD_direct_term();
-#endif
- H5FD_log_term();
- H5FD_stdio_term();
-#ifdef H5_HAVE_WINDOWS
- H5FD_windows_term();
-#endif
- H5FD_family_term();
- H5FD_core_term();
- H5FD_multi_term();
-#ifdef H5_HAVE_PARALLEL
- H5FD_mpio_term();
- H5FD_mpiposix_term();
-#endif /* H5_HAVE_PARALLEL */
- } /* end if */
} else {
H5I_dec_type_ref(H5I_VFL);
H5_interface_initialize_g = 0;
@@ -252,11 +221,24 @@ H5FD_term_interface(void)
static herr_t
H5FD_free_cls(H5FD_class_t *cls)
{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_free_cls)
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI_NOINIT(H5FD_free_cls)
+
+ /* Sanity check */
+ HDassert(cls);
+
+ /* If the file driver has a terminate callback, call it to give the file
+ * driver a chance to free singletons or other resources which will become
+ * invalid once the class structure is freed.
+ */
+ if(cls->terminate && cls->terminate() < 0)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEOBJ, FAIL, "virtual file driver '%s' did not terminate cleanly", cls->name)
H5MM_xfree(cls);
- FUNC_LEAVE_NOAPI(SUCCEED)
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_free_cls() */
@@ -1104,11 +1086,11 @@ H5FD_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, NULL, "unable to query file driver")
/* Increment the global serial number & assign it to this H5FD_t object */
- if(++file_serial_no == 0) {
+ if(++H5FD_file_serial_no_g == 0) {
/* (Just error out if we wrap around for now...) */
HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, NULL, "unable to get file serial number")
} /* end if */
- file->fileno = file_serial_no;
+ file->fileno = H5FD_file_serial_no_g;
/* Start with base address set to 0 */
/* (This will be changed later, when the superblock is located) */
diff --git a/src/H5FDcore.c b/src/H5FDcore.c
index 6668a8c..a978555 100644
--- a/src/H5FDcore.c
+++ b/src/H5FDcore.c
@@ -111,6 +111,7 @@ typedef struct H5FD_core_fapl_t {
(size_t)((A)+(Z))<(size_t)(A))
/* Prototypes */
+static herr_t H5FD_core_term(void);
static void *H5FD_core_fapl_get(H5FD_t *_file);
static H5FD_t *H5FD_core_open(const char *name, unsigned flags, hid_t fapl_id,
haddr_t maxaddr);
@@ -132,6 +133,7 @@ static const H5FD_class_t H5FD_core_g = {
"core", /*name */
MAXADDR, /*maxaddr */
H5F_CLOSE_WEAK, /*fc_degree */
+ H5FD_core_term, /*terminate */
NULL, /*sb_size */
NULL, /*sb_encode */
NULL, /*sb_decode */
@@ -225,16 +227,14 @@ done:
*
* Purpose: Shut down the VFD
*
- * Return: <none>
+ * Returns: Non-negative on success or negative on failure
*
* Programmer: Quincey Koziol
* Friday, Jan 30, 2004
*
- * Modification:
- *
*---------------------------------------------------------------------------
*/
-void
+static herr_t
H5FD_core_term(void)
{
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_core_term)
@@ -242,7 +242,7 @@ H5FD_core_term(void)
/* Reset VFL ID */
H5FD_CORE_g=0;
- FUNC_LEAVE_NOAPI_VOID
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5FD_core_term() */
diff --git a/src/H5FDcore.h b/src/H5FDcore.h
index dca110e..6e071e0 100644
--- a/src/H5FDcore.h
+++ b/src/H5FDcore.h
@@ -22,15 +22,12 @@
#ifndef H5FDcore_H
#define H5FDcore_H
-#include "H5Ipublic.h"
-
#define H5FD_CORE (H5FD_core_init())
#ifdef __cplusplus
extern "C" {
#endif
H5_DLL hid_t H5FD_core_init(void);
-H5_DLL void H5FD_core_term(void);
H5_DLL herr_t H5Pset_fapl_core(hid_t fapl_id, size_t increment,
hbool_t backing_store);
H5_DLL herr_t H5Pget_fapl_core(hid_t fapl_id, size_t *increment/*out*/,
@@ -40,3 +37,4 @@ H5_DLL herr_t H5Pget_fapl_core(hid_t fapl_id, size_t *increment/*out*/,
#endif
#endif
+
diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c
index 29fd84f..469fe9d 100644
--- a/src/H5FDdirect.c
+++ b/src/H5FDdirect.c
@@ -155,6 +155,7 @@ typedef struct H5FD_direct_t {
(file_offset_t)((A)+(Z))<(file_offset_t)(A))
/* Prototypes */
+static herr_t H5FD_direct_term(void);
static void *H5FD_direct_fapl_get(H5FD_t *file);
static void *H5FD_direct_fapl_copy(const void *_old_fa);
static H5FD_t *H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id,
@@ -176,6 +177,7 @@ static const H5FD_class_t H5FD_direct_g = {
"direct", /*name */
MAXADDR, /*maxaddr */
H5F_CLOSE_WEAK, /* fc_degree */
+ H5FD_direct_term, /*terminate */
NULL, /*sb_size */
NULL, /*sb_encode */
NULL, /*sb_decode */
@@ -272,16 +274,14 @@ done:
*
* Purpose: Shut down the VFD
*
- * Return: <none>
+ * Returns: Non-negative on success or negative on failure
*
* Programmer: Raymond Lu
* Wednesday, 20 September 2006
*
- * Modification:
- *
*---------------------------------------------------------------------------
*/
-void
+static herr_t
H5FD_direct_term(void)
{
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_direct_term)
@@ -289,7 +289,7 @@ H5FD_direct_term(void)
/* Reset VFL ID */
H5FD_DIRECT_g=0;
- FUNC_LEAVE_NOAPI_VOID
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5FD_direct_term() */
@@ -677,7 +677,7 @@ H5FD_direct_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
const H5FD_direct_t *f2 = (const H5FD_direct_t*)_f2;
int ret_value=0;
- FUNC_ENTER_NOAPI(H5FD_direct_cmp, H5FD_VFD_DEFAULT)
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_direct_cmp)
#ifdef _WIN32
if (f1->fileindexhi < f2->fileindexhi) HGOTO_DONE(-1)
diff --git a/src/H5FDdirect.h b/src/H5FDdirect.h
index 26c70f3..5ceb91f 100644
--- a/src/H5FDdirect.h
+++ b/src/H5FDdirect.h
@@ -22,8 +22,6 @@
#ifndef H5FDdirect_H
#define H5FDdirect_H
-#include "H5Ipublic.h"
-
#ifdef H5_HAVE_DIRECT
# define H5FD_DIRECT (H5FD_direct_init())
#else
@@ -42,7 +40,6 @@ extern "C" {
#define CBSIZE_DEF 16*1024*1024
H5_DLL hid_t H5FD_direct_init(void);
-H5_DLL void H5FD_direct_term(void);
H5_DLL herr_t H5Pset_fapl_direct(hid_t fapl_id, size_t alignment, size_t block_size,
size_t cbuf_size);
H5_DLL herr_t H5Pget_fapl_direct(hid_t fapl_id, size_t *boundary/*out*/,
@@ -55,3 +52,4 @@ H5_DLL herr_t H5Pget_fapl_direct(hid_t fapl_id, size_t *boundary/*out*/,
#endif /* H5_HAVE_DIRECT */
#endif
+
diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c
index 5fd0294..1d8d7c1 100644
--- a/src/H5FDfamily.c
+++ b/src/H5FDfamily.c
@@ -88,6 +88,7 @@ typedef struct H5FD_family_dxpl_t {
} H5FD_family_dxpl_t;
/* Callback prototypes */
+static herr_t H5FD_family_term(void);
static void *H5FD_family_fapl_get(H5FD_t *_file);
static void *H5FD_family_fapl_copy(const void *_old_fa);
static herr_t H5FD_family_fapl_free(void *_fa);
@@ -119,6 +120,7 @@ static const H5FD_class_t H5FD_family_g = {
"family", /*name */
HADDR_MAX, /*maxaddr */
H5F_CLOSE_WEAK, /*fc_degree */
+ H5FD_family_term, /*terminate */
H5FD_family_sb_size, /*sb_size */
H5FD_family_sb_encode, /*sb_encode */
H5FD_family_sb_decode, /*sb_decode */
@@ -212,16 +214,14 @@ done:
*
* Purpose: Shut down the VFD
*
- * Return: <none>
+ * Returns: Non-negative on success or negative on failure
*
* Programmer: Quincey Koziol
* Friday, Jan 30, 2004
*
- * Modification:
- *
*---------------------------------------------------------------------------
*/
-void
+static herr_t
H5FD_family_term(void)
{
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_family_term)
@@ -229,7 +229,7 @@ H5FD_family_term(void)
/* Reset VFL ID */
H5FD_FAMILY_g=0;
- FUNC_LEAVE_NOAPI_VOID
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5FD_family_term() */
@@ -957,18 +957,18 @@ H5FD_family_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
{
const H5FD_family_t *f1 = (const H5FD_family_t*)_f1;
const H5FD_family_t *f2 = (const H5FD_family_t*)_f2;
- int ret_value=(H5FD_VFD_DEFAULT);
+ int ret_value = 0;
- FUNC_ENTER_NOAPI(H5FD_family_cmp, H5FD_VFD_DEFAULT)
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_family_cmp)
- assert(f1->nmembs>=1 && f1->memb[0]);
- assert(f2->nmembs>=1 && f2->memb[0]);
+ HDassert(f1->nmembs >= 1 && f1->memb[0]);
+ HDassert(f2->nmembs >= 1 && f2->memb[0]);
- ret_value= H5FDcmp(f1->memb[0], f2->memb[0]);
+ ret_value = H5FDcmp(f1->memb[0], f2->memb[0]);
done:
FUNC_LEAVE_NOAPI(ret_value)
-}
+} /* end H5FD_family_cmp() */
/*-------------------------------------------------------------------------
diff --git a/src/H5FDfamily.h b/src/H5FDfamily.h
index dcb63e6..80969c3 100644
--- a/src/H5FDfamily.h
+++ b/src/H5FDfamily.h
@@ -22,8 +22,6 @@
#ifndef H5FDfamily_H
#define H5FDfamily_H
-#include "H5Ipublic.h"
-
#define H5FD_FAMILY (H5FD_family_init())
#ifdef __cplusplus
@@ -31,7 +29,6 @@ extern "C" {
#endif
H5_DLL hid_t H5FD_family_init(void);
-H5_DLL void H5FD_family_term(void);
H5_DLL herr_t H5Pset_fapl_family(hid_t fapl_id, hsize_t memb_size,
hid_t memb_fapl_id);
H5_DLL herr_t H5Pget_fapl_family(hid_t fapl_id, hsize_t *memb_size/*out*/,
@@ -42,3 +39,4 @@ H5_DLL herr_t H5Pget_fapl_family(hid_t fapl_id, hsize_t *memb_size/*out*/,
#endif
#endif
+
diff --git a/src/H5FDlog.c b/src/H5FDlog.c
index 76053ec..e9ca89d 100644
--- a/src/H5FDlog.c
+++ b/src/H5FDlog.c
@@ -161,6 +161,7 @@ typedef struct H5FD_log_t {
(HDoff_t)((A)+(Z))<(HDoff_t)(A))
/* Prototypes */
+static herr_t H5FD_log_term(void);
static void *H5FD_log_fapl_get(H5FD_t *file);
static void *H5FD_log_fapl_copy(const void *_old_fa);
static herr_t H5FD_log_fapl_free(void *_fa);
@@ -184,6 +185,7 @@ static const H5FD_class_t H5FD_log_g = {
"log", /*name */
MAXADDR, /*maxaddr */
H5F_CLOSE_WEAK, /* fc_degree */
+ H5FD_log_term, /*terminate */
NULL, /*sb_size */
NULL, /*sb_encode */
NULL, /*sb_decode */
@@ -277,14 +279,14 @@ done:
*
* Purpose: Shut down the VFD
*
- * Return: <none>
+ * Returns: Non-negative on success or negative on failure
*
* Programmer: Quincey Koziol
* Friday, Jan 30, 2004
*
*---------------------------------------------------------------------------
*/
-void
+static herr_t
H5FD_log_term(void)
{
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_log_term)
@@ -292,7 +294,7 @@ H5FD_log_term(void)
/* Reset VFL ID */
H5FD_LOG_g = 0;
- FUNC_LEAVE_NOAPI_VOID
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5FD_log_term() */
diff --git a/src/H5FDlog.h b/src/H5FDlog.h
index ffc4df1..2f1544e 100644
--- a/src/H5FDlog.h
+++ b/src/H5FDlog.h
@@ -22,8 +22,6 @@
#ifndef H5FDlog_H
#define H5FDlog_H
-#include "H5Ipublic.h"
-
#define H5FD_LOG (H5FD_log_init())
/* Flags for H5Pset_fapl_log() */
@@ -61,7 +59,6 @@ extern "C" {
#endif
H5_DLL hid_t H5FD_log_init(void);
-H5_DLL void H5FD_log_term(void);
H5_DLL herr_t H5Pset_fapl_log(hid_t fapl_id, const char *logfile, unsigned long long flags, size_t buf_size);
#ifdef __cplusplus
diff --git a/src/H5FDmpi.h b/src/H5FDmpi.h
index b9998dd..2b7ac98 100644
--- a/src/H5FDmpi.h
+++ b/src/H5FDmpi.h
@@ -73,10 +73,6 @@ typedef struct H5FD_class_mpi_t {
/* Macros */
-/* Single macro to check for all file drivers that use MPI */
-#define IS_H5FD_MPI(file) \
- (IS_H5FD_MPIO(file) || IS_H5FD_MPIPOSIX(file))
-
#ifdef H5_HAVE_PARALLEL
/* ======== Temporary data transfer properties ======== */
/* Definitions for memory MPI type property */
diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c
index b382fb4..480334b 100644
--- a/src/H5FDmpio.c
+++ b/src/H5FDmpio.c
@@ -65,6 +65,7 @@ typedef struct H5FD_mpio_t {
/* Private Prototypes */
/* Callbacks */
+static herr_t H5FD_mpio_term(void);
static void *H5FD_mpio_fapl_get(H5FD_t *_file);
static void *H5FD_mpio_fapl_copy(const void *_old_fa);
static herr_t H5FD_mpio_fapl_free(void *_fa);
@@ -98,6 +99,7 @@ static const H5FD_class_mpi_t H5FD_mpio_g = {
"mpio", /*name */
HADDR_MAX, /*maxaddr */
H5F_CLOSE_SEMI, /* fc_degree */
+ H5FD_mpio_term, /*terminate */
NULL, /*sb_size */
NULL, /*sb_encode */
NULL, /*sb_decode */
@@ -234,16 +236,14 @@ done:
*
* Purpose: Shut down the VFD
*
- * Return: <none>
+ * Returns: Non-negative on success or negative on failure
*
* Programmer: Quincey Koziol
* Friday, Jan 30, 2004
*
- * Modification:
- *
*---------------------------------------------------------------------------
*/
-void
+static herr_t
H5FD_mpio_term(void)
{
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_mpio_term)
@@ -251,7 +251,7 @@ H5FD_mpio_term(void)
/* Reset VFL ID */
H5FD_MPIO_g=0;
- FUNC_LEAVE_NOAPI_VOID
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5FD_mpio_term() */
@@ -1163,8 +1163,10 @@ H5FD_mpio_query(const H5FD_t UNUSED *_file, unsigned long *flags /* out */)
/* Set the VFL feature flags that this driver supports */
if(flags) {
*flags=0;
- *flags|=H5FD_FEAT_AGGREGATE_METADATA; /* OK to aggregate metadata allocations */
+ *flags|=H5FD_FEAT_AGGREGATE_METADATA; /* OK to aggregate metadata allocations */
*flags|=H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */
+ *flags|=H5FD_FEAT_HAS_MPI; /* This driver uses MPI */
+ *flags|=H5FD_FEAT_ALLOCATE_EARLY; /* Allocate space early instead of late */
} /* end if */
done:
diff --git a/src/H5FDmpio.h b/src/H5FDmpio.h
index 41baf8d..fe2d11f 100644
--- a/src/H5FDmpio.h
+++ b/src/H5FDmpio.h
@@ -46,7 +46,6 @@
extern "C" {
#endif
H5_DLL hid_t H5FD_mpio_init(void);
-H5_DLL void H5FD_mpio_term(void);
H5_DLL herr_t H5Pset_fapl_mpio(hid_t fapl_id, MPI_Comm comm, MPI_Info info);
H5_DLL herr_t H5Pget_fapl_mpio(hid_t fapl_id, MPI_Comm *comm/*out*/,
MPI_Info *info/*out*/);
@@ -63,3 +62,4 @@ H5_DLL herr_t H5Pset_dxpl_mpio_chunk_opt_ratio(hid_t dxpl_id, unsigned percent_n
#endif /* H5_HAVE_PARALLEL */
#endif
+
diff --git a/src/H5FDmpiposix.c b/src/H5FDmpiposix.c
index 7ca38cc..bcedaed 100644
--- a/src/H5FDmpiposix.c
+++ b/src/H5FDmpiposix.c
@@ -174,6 +174,7 @@ typedef struct H5FD_mpiposix_t {
(file_offset_t)((A)+(Z))<(file_offset_t)(A))
/* Callbacks */
+static herr_t H5FD_mpiposix_term(void);
static void *H5FD_mpiposix_fapl_get(H5FD_t *_file);
static void *H5FD_mpiposix_fapl_copy(const void *_old_fa);
static herr_t H5FD_mpiposix_fapl_free(void *_fa);
@@ -207,6 +208,7 @@ static const H5FD_class_mpi_t H5FD_mpiposix_g = {
"mpiposix", /*name */
MAXADDR, /*maxaddr */
H5F_CLOSE_SEMI, /* fc_degree */
+ H5FD_mpiposix_term, /*terminate */
NULL, /*sb_size */
NULL, /*sb_encode */
NULL, /*sb_decode */
@@ -304,16 +306,14 @@ done:
*
* Purpose: Shut down the VFD
*
- * Return: <none>
+ * Returns: Non-negative on success or negative on failure
*
* Programmer: Quincey Koziol
* Friday, Jan 30, 2004
*
- * Modification:
- *
*---------------------------------------------------------------------------
*/
-void
+static herr_t
H5FD_mpiposix_term(void)
{
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_mpiposix_term)
@@ -321,7 +321,7 @@ H5FD_mpiposix_term(void)
/* Reset VFL ID */
H5FD_MPIPOSIX_g=0;
- FUNC_LEAVE_NOAPI_VOID
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5FD_mpiposix_term() */
@@ -868,7 +868,7 @@ H5FD_mpiposix_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
const H5FD_mpiposix_t *f2 = (const H5FD_mpiposix_t*)_f2;
int ret_value=0;
- FUNC_ENTER_NOAPI(H5FD_mpiposix_cmp, H5FD_VFD_DEFAULT)
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_mpiposix_cmp)
#ifdef _WIN32
if (f1->fileindexhi < f2->fileindexhi) HGOTO_DONE(-1)
@@ -931,8 +931,10 @@ H5FD_mpiposix_query(const H5FD_t UNUSED *_file, unsigned long *flags /* out */)
/* Set the VFL feature flags that this driver supports */
if(flags) {
*flags=0;
- *flags|=H5FD_FEAT_AGGREGATE_METADATA; /* OK to aggregate metadata allocations */
+ *flags|=H5FD_FEAT_AGGREGATE_METADATA; /* OK to aggregate metadata allocations */
*flags|=H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */
+ *flags|=H5FD_FEAT_HAS_MPI; /* This driver uses MPI */
+ *flags|=H5FD_FEAT_ALLOCATE_EARLY; /* Allocate space early instead of late */
} /* end if */
done:
diff --git a/src/H5FDmpiposix.h b/src/H5FDmpiposix.h
index 832839e..af13fad 100644
--- a/src/H5FDmpiposix.h
+++ b/src/H5FDmpiposix.h
@@ -42,7 +42,6 @@ extern "C" {
#endif
H5_DLL hid_t H5FD_mpiposix_init(void);
-H5_DLL void H5FD_mpiposix_term(void);
H5_DLL herr_t H5Pset_fapl_mpiposix(hid_t fapl_id, MPI_Comm comm, hbool_t use_gpfs);
H5_DLL herr_t H5Pget_fapl_mpiposix(hid_t fapl_id, MPI_Comm *comm/*out*/, hbool_t *use_gpfs/*out*/);
diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c
index 328b530..9c30104 100644
--- a/src/H5FDmulti.c
+++ b/src/H5FDmulti.c
@@ -115,6 +115,7 @@ static int compute_next(H5FD_multi_t *file);
static int open_members(H5FD_multi_t *file);
/* Callback prototypes */
+static herr_t H5FD_multi_term(void);
static hsize_t H5FD_multi_sb_size(H5FD_t *file);
static herr_t H5FD_multi_sb_encode(H5FD_t *file, char *name/*out*/,
unsigned char *buf/*out*/);
@@ -150,6 +151,7 @@ static const H5FD_class_t H5FD_multi_g = {
"multi", /*name */
HADDR_MAX, /*maxaddr */
H5F_CLOSE_WEAK, /* fc_degree */
+ H5FD_multi_term, /*terminate */
H5FD_multi_sb_size, /*sb_size */
H5FD_multi_sb_encode, /*sb_encode */
H5FD_multi_sb_decode, /*sb_decode */
@@ -247,21 +249,20 @@ H5FD_multi_init(void)
*
* Purpose: Shut down the VFD
*
- * Return: <none>
+ * Returns: Non-negative on success or negative on failure
*
* Programmer: Quincey Koziol
* Friday, Jan 30, 2004
*
- * Modification:
- *
*---------------------------------------------------------------------------
*/
-void
+static herr_t
H5FD_multi_term(void)
{
/* Reset VFL ID */
H5FD_MULTI_g=0;
+ return 0;
} /* end H5FD_multi_term() */
diff --git a/src/H5FDmulti.h b/src/H5FDmulti.h
index c7e54ce..da16b0c 100644
--- a/src/H5FDmulti.h
+++ b/src/H5FDmulti.h
@@ -22,17 +22,12 @@
#ifndef H5FDmulti_H
#define H5FDmulti_H
-#include "H5Ipublic.h"
-#include "H5Ppublic.h" /* Property lists */
-#include "H5Fpublic.h"
-
#define H5FD_MULTI (H5FD_multi_init())
#ifdef __cplusplus
extern "C" {
#endif
H5_DLL hid_t H5FD_multi_init(void);
-H5_DLL void H5FD_multi_term(void);
H5_DLL herr_t H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map,
const hid_t *memb_fapl, const char * const *memb_name,
const haddr_t *memb_addr, hbool_t relax);
@@ -50,3 +45,4 @@ H5_DLL herr_t H5Pset_fapl_split(hid_t fapl, const char *meta_ext,
#endif
#endif
+
diff --git a/src/H5FDpublic.h b/src/H5FDpublic.h
index c8ec658..f495e2d 100644
--- a/src/H5FDpublic.h
+++ b/src/H5FDpublic.h
@@ -209,8 +209,19 @@ typedef enum H5F_mem_t H5FD_mem_t;
* the handle for the VFD (returned with the 'get_handle' callback) is
* of type 'int' and is compatible with POSIX I/O calls.
*/
-#define H5FD_FEAT_POSIX_COMPAT_HANDLE 0x00000080
-
+#define H5FD_FEAT_POSIX_COMPAT_HANDLE 0x00000080
+ /*
+ * Defining the H5FD_FEAT_HAS_MPI for a VFL driver means that
+ * the driver makes use of MPI communication and code may retrieve
+ * communicator/rank information from it
+ */
+#define H5FD_FEAT_HAS_MPI 0x00000100
+ /*
+ * Defining the H5FD_FEAT_ALLOCATE_EARLY for a VFL driver means that
+ * the library will use the H5D_ALLOC_TIME_EARLY on dataset create
+ * instead of the default H5D_ALLOC_TIME_LATE
+ */
+#define H5FD_FEAT_ALLOCATE_EARLY 0x00000200
/* Forward declaration */
typedef struct H5FD_t H5FD_t;
@@ -220,6 +231,7 @@ typedef struct H5FD_class_t {
const char *name;
haddr_t maxaddr;
H5F_close_degree_t fc_degree;
+ herr_t (*terminate)(void);
hsize_t (*sb_size)(H5FD_t *file);
herr_t (*sb_encode)(H5FD_t *file, char *name/*out*/,
unsigned char *p/*out*/);
diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c
index 1153df7..bb5dc15 100644
--- a/src/H5FDsec2.c
+++ b/src/H5FDsec2.c
@@ -127,6 +127,7 @@ typedef struct H5FD_sec2_t {
(HDoff_t)((A)+(Z))<(HDoff_t)(A))
/* Prototypes */
+static herr_t H5FD_sec2_term(void);
static H5FD_t *H5FD_sec2_open(const char *name, unsigned flags, hid_t fapl_id,
haddr_t maxaddr);
static herr_t H5FD_sec2_close(H5FD_t *_file);
@@ -146,6 +147,7 @@ static const H5FD_class_t H5FD_sec2_g = {
"sec2", /*name */
MAXADDR, /*maxaddr */
H5F_CLOSE_WEAK, /* fc_degree */
+ H5FD_sec2_term, /*terminate */
NULL, /*sb_size */
NULL, /*sb_encode */
NULL, /*sb_decode */
@@ -239,14 +241,14 @@ done:
*
* Purpose: Shut down the VFD
*
- * Return: <none>
+ * Returns: Non-negative on success or negative on failure
*
* Programmer: Quincey Koziol
* Friday, Jan 30, 2004
*
*---------------------------------------------------------------------------
*/
-void
+static herr_t
H5FD_sec2_term(void)
{
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_sec2_term)
@@ -254,7 +256,7 @@ H5FD_sec2_term(void)
/* Reset VFL ID */
H5FD_SEC2_g = 0;
- FUNC_LEAVE_NOAPI_VOID
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5FD_sec2_term() */
diff --git a/src/H5FDsec2.h b/src/H5FDsec2.h
index b7db0d5..0c62597 100644
--- a/src/H5FDsec2.h
+++ b/src/H5FDsec2.h
@@ -22,8 +22,6 @@
#ifndef H5FDsec2_H
#define H5FDsec2_H
-#include "H5Ipublic.h"
-
#define H5FD_SEC2 (H5FD_sec2_init())
#ifdef __cplusplus
@@ -31,7 +29,6 @@ extern "C" {
#endif
H5_DLL hid_t H5FD_sec2_init(void);
-H5_DLL void H5FD_sec2_term(void);
H5_DLL herr_t H5Pset_fapl_sec2(hid_t fapl_id);
#ifdef __cplusplus
diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c
index 9bc4161..4c53769 100644
--- a/src/H5FDstdio.c
+++ b/src/H5FDstdio.c
@@ -170,6 +170,7 @@ typedef struct H5FD_stdio_t {
HADDR_UNDEF==(A)+(Z) || (file_offset_t)((A)+(Z))<(file_offset_t)(A))
/* Prototypes */
+static herr_t H5FD_stdio_term(void);
static H5FD_t *H5FD_stdio_open(const char *name, unsigned flags,
hid_t fapl_id, haddr_t maxaddr);
static herr_t H5FD_stdio_close(H5FD_t *lf);
@@ -191,6 +192,7 @@ static const H5FD_class_t H5FD_stdio_g = {
"stdio", /*name */
MAXADDR, /*maxaddr */
H5F_CLOSE_WEAK, /* fc_degree */
+ H5FD_stdio_term, /*terminate */
NULL, /*sb_size */
NULL, /*sb_encode */
NULL, /*sb_decode */
@@ -257,21 +259,20 @@ H5FD_stdio_init(void)
*
* Purpose: Shut down the VFD
*
- * Return: <none>
+ * Returns: Non-negative on success or negative on failure
*
* Programmer: Quincey Koziol
* Friday, Jan 30, 2004
*
- * Modification:
- *
*---------------------------------------------------------------------------
*/
-void
+static herr_t
H5FD_stdio_term(void)
{
/* Reset VFL ID */
H5FD_STDIO_g=0;
+ return 0;
} /* end H5FD_stdio_term() */
diff --git a/src/H5FDstdio.h b/src/H5FDstdio.h
index 80443d8..8281705 100644
--- a/src/H5FDstdio.h
+++ b/src/H5FDstdio.h
@@ -31,7 +31,6 @@ extern "C" {
#endif
H5_DLL hid_t H5FD_stdio_init(void);
-H5_DLL void H5FD_stdio_term(void);
H5_DLL herr_t H5Pset_fapl_stdio(hid_t fapl_id);
#ifdef __cplusplus
diff --git a/src/H5FDwindows.c b/src/H5FDwindows.c
index 47c7f2d..de3fe33 100644
--- a/src/H5FDwindows.c
+++ b/src/H5FDwindows.c
@@ -127,6 +127,7 @@ typedef struct H5FD_windows_t {
(fseek_offset_t)((A)+(Z))<(fseek_offset_t)(A))
/* Prototypes */
+static herr_t H5FD_windows_term(void);
static H5FD_t *H5FD_windows_open(const char *name, unsigned flags, hid_t fapl_id,
haddr_t maxaddr);
static herr_t H5FD_windows_close(H5FD_t *_file);
@@ -149,6 +150,7 @@ static const H5FD_class_t H5FD_windows_g = {
"windows", /*name */
MAXADDR, /*maxaddr */
H5F_CLOSE_WEAK, /* fc_degree */
+ H5FD_windows_term, /*terminate */
NULL, /*sb_size */
NULL, /*sb_encode */
NULL, /*sb_decode */
@@ -240,17 +242,14 @@ done:
*
* Purpose: Shut down the VFD
*
- * Return: <none>
+ * Returns: Non-negative on success or negative on failure
*
* Programmer: Scott Wegner
- * Based on code by Quincey Koziol
* Thursday, May 24 2007
*
- * Modification:
- *
*---------------------------------------------------------------------------
*/
-void
+static herr_t
H5FD_windows_term(void)
{
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_windows_term)
@@ -258,7 +257,7 @@ H5FD_windows_term(void)
/* Reset VFL ID */
H5FD_WINDOWS_g=0;
- FUNC_LEAVE_NOAPI_VOID
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5FD_windows_term() */
/*-------------------------------------------------------------------------
@@ -512,10 +511,10 @@ H5FD_windows_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
const H5FD_windows_t *f2 = (const H5FD_windows_t*)_f2;
int ret_value=0;
- FUNC_ENTER_NOAPI(H5FD_windows_cmp, H5FD_VFD_DEFAULT)
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_windows_cmp)
- if (f1->volumeserialnumber < f2->volumeserialnumber) HGOTO_DONE(-1)
- if (f1->volumeserialnumber > f2->volumeserialnumber) HGOTO_DONE(1)
+ if (f1->volumeserialnumber < f2->volumeserialnumber) HGOTO_DONE(-1)
+ if (f1->volumeserialnumber > f2->volumeserialnumber) HGOTO_DONE(1)
if (f1->fileindexhi < f2->fileindexhi) HGOTO_DONE(-1)
if (f1->fileindexhi > f2->fileindexhi) HGOTO_DONE(1)
diff --git a/src/H5FDwindows.h b/src/H5FDwindows.h
index 8277f149..16d501e 100644
--- a/src/H5FDwindows.h
+++ b/src/H5FDwindows.h
@@ -23,8 +23,6 @@
#ifndef H5FDwindows_H
#define H5FDwindows_H
-#include "H5Ipublic.h"
-
#define H5FD_WINDOWS (H5FD_windows_init())
#ifdef __cplusplus
@@ -32,7 +30,6 @@ extern "C" {
#endif
H5_DLL hid_t H5FD_windows_init(void);
-H5_DLL void H5FD_windows_term(void);
H5_DLL herr_t H5Pset_fapl_windows(hid_t fapl_id);
#ifdef __cplusplus
@@ -40,3 +37,4 @@ H5_DLL herr_t H5Pset_fapl_windows(hid_t fapl_id);
#endif
#endif
+
diff --git a/src/hdf5.h b/src/hdf5.h
index ef15063..a37329d 100644
--- a/src/hdf5.h
+++ b/src/hdf5.h
@@ -41,6 +41,7 @@
/* Predefined file drivers */
#include "H5FDcore.h" /* Files stored entirely in memory */
+#include "H5FDdirect.h" /* Linux direct I/O */
#include "H5FDfamily.h" /* File families */
#include "H5FDlog.h" /* sec2 driver with I/O logging (for debugging) */
#include "H5FDmpi.h" /* MPI-based file drivers */
@@ -50,6 +51,5 @@
#ifdef H5_HAVE_WINDOWS
#include "H5FDwindows.h" /* Windows buffered I/O */
#endif
-#include "H5FDdirect.h" /* Linux direct I/O */
#endif