diff options
author | songyulu <songyulu@jelly.ad.hdfgroup.org> | 2021-02-12 17:26:39 (GMT) |
---|---|---|
committer | songyulu <songyulu@jelly.ad.hdfgroup.org> | 2021-02-12 17:26:39 (GMT) |
commit | ddd24e265171c20b35e7dd42942f84f27a7116e2 (patch) | |
tree | 1ec4e44c00cf38269341c3df31d3ffe0d0d413f2 /test | |
parent | 85ae0a268729265ab365371cbcb20b1b250791f3 (diff) | |
download | hdf5-ddd24e265171c20b35e7dd42942f84f27a7116e2.zip hdf5-ddd24e265171c20b35e7dd42942f84f27a7116e2.tar.gz hdf5-ddd24e265171c20b35e7dd42942f84f27a7116e2.tar.bz2 |
Adding the test case for fixed-array chunked dataset and VDS.
Diffstat (limited to 'test')
-rw-r--r-- | test/testvfdswmr.sh.in | 4 | ||||
-rw-r--r-- | test/vfd_swmr_bigset_writer.c | 28 |
2 files changed, 26 insertions, 6 deletions
diff --git a/test/testvfdswmr.sh.in b/test/testvfdswmr.sh.in index f50051e..a66ddf4 100644 --- a/test/testvfdswmr.sh.in +++ b/test/testvfdswmr.sh.in @@ -624,7 +624,7 @@ if [ ${do_groups:-no} = yes ]; then rm -f vfd_swmr_group_reader.*.{out,rc} fi -for options in "-d 1" "-d 2" "-d 1 -V" "-d 1 -M"; do +for options in "-d 1" "-d 1 -F" "-d 2" "-d 2 -F" "-d 1 -V" "-d 1 -M" "-d 1 -V -F" "-d 1 -M -F"; do if [ ${do_many_small:-no} = no ]; then continue fi @@ -673,7 +673,7 @@ for options in "-d 1" "-d 2" "-d 1 -V" "-d 1 -M"; do rm -f vfd_swmr_bigset_reader.*.{out,rc} done -for options in "-d 1" "-d 2" "-d 1 -V" "-d 1 -M"; do +for options in "-d 1" "-d 1 -F" "-d 2" "-d 2 -F" "-d 1 -V" "-d 1 -M" "-d 1 -V -F" "-d 1 -M -F"; do # # Test a few big datasets of one and two dimensions. # diff --git a/test/vfd_swmr_bigset_writer.c b/test/vfd_swmr_bigset_writer.c index d99d8e3..58c3a38 100644 --- a/test/vfd_swmr_bigset_writer.c +++ b/test/vfd_swmr_bigset_writer.c @@ -133,6 +133,7 @@ typedef struct { enum {vds_off, vds_single, vds_multi} vds; bool use_vfd_swmr; bool writer; + bool fixed_array; hsize_t chunk_dims[RANK]; hsize_t one_dee_max_dims[RANK]; } state_t; @@ -159,6 +160,7 @@ state_initializer(void) , .vds = vds_off , .use_vfd_swmr = true , .writer = true + , .fixed_array = false , .one_dee_max_dims = {ROWS, H5S_UNLIMITED} , .chunk_dims = {ROWS, COLS} , .update_interval = (struct timespec){ @@ -170,7 +172,7 @@ static void state_init(state_t *, int, char **); static const hid_t badhid = H5I_INVALID_HID; -static const hsize_t two_dee_max_dims[RANK] = {H5S_UNLIMITED, H5S_UNLIMITED}; +static hsize_t two_dee_max_dims[RANK]; static uint32_t matget(const mat_t *mat, unsigned i, unsigned j) @@ -271,8 +273,11 @@ state_init(state_t *s, int argc, char **argv) esnprintf(tfile, sizeof(tfile), "%s", argv[0]); esnprintf(s->progname, sizeof(s->progname), "%s", basename(tfile)); - while ((ch = getopt(argc, argv, "MSVWa:bc:d:n:qr:s:u:")) != -1) { + while ((ch = getopt(argc, argv, "FMSVWa:bc:d:n:qr:s:u:")) != -1) { switch (ch) { + case 'F': + s->fixed_array = true; + break; case 'M': s->vds = vds_multi; break; @@ -370,11 +375,26 @@ state_init(state_t *s, int argc, char **argv) s->chunk_dims[0] = s->rows; s->chunk_dims[1] = s->cols; s->one_dee_max_dims[0] = s->rows; - s->one_dee_max_dims[1] = H5S_UNLIMITED; + if(s->fixed_array) { + s->one_dee_max_dims[1] = s->cols * s->nsteps; + two_dee_max_dims[0] = s->rows * s->nsteps; + two_dee_max_dims[1] = s->cols * s->nsteps; + } else { + s->one_dee_max_dims[1] = H5S_UNLIMITED; + two_dee_max_dims[0] = two_dee_max_dims[1] = H5S_UNLIMITED; + } if (s->vds != vds_off) { const hsize_t half_chunk_dims[RANK] = {s->rows / 2, s->cols / 2}; - const hsize_t half_max_dims[RANK] = {s->rows / 2, H5S_UNLIMITED}; + hsize_t half_max_dims[RANK]; + + if(s->fixed_array) { + half_max_dims[0] = s->rows / 2; + half_max_dims[1] = (s->cols * s->nsteps) / 2; + } else { + half_max_dims[0] = s->rows / 2; + half_max_dims[1] = H5S_UNLIMITED; + } if ((s->quadrant_dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) { errx(EXIT_FAILURE, "%s.%d: H5Pcreate failed", |