From 14c286d51a13658ea26673efa3f197af06757cee Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 19 May 2017 14:58:34 -0700 Subject: Fixed HDFFV-10214: * Updated comments in the library to accurately reflect the semantics of the H5FD_FEAT_POSIX_COMPAT_HANDLE flag. * Removed the check for the POSIX compatible handle feature flag when determining if a VFD supports SWMR. Partial work for HDFFV-10197: * Added a new H5FD_FEAT_DEFAULT_VFD_COMPATIBLE feature flag that is set when a VFD creates output that is compatible with the default VFD. Will be used in the testing but might also be generally useful to users. --- src/H5FDcore.c | 8 +++++--- src/H5FDdirect.c | 1 + src/H5FDlog.c | 3 ++- src/H5FDmpio.c | 9 +++++---- src/H5FDpublic.h | 8 ++++++++ src/H5FDsec2.c | 3 ++- src/H5FDstdio.c | 9 +++++---- src/H5Fint.c | 4 ---- 8 files changed, 28 insertions(+), 17 deletions(-) diff --git a/src/H5FDcore.c b/src/H5FDcore.c index d100a8b..b980b7e 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -982,9 +982,11 @@ H5FD__core_query(const H5FD_t * _file, unsigned long *flags /* out */) *flags |= H5FD_FEAT_ALLOW_FILE_IMAGE; /* OK to use file image feature with this VFD */ *flags |= H5FD_FEAT_CAN_USE_FILE_IMAGE_CALLBACKS; /* OK to use file image callbacks with this VFD */ - /* If the backing store is open, a POSIX file handle is available */ - if(file && file->fd >= 0 && file->backing_store) - *flags |= H5FD_FEAT_POSIX_COMPAT_HANDLE; /* VFD handle is POSIX I/O call compatible */ + /* These feature flags are only applicable if the backing store is enabled */ + if(file && file->fd >= 0 && file->backing_store) { + *flags |= H5FD_FEAT_POSIX_COMPAT_HANDLE; /* get_handle callback returns a POSIX file descriptor */ + *flags |= H5FD_FEAT_DEFAULT_VFD_COMPATIBLE; /* VFD creates a file which can be opened with the default VFD */ + } } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c index 1487cda..7a4c99c 100644 --- a/src/H5FDdirect.c +++ b/src/H5FDdirect.c @@ -698,6 +698,7 @@ H5FD_direct_query(const H5FD_t H5_ATTR_UNUSED * _f, unsigned long *flags /* out *flags |= H5FD_FEAT_ACCUMULATE_METADATA; /* OK to accumulate metadata for faster writes */ *flags |= H5FD_FEAT_DATA_SIEVE; /* OK to perform data sieving for faster raw data reads & writes */ *flags |= H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */ + *flags |= H5FD_FEAT_DEFAULT_VFD_COMPATIBLE; /* VFD creates a file which can be opened with the default VFD */ } FUNC_LEAVE_NOAPI(SUCCEED) diff --git a/src/H5FDlog.c b/src/H5FDlog.c index 75333c2..7c6bbd4 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -895,8 +895,9 @@ H5FD_log_query(const H5FD_t *_file, unsigned long *flags /* out */) *flags |= H5FD_FEAT_ACCUMULATE_METADATA; /* OK to accumulate metadata for faster writes */ *flags |= H5FD_FEAT_DATA_SIEVE; /* OK to perform data sieving for faster raw data reads & writes */ *flags |= H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */ - *flags |= H5FD_FEAT_POSIX_COMPAT_HANDLE; /* VFD handle is POSIX I/O call compatible */ + *flags |= H5FD_FEAT_POSIX_COMPAT_HANDLE; /* get_handle callback returns a POSIX file descriptor */ *flags |= H5FD_FEAT_SUPPORTS_SWMR_IO; /* VFD supports the single-writer/multiple-readers (SWMR) pattern */ + *flags |= H5FD_FEAT_DEFAULT_VFD_COMPATIBLE; /* VFD creates a file which can be opened with the default VFD */ /* Check for flags that are set by h5repart */ if(file && file->fam_to_sec2) diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index ace91f8..f594d8e 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -1150,10 +1150,11 @@ H5FD_mpio_query(const H5FD_t H5_ATTR_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_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 */ + *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 */ + *flags |= H5FD_FEAT_DEFAULT_VFD_COMPATIBLE; /* VFD creates a file which can be opened with the default VFD */ } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) diff --git a/src/H5FDpublic.h b/src/H5FDpublic.h index 3032e8a..45b1237 100644 --- a/src/H5FDpublic.h +++ b/src/H5FDpublic.h @@ -250,6 +250,14 @@ typedef enum H5F_mem_t H5FD_mem_t; * This is specifically used for the multi/split driver. */ #define H5FD_FEAT_PAGED_AGGR 0x00004000 + /* + * Defining H5FD_FEAT_DEFAULT_VFD_COMPATIBLE for a VFL driver + * that creates a file which is compatible with the default VFD. + * Generally, this means that the VFD creates a single file that follows + * the canonical HDF5 file format. + */ +#define H5FD_FEAT_DEFAULT_VFD_COMPATIBLE 0x00008000 + /* Forward declaration */ typedef struct H5FD_t H5FD_t; diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index 26913e2..b6385fb 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -527,8 +527,9 @@ H5FD_sec2_query(const H5FD_t *_file, unsigned long *flags /* out */) *flags |= H5FD_FEAT_ACCUMULATE_METADATA; /* OK to accumulate metadata for faster writes */ *flags |= H5FD_FEAT_DATA_SIEVE; /* OK to perform data sieving for faster raw data reads & writes */ *flags |= H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */ - *flags |= H5FD_FEAT_POSIX_COMPAT_HANDLE; /* VFD handle is POSIX I/O call compatible */ + *flags |= H5FD_FEAT_POSIX_COMPAT_HANDLE; /* get_handle callback returns a POSIX file descriptor */ *flags |= H5FD_FEAT_SUPPORTS_SWMR_IO; /* VFD supports the single-writer/multiple-readers (SWMR) pattern */ + *flags |= H5FD_FEAT_DEFAULT_VFD_COMPATIBLE; /* VFD creates a file which can be opened with the default VFD */ /* Check for flags that are set by h5repart */ if(file && file->fam_to_sec2) diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index 5023af3..861c6a6 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -555,10 +555,11 @@ H5FD_stdio_query(const H5FD_t *_f, unsigned long /*OUT*/ *flags) */ if(flags) { *flags = 0; - *flags|=H5FD_FEAT_AGGREGATE_METADATA; /* OK to aggregate metadata allocations */ - *flags|=H5FD_FEAT_ACCUMULATE_METADATA; /* OK to accumulate metadata for faster writes */ - *flags|=H5FD_FEAT_DATA_SIEVE; /* OK to perform data sieving for faster raw data reads & writes */ - *flags|=H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */ + *flags |= H5FD_FEAT_AGGREGATE_METADATA; /* OK to aggregate metadata allocations */ + *flags |= H5FD_FEAT_ACCUMULATE_METADATA; /* OK to accumulate metadata for faster writes */ + *flags |= H5FD_FEAT_DATA_SIEVE; /* OK to perform data sieving for faster raw data reads & writes */ + *flags |= H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */ + *flags |= H5FD_FEAT_DEFAULT_VFD_COMPATIBLE; /* VFD creates a file which can be opened with the default VFD */ } return 0; diff --git a/src/H5Fint.c b/src/H5Fint.c index fe532b2..e52d539 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -715,10 +715,6 @@ H5F_new(H5F_file_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t if(!H5F_HAS_FEATURE(f, H5FD_FEAT_SUPPORTS_SWMR_IO) && (H5F_INTENT(f) & (H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ))) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "must use a SWMR-compatible VFD when SWMR is specified") - /* Require a POSIX compatible VFD to use SWMR feature */ - /* (It's reasonable to try to expand this to other VFDs eventually -QAK) */ - if(!H5F_HAS_FEATURE(f, H5FD_FEAT_POSIX_COMPAT_HANDLE) && (H5F_INTENT(f) & (H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ))) - HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "must use POSIX compatible VFD with SWMR write access") if(H5FD_get_fs_type_map(lf, f->shared->fs_type_map) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't get free space type mapping from VFD") if(H5MF_init_merge_flags(f) < 0) -- cgit v0.12