summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorjhendersonHDF <jhenderson@hdfgroup.org>2022-08-16 21:09:24 (GMT)
committerGitHub <noreply@github.com>2022-08-16 21:09:24 (GMT)
commit9c9f70ed695a0022a55bf53d085b7540ae5b5281 (patch)
tree4d3105ac30f177afcbcfa9a7411a0f3eb3471e24 /src
parent21bf61ee91ce91d7a73c96d7c680f844c64c5309 (diff)
downloadhdf5-9c9f70ed695a0022a55bf53d085b7540ae5b5281.zip
hdf5-9c9f70ed695a0022a55bf53d085b7540ae5b5281.tar.gz
hdf5-9c9f70ed695a0022a55bf53d085b7540ae5b5281.tar.bz2
[1.10 Merge] Hdf5 1 10 develop merges (#2013)
* 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 0236eb0..22aacb0 100644
--- a/src/H5Dio.c
+++ b/src/H5Dio.c
@@ -405,6 +405,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 */
@@ -436,6 +437,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")
@@ -560,11 +563,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 &&
@@ -620,6 +625,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 */
@@ -646,6 +652,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)
@@ -792,8 +800,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 e52cb91..8190227 100644
--- a/src/H5Fint.c
+++ b/src/H5Fint.c
@@ -2528,10 +2528,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 093121b..4c4f087 100644
--- a/src/H5Fsuper.c
+++ b/src/H5Fsuper.c
@@ -695,7 +695,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.