summaryrefslogtreecommitdiffstats
path: root/src/H5Dint.c
diff options
context:
space:
mode:
authorNeil Fortner <fortnern@gmail.com>2022-08-23 16:08:20 (GMT)
committerGitHub <noreply@github.com>2022-08-23 16:08:20 (GMT)
commit4df97fe6eaf65f309d2cca8e8d89737483105374 (patch)
treee00b2844975397b393600e5911e39a8de00fe34c /src/H5Dint.c
parentf777350e82a0306141d3c6eb8adddc096b1c8ff1 (diff)
downloadhdf5-4df97fe6eaf65f309d2cca8e8d89737483105374.zip
hdf5-4df97fe6eaf65f309d2cca8e8d89737483105374.tar.gz
hdf5-4df97fe6eaf65f309d2cca8e8d89737483105374.tar.bz2
Persist dataset access properties when using H5Fstart_swmr_write - merge to 1.10 (#2058)
* Persist dataset access properties when using H5Fstart_swmr_write - merge to 1.12 branch (#2031) * Merge GitHub #1862 (HDFFV-11308) to 1.12 branch Persist dataset access properties when using H5Fstart_swmr_write (#1862) * Fix HDFFV-11308 - dataset access properties disappear when using H5Fstart_swmr_write. * Committing clang-format changes * Add test for H5Fstart_swmr_write() persisting DAPL settings. Fix bugs in the library exposed by this test. * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Fix bug in swmr.c introduced with recent merge (double_t) (#1913) * Fix HDFFV-11308 - dataset access properties disappear when using H5Fstart_swmr_write. * Committing clang-format changes * Add test for H5Fstart_swmr_write() persisting DAPL settings. Fix bugs in the library exposed by this test. * Committing clang-format changes * Replace accidental use of double_t in swmr.c with double. Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Add note to RELEASE.txt for HDFFV-11308 (#2029) * Add note to RELEASE.txt for HDFFV-11308 * Fix formatting error in RELEASE.txt * Committing clang-format changes * Fix inappropriate use of HGOTO_ERROR (#2055) Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'src/H5Dint.c')
-rw-r--r--src/H5Dint.c52
1 files changed, 37 insertions, 15 deletions
diff --git a/src/H5Dint.c b/src/H5Dint.c
index 8105e53..16db10d 100644
--- a/src/H5Dint.c
+++ b/src/H5Dint.c
@@ -3512,11 +3512,13 @@ done:
hid_t
H5D_get_access_plist(const H5D_t *dset)
{
- H5P_genplist_t *old_plist; /* Stored DAPL from dset */
- H5P_genplist_t *new_plist; /* New DAPL */
- H5P_genplist_t *def_fapl; /* Default FAPL */
- H5D_append_flush_t def_append_flush_info = {0}; /* Default append flush property */
- H5D_rdcc_t def_chunk_info; /* Default chunk cache property */
+ H5P_genplist_t *old_plist; /* Stored DAPL from dset */
+ H5P_genplist_t *new_plist; /* New DAPL */
+ H5P_genplist_t *def_dapl = NULL; /* Default DAPL */
+ H5D_append_flush_t def_append_flush_info = {0}; /* Default append flush property */
+ H5D_rdcc_t def_chunk_info; /* Default chunk cache property */
+ H5D_vds_view_t def_vds_view; /* Default virtual view property */
+ hsize_t def_vds_gap; /* Default virtual printf gap property */
hid_t new_dapl_id = FAIL;
hid_t ret_value = FAIL;
@@ -3545,23 +3547,23 @@ H5D_get_access_plist(const H5D_t *dset)
}
else {
/* Get the default FAPL */
- if (NULL == (def_fapl = (H5P_genplist_t *)H5I_object(H5P_LST_FILE_ACCESS_ID_g)))
+ if (NULL == (def_dapl = (H5P_genplist_t *)H5I_object(H5P_LST_DATASET_ACCESS_ID_g)))
HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "not a property list")
/* Set the data cache number of slots to the value of the default FAPL */
- if (H5P_get(def_fapl, H5D_ACS_DATA_CACHE_NUM_SLOTS_NAME, &def_chunk_info.nslots) < 0)
+ if (H5P_get(def_dapl, H5D_ACS_DATA_CACHE_NUM_SLOTS_NAME, &def_chunk_info.nslots) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get data number of slots");
if (H5P_set(new_plist, H5D_ACS_DATA_CACHE_NUM_SLOTS_NAME, &def_chunk_info.nslots) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set data cache number of slots")
/* Set the data cache byte size to the value of the default FAPL */
- if (H5P_get(def_fapl, H5D_ACS_DATA_CACHE_BYTE_SIZE_NAME, &def_chunk_info.nbytes_max) < 0)
+ if (H5P_get(def_dapl, H5D_ACS_DATA_CACHE_BYTE_SIZE_NAME, &def_chunk_info.nbytes_max) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get data cache byte size");
if (H5P_set(new_plist, H5D_ACS_DATA_CACHE_BYTE_SIZE_NAME, &def_chunk_info.nbytes_max) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set data cache byte size")
/* Set the preempt read chunks property to the value of the default FAPL */
- if (H5P_get(def_fapl, H5D_ACS_PREEMPT_READ_CHUNKS_NAME, &def_chunk_info.w0) < 0)
+ if (H5P_get(def_dapl, H5D_ACS_PREEMPT_READ_CHUNKS_NAME, &def_chunk_info.w0) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get preempt read chunks");
if (H5P_set(new_plist, H5D_ACS_PREEMPT_READ_CHUNKS_NAME, &def_chunk_info.w0) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set preempt read chunks")
@@ -3571,12 +3573,32 @@ H5D_get_access_plist(const H5D_t *dset)
HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set append flush property")
} /* end if-else */
- /* Set the VDS view & printf gap options */
- if (H5P_set(new_plist, H5D_ACS_VDS_VIEW_NAME, &(dset->shared->layout.storage.u.virt.view)) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set VDS view")
- if (H5P_set(new_plist, H5D_ACS_VDS_PRINTF_GAP_NAME, &(dset->shared->layout.storage.u.virt.printf_gap)) <
- 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set VDS printf gap")
+ /* If the dataset is virtual then copy the VDS view & printf gap options.
+ * Otherwise, use the default values. */
+ if (dset->shared->layout.type == H5D_VIRTUAL) {
+ if (H5P_set(new_plist, H5D_ACS_VDS_VIEW_NAME, &(dset->shared->layout.storage.u.virt.view)) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set VDS view")
+ if (H5P_set(new_plist, H5D_ACS_VDS_PRINTF_GAP_NAME,
+ &(dset->shared->layout.storage.u.virt.printf_gap)) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set VDS printf gap")
+ }
+ else {
+ /* Get the default FAPL if necessary */
+ if (!def_dapl && NULL == (def_dapl = (H5P_genplist_t *)H5I_object(H5P_LST_DATASET_ACCESS_ID_g)))
+ HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "not a property list")
+
+ /* Set the data cache number of slots to the value of the default FAPL */
+ if (H5P_get(def_dapl, H5D_ACS_VDS_VIEW_NAME, &def_vds_view) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get VDS view");
+ if (H5P_set(new_plist, H5D_ACS_VDS_VIEW_NAME, &def_vds_view) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set VDS view")
+
+ /* Set the data cache byte size to the value of the default FAPL */
+ if (H5P_get(def_dapl, H5D_ACS_VDS_PRINTF_GAP_NAME, &def_vds_gap) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get VDS printf gap");
+ if (H5P_set(new_plist, H5D_ACS_VDS_PRINTF_GAP_NAME, &def_vds_gap) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set VDS printf gap")
+ }
/* Set the vds prefix option */
if (H5P_set(new_plist, H5D_ACS_VDS_PREFIX_NAME, &(dset->shared->vds_prefix)) < 0)