summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorjhendersonHDF <jhenderson@hdfgroup.org>2022-08-16 21:08:52 (GMT)
committerGitHub <noreply@github.com>2022-08-16 21:08:52 (GMT)
commitd9247ec17e8abe53af0a439e1a1b58ade6ae5310 (patch)
tree98c7f123dfde1eedb02575eaf64f989bcf2ba724 /src
parent75baddbf62ae87c09a9654c4398408752cc9236b (diff)
downloadhdf5-d9247ec17e8abe53af0a439e1a1b58ade6ae5310.zip
hdf5-d9247ec17e8abe53af0a439e1a1b58ade6ae5310.tar.gz
hdf5-d9247ec17e8abe53af0a439e1a1b58ade6ae5310.tar.bz2
[1.12 Merge] Hdf5 1 12 develop merges (#2012)
* Fix invalid comment about character encoding in H5Fint.c (#1845) * Convert assertion on (possibly corrupt) file contents to normal error check (#1861) * Convert assertion on (possibly corrupt) file contents to normal error check * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Avoid allocating chunk map for contiguous and compact dataset I/O (#1927) * Add documentation for parallel compression feature (#1981) Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'src')
-rw-r--r--src/H5Dio.c20
-rw-r--r--src/H5Fint.c7
-rw-r--r--src/H5Fsuper.c4
3 files changed, 23 insertions, 8 deletions
diff --git a/src/H5Dio.c b/src/H5Dio.c
index 466cfdf..bd98aa2 100644
--- a/src/H5Dio.c
+++ b/src/H5Dio.c
@@ -366,6 +366,7 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, H5S_t *mem_space, H5S_t *file_space
H5D_chunk_map_t *fm = NULL; /* Chunk file<->memory mapping */
H5D_io_info_t io_info; /* Dataset I/O info */
H5D_type_info_t type_info; /* Datatype info for operation */
+ H5D_layout_t layout_type; /* Dataset's layout type (contig, chunked, compact, etc.) */
hbool_t type_info_init = FALSE; /* Whether the datatype info has been initialized */
H5S_t *projected_mem_space = NULL; /* If not NULL, ptr to dataspace containing a */
/* projection of the supplied mem_space to a new */
@@ -397,6 +398,8 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, H5S_t *mem_space, H5S_t *file_space
mem_space = file_space;
nelmts = H5S_GET_SELECT_NPOINTS(mem_space);
+ layout_type = dataset->shared->layout.type;
+
/* Set up datatype info for operation */
if (H5D__typeinfo_init(dataset, mem_type_id, FALSE, &type_info) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set up type info")
@@ -521,11 +524,13 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, H5S_t *mem_space, H5S_t *file_space
HDassert((*dataset->shared->layout.ops->is_space_alloc)(&dataset->shared->layout.storage) ||
(dataset->shared->layout.ops->is_data_cached &&
(*dataset->shared->layout.ops->is_data_cached)(dataset->shared)) ||
- dataset->shared->dcpl_cache.efl.nused > 0 || dataset->shared->layout.type == H5D_COMPACT);
+ dataset->shared->dcpl_cache.efl.nused > 0 || layout_type == H5D_COMPACT);
/* Allocate the chunk map */
- if (NULL == (fm = H5FL_CALLOC(H5D_chunk_map_t)))
- HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "can't allocate chunk map")
+ if (H5D_CONTIGUOUS != layout_type && H5D_COMPACT != layout_type) {
+ if (NULL == (fm = H5FL_CALLOC(H5D_chunk_map_t)))
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "can't allocate chunk map")
+ }
/* Call storage method's I/O initialization routine */
if (io_info.layout_ops.io_init &&
@@ -581,6 +586,7 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, H5S_t *mem_space, H5S_t *file_spac
H5D_chunk_map_t *fm = NULL; /* Chunk file<->memory mapping */
H5D_io_info_t io_info; /* Dataset I/O info */
H5D_type_info_t type_info; /* Datatype info for operation */
+ H5D_layout_t layout_type; /* Dataset's layout type (contig, chunked, compact, etc.) */
hbool_t type_info_init = FALSE; /* Whether the datatype info has been initialized */
hbool_t should_alloc_space = FALSE; /* Whether or not to initialize dataset's storage */
H5S_t *projected_mem_space = NULL; /* If not NULL, ptr to dataspace containing a */
@@ -607,6 +613,8 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, H5S_t *mem_space, H5S_t *file_spac
/* check args */
HDassert(dataset && dataset->oloc.file);
+ layout_type = dataset->shared->layout.type;
+
/* All filters in the DCPL must have encoding enabled. */
if (!dataset->shared->checked_filters) {
if (H5Z_can_apply(dataset->shared->dcpl_id, dataset->shared->type_id) < 0)
@@ -753,8 +761,10 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, H5S_t *mem_space, H5S_t *file_spac
} /* end if */
/* Allocate the chunk map */
- if (NULL == (fm = H5FL_CALLOC(H5D_chunk_map_t)))
- HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "can't allocate chunk map")
+ if (H5D_CONTIGUOUS != layout_type && H5D_COMPACT != layout_type) {
+ if (NULL == (fm = H5FL_CALLOC(H5D_chunk_map_t)))
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "can't allocate chunk map")
+ }
/* Call storage method's I/O initialization routine */
if (io_info.layout_ops.io_init &&
diff --git a/src/H5Fint.c b/src/H5Fint.c
index 8d2af3d..1da8c01 100644
--- a/src/H5Fint.c
+++ b/src/H5Fint.c
@@ -2708,10 +2708,13 @@ H5F__build_actual_name(const H5F_t *f, const H5P_genplist_t *fapl, const char *n
if (NULL == (new_fapl = (H5P_genplist_t *)H5I_object(new_fapl_id)))
HGOTO_ERROR(H5E_FILE, H5E_CANTCREATE, FAIL, "can't get property list")
- /* Set the character encoding on the new property list */
+ /*
+ * Set the private property for retrieving the backing store
+ * POSIX file descriptor from the Core VFD
+ */
want_posix_fd = TRUE;
if (H5P_set(new_fapl, H5F_ACS_WANT_POSIX_FD_NAME, &want_posix_fd) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set character encoding")
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set property for retrieving file descriptor")
/* Retrieve the file handle */
if (H5F_get_vfd_handle(f, new_fapl_id, (void **)&fd) < 0)
diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c
index 6f6df96..62d0398 100644
--- a/src/H5Fsuper.c
+++ b/src/H5Fsuper.c
@@ -686,7 +686,9 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read)
/* Sanity check - superblock extension should only be defined for
* superblock version >= 2.
*/
- HDassert(sblock->super_vers >= HDF5_SUPERBLOCK_VERSION_2);
+ if (sblock->super_vers < HDF5_SUPERBLOCK_VERSION_2)
+ HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL,
+ "invalid superblock - extension message should not be defined for version < 2")
/* Check for superblock extension being located "outside" the stored
* 'eoa' value, which can occur with the split/multi VFD.