summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@koziol.gov>2020-05-01 22:59:57 (GMT)
committerQuincey Koziol <koziol@koziol.gov>2020-05-04 18:17:04 (GMT)
commit2edc8daa16f32d1f6ebe1edf8d415a9a58ba6288 (patch)
treeede81e945081a18951ddd42ee5268ff7863f35a8 /src
parent286d296aa7ab3085903ad677b3fd3f25e216c84d (diff)
downloadhdf5-2edc8daa16f32d1f6ebe1edf8d415a9a58ba6288.zip
hdf5-2edc8daa16f32d1f6ebe1edf8d415a9a58ba6288.tar.gz
hdf5-2edc8daa16f32d1f6ebe1edf8d415a9a58ba6288.tar.bz2
Avoid allocating a chunk index for datasets with 0-sized dimensions, until
the dataset is extended.
Diffstat (limited to 'src')
-rw-r--r--src/H5Dint.c2
-rw-r--r--src/H5Dlayout.c6
2 files changed, 5 insertions, 3 deletions
diff --git a/src/H5Dint.c b/src/H5Dint.c
index 73dc526..4750ad6 100644
--- a/src/H5Dint.c
+++ b/src/H5Dint.c
@@ -2291,7 +2291,7 @@ H5D__alloc_storage(const H5D_io_info_t *io_info, H5D_time_alloc_t time_alloc,
* We assume that external storage is already
* allocated by the caller, or at least will be before I/O is performed.
*/
- if(!(H5S_NULL == H5S_GET_EXTENT_TYPE(dset->shared->space) || dset->shared->dcpl_cache.efl.nused > 0)) {
+ if(!(0 == H5S_GET_EXTENT_NPOINTS(dset->shared->space) || dset->shared->dcpl_cache.efl.nused > 0)) {
/* Get a pointer to the dataset's layout information */
layout = &(dset->shared->layout);
diff --git a/src/H5Dlayout.c b/src/H5Dlayout.c
index c71cdc4..7ac274c 100644
--- a/src/H5Dlayout.c
+++ b/src/H5Dlayout.c
@@ -558,10 +558,12 @@ H5D__layout_oh_create(H5F_t *file, H5O_t *oh, H5D_t *dset, hid_t dapl_id)
} /* end if */
/* Create layout message */
- /* (Don't make layout message constant unless allocation time is early and non-filtered, since space may not be allocated) */
+ /* (Don't make layout message constant unless allocation time is early and
+ * non-filtered and has >0 elements, since space may not be allocated -QAK) */
/* (Note: this is relying on H5D__alloc_storage not calling H5O_msg_write during dataset creation) */
if(fill_prop->alloc_time == H5D_ALLOC_TIME_EARLY && H5D_COMPACT != layout->type
- && !dset->shared->dcpl_cache.pline.nused)
+ && !dset->shared->dcpl_cache.pline.nused
+ && (0 != H5S_GET_EXTENT_NPOINTS(dset->shared->space)))
layout_mesg_flags = H5O_MSG_FLAG_CONSTANT;
else
layout_mesg_flags = 0;