summaryrefslogtreecommitdiffstats
path: root/test/vfd_swmr_bigset_writer.c
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2020-06-19 21:34:53 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2020-06-19 21:34:53 (GMT)
commitbd87af0408461fee290c559f45e251919f2c1263 (patch)
tree252640cf4dec0f0b6cf49f33acebaf60599312dd /test/vfd_swmr_bigset_writer.c
parentafd49812d5e317c9d4c3342c219b8453866fd5bf (diff)
downloadhdf5-bd87af0408461fee290c559f45e251919f2c1263.zip
hdf5-bd87af0408461fee290c559f45e251919f2c1263.tar.gz
hdf5-bd87af0408461fee290c559f45e251919f2c1263.tar.bz2
Create a dataset access property list (dapl) that disables the chunk cache and
apply it individually to each dataset instead of setting the chunk-cache parameters on the file. Alas, it didn't make any difference, but I'll keep the change.
Diffstat (limited to 'test/vfd_swmr_bigset_writer.c')
-rw-r--r--test/vfd_swmr_bigset_writer.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/test/vfd_swmr_bigset_writer.c b/test/vfd_swmr_bigset_writer.c
index c29767c..1c0526d 100644
--- a/test/vfd_swmr_bigset_writer.c
+++ b/test/vfd_swmr_bigset_writer.c
@@ -47,7 +47,7 @@ typedef struct _mat {
typedef struct {
hid_t *dataset;
- hid_t memspace, file, one_by_one_sid;
+ hid_t dapl, memspace, file, one_by_one_sid;
unsigned ndatasets;
char filename[PATH_MAX];
char progname[PATH_MAX];
@@ -64,6 +64,7 @@ typedef struct {
#define ALL_HID_INITIALIZER (state_t){ \
.memspace = H5I_INVALID_HID \
+ , .dapl = H5I_INVALID_HID \
, .file = H5I_INVALID_HID \
, .one_by_one_sid = H5I_INVALID_HID \
, .rows = ROWS \
@@ -296,7 +297,7 @@ create_extensible_dset(state_t *s, unsigned int which)
errx(EXIT_FAILURE, "H5Pset_chunk failed");
ds = H5Dcreate2(s->file, dname, H5T_STD_U32BE, filespace,
- H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ H5P_DEFAULT, dcpl, s->dapl);
if (H5Pclose(dcpl) < 0)
errx(EXIT_FAILURE, "H5Pclose(dcpl)");
@@ -343,7 +344,7 @@ open_extensible_dset(state_t *s, unsigned int which)
assert(s->dataset[which] == badhid);
- ds = H5Dopen(s->file, dname, H5P_DEFAULT);
+ ds = H5Dopen(s->file, dname, s->dapl);
if (ds < 0)
errx(EXIT_FAILURE, "H5Dopen(, \"%s\", ) failed", dname);
@@ -714,8 +715,12 @@ main(int argc, char **argv)
if (ret < 0)
errx(EXIT_FAILURE, "H5Pset_file_space_strategy");
- if (H5Pset_cache(fapl, 0, 1, 1024, 1.0) < 0)
- errx(EXIT_FAILURE, "H5Pset_cache");
+ if ((s.dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
+ errx(EXIT_FAILURE, "%s.%d: H5Pcreate failed", __func__, __LINE__);
+
+ if (H5Pset_chunk_cache(s.dapl, 0, 0,
+ H5D_CHUNK_CACHE_W0_DEFAULT) < 0)
+ errx(EXIT_FAILURE, "H5Pset_chunk_cache failed");
if (writer)
s.file = H5Fcreate(s.filename, H5F_ACC_TRUNC, fcpl, fapl);
@@ -765,6 +770,9 @@ main(int argc, char **argv)
restore_signals(&oldsigs);
+ if (H5Pclose(s.dapl) < 0)
+ errx(EXIT_FAILURE, "H5Pclose(fapl)");
+
if (H5Pclose(fapl) < 0)
errx(EXIT_FAILURE, "H5Pclose(fapl)");