diff options
author | raylu-hdf <60487644+raylu-hdf@users.noreply.github.com> | 2021-11-03 16:59:34 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-03 16:59:34 (GMT) |
commit | a58fbf52f0202546b2a75227e62b48817280ff2f (patch) | |
tree | 8f9a1bfab01ede517230e87ef65b91139fa603e7 | |
parent | 4f0b40fade2419b1e61acc771f3aae68099c57ef (diff) | |
parent | e5c8d80a12721212f8c5ca75d5130f5a5cb7edfa (diff) | |
download | hdf5-a58fbf52f0202546b2a75227e62b48817280ff2f.zip hdf5-a58fbf52f0202546b2a75227e62b48817280ff2f.tar.gz hdf5-a58fbf52f0202546b2a75227e62b48817280ff2f.tar.bz2 |
Merge pull request #1156 from raylu-hdf/raylu_bigset_test2
Two Minor Changes for the Big Set Test
-rw-r--r-- | test/testvfdswmr.sh.in | 34 | ||||
-rw-r--r-- | test/vfd_swmr_bigset_writer.c | 32 |
2 files changed, 45 insertions, 21 deletions
diff --git a/test/testvfdswmr.sh.in b/test/testvfdswmr.sh.in index 4dc1e82..535aafa 100644 --- a/test/testvfdswmr.sh.in +++ b/test/testvfdswmr.sh.in @@ -1047,31 +1047,31 @@ fi # BIGSET_n=25 # -n option: # of iterations BIGSET_few_s=10 # -s option: # of datasets (for few_big test) -BIGSET_many_s=100 # -s option: # of datasets (for many_small test) +BIGSET_many_s=50 # -s option: # of datasets (for many_small test) # # # Setting for exhaustive and quick runs # if [[ "$HDF5TestExpress" -eq 0 ]] ; then # exhaustive run - BIGSET_n=200 - BIGSET_few_s=100 - BIGSET_many_s=1000 + BIGSET_n=100 + BIGSET_few_s=25 + BIGSET_many_s=100 elif [[ "$HDF5TestExpress" -gt 1 ]]; then # quick run BIGSET_n=10 BIGSET_few_s=3 - BIGSET_many_s=50 + BIGSET_many_s=25 fi # # -for options in "-d 1" "-d 1 -F" "-d 2" "-d 2 -F" "-d 1 -t" "-d 1 -t -F" "-d 1 -t -R" "-d 1 -V" "-d 1 -M" "-d 1 -V -F" "-d 1 -M -F"; do +for options in "-d 1" "-d 1 -F" "-d 2 -l 16" "-d 2 -F -l 16" "-d 1 -t" "-d 1 -t -F" "-d 1 -t -R" "-d 1 -V" "-d 1 -M" "-d 1 -V -F" "-d 1 -M -F"; do if [ ${do_many_small:-no} = no ]; then continue fi # - # Test many small datasets of one and two dimensions. + # Test many small datasets of two or three dimensions. # # Perform 25 iterations on 100 extensible datasets configured with - # 2D 16x16 chunks or 3D 8x16x16 chunks of 32-bit unsigned integer elements, + # 2D 16x16 chunks or 3D 1x16x16 chunks of 32-bit unsigned integer elements, # expanding each dataset by a chunk in one dimension (up to 25x1 # 16x16 chunks) on each iteration. # @@ -1079,16 +1079,16 @@ for options in "-d 1" "-d 1 -F" "-d 2" "-d 2 -F" "-d 1 -t" "-d 1 -t -F" "-d 1 -t # in *two* dimensions (up to 25x25 16x16 chunks). # # If testing 3D datasets (-t option), extending each dataset along the - # first dimension (up to 25 8x16x16) + # first dimension (up to 25 1x16x16) # echo launch vfd_swmr_bigset_writer many small, options $options catch_out_err_and_rc vfd_swmr_bigset_writer \ - ../vfd_swmr_bigset_writer -n $BIGSET_n $options -s $BIGSET_many_s -e 8 -r 16 -c 16 -q -l 3 & + ../vfd_swmr_bigset_writer -n $BIGSET_n $options -s $BIGSET_many_s -e 1 -r 16 -c 16 -q & pid_writer=$! catch_out_err_and_rc vfd_swmr_bigset_reader \ - ../vfd_swmr_bigset_reader -n $BIGSET_n $options -s $BIGSET_many_s -e 8 -r 16 -c 16 -q -l 3 & + ../vfd_swmr_bigset_reader -n $BIGSET_n $options -s $BIGSET_many_s -e 1 -r 16 -c 16 -q & pid_reader=$! # Wait for the reader to finish before signalling the @@ -1116,12 +1116,12 @@ for options in "-d 1" "-d 1 -F" "-d 2" "-d 2 -F" "-d 1 -t" "-d 1 -t -F" "-d 1 -t done # bigset test for bigger chunks -for options in "-d 1" "-d 1 -F" "-d 2" "-d 2 -F" "-d 1 -t" "-d 1 -t -F" "-d 1 -t -R" "-d 1 -V" "-d 1 -M" "-d 1 -V -F" "-d 1 -M -F"; do +for options in "-d 1" "-d 1 -F" "-d 2 -l 10" "-d 2 -F -l 10" "-d 1 -t -l 10" "-d 1 -t -F -l 10" "-d 1 -t -R" "-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. + # Test a few big datasets of two or three dimensions. # # Perform 25 iterations on 10 extensible datasets configured with - # 2D 256x256 chunks or 3D 64x256x256 of 32-bit unsigned integer elements, + # 2D 256x256 chunks or 3D 8x256x256 of 32-bit unsigned integer elements, # expanding each dataset by a chunk in one dimension (up to 25x1 # 256x256 chunks) on each iteration. # @@ -1129,7 +1129,7 @@ for options in "-d 1" "-d 1 -F" "-d 2" "-d 2 -F" "-d 1 -t" "-d 1 -t -F" "-d 1 -t # in *two* dimensions (up to 25x25 256x256 chunks). # # If testing 3D datasets (-t option), extending each dataset along the - # first dimension (up to 25 64x256x256) + # first dimension (up to 25 8x256x256) # if [ ${do_few_big:-no} = no ]; then @@ -1137,11 +1137,11 @@ for options in "-d 1" "-d 1 -F" "-d 2" "-d 2 -F" "-d 1 -t" "-d 1 -t -F" "-d 1 -t fi echo launch vfd_swmr_bigset_writer few big, options $options ......may take some time...... catch_out_err_and_rc vfd_swmr_bigset_writer \ - ../vfd_swmr_bigset_writer -n $BIGSET_n $options -s $BIGSET_few_s -e 64 -r 256 -c 256 -q -l 3 & + ../vfd_swmr_bigset_writer -n $BIGSET_n $options -s $BIGSET_few_s -e 8 -r 256 -c 256 -q & pid_writer=$! catch_out_err_and_rc vfd_swmr_bigset_reader \ - ../vfd_swmr_bigset_reader -n $BIGSET_n $options -s $BIGSET_few_s -e 64 -r 256 -c 256 -q -l 3 & + ../vfd_swmr_bigset_reader -n $BIGSET_n $options -s $BIGSET_few_s -e 8 -r 256 -c 256 -q & pid_reader=$! # Wait for the reader to finish before signalling the diff --git a/test/vfd_swmr_bigset_writer.c b/test/vfd_swmr_bigset_writer.c index 956973a..77c7b26 100644 --- a/test/vfd_swmr_bigset_writer.c +++ b/test/vfd_swmr_bigset_writer.c @@ -149,6 +149,7 @@ typedef struct { bool test_3d; enum { vds_off, vds_single, vds_multi } vds; bool use_vfd_swmr; + bool use_legacy_swmr; bool use_named_pipe; bool do_perf; bool cross_chunk_read; @@ -214,6 +215,7 @@ state_initializer(void) .test_3d = false, .vds = vds_off, .use_vfd_swmr = true, + .use_legacy_swmr = false, .use_named_pipe = true, .do_perf = false, .cross_chunk_read = false, @@ -256,6 +258,7 @@ usage(const char *progname) "-P: do the performance measurement\n" "-R: flush raw data\n" "-S: do not use VFD SWMR\n" + "-T: use legacy SWMR (-S and -N must also be specified)\n" "-V: use virtual datasets and a single\n" " source file\n" "-a steps: `steps` between adding attributes\n" @@ -339,7 +342,7 @@ state_init(state_t *s, int argc, char **argv) if (tfile) HDfree(tfile); - while ((ch = getopt(argc, argv, "CFMNPRSVa:bc:d:e:f:g:j:k:l:m:n:o:p:qr:s:tu:v:w:")) != -1) { + while ((ch = getopt(argc, argv, "CFMNPRSTVa:bc:d:e:f:g:j:k:l:m:n:o:p:qr:s:tu:v:w:")) != -1) { switch (ch) { case 'C': /* This flag indicates cross-over chunk read during data validation */ @@ -362,6 +365,9 @@ state_init(state_t *s, int argc, char **argv) case 'S': s->use_vfd_swmr = false; break; + case 'T': + s->use_legacy_swmr = true; + break; case 'V': s->vds = vds_single; break; @@ -745,6 +751,18 @@ state_init(state_t *s, int argc, char **argv) TEST_ERROR; } + if (s->use_legacy_swmr) { + if (s->use_vfd_swmr) { + HDfprintf(stderr, "Can't use both VFD SWMR and Legacy SWMR\n"); + TEST_ERROR; + } + + if (s->use_named_pipe) { + HDfprintf(stderr, "Can't use named pipe for the Legacy SWMR\n"); + TEST_ERROR; + } + } + return true; error: @@ -826,14 +844,14 @@ state_destroy(state_t *s) if (s->vds != vds_multi) { if (H5Fvfd_swmr_end_tick(s->file[0]) < 0) { - HDfprintf(stderr, "H5Fclose failed\n"); + HDfprintf(stderr, "H5Fvfd_swmr_end_tick failed\n"); TEST_ERROR; } } else { for (j = 0; j < NELMTS(s->file); j++) if (H5Fvfd_swmr_end_tick(s->file[j]) < 0) { - HDfprintf(stderr, "H5Fclose failed\n"); + HDfprintf(stderr, "H5Fvfd_swmr_end_tick failed\n"); TEST_ERROR; } } @@ -2081,7 +2099,7 @@ verify_dsets(state_t s, np_state_t *np, mat_t *mat) * the validation of the chunks */ if (s.use_named_pipe && below_speed_limit(&(last.time), &(s.ival))) { AT(); - HDfprintf(stderr, "verify_extensible_dset took too long to finish\n"); + HDfprintf(stderr, "Warning: verify_extensible_dset took too long to finish\n"); } /* For checking the time lapse between the writer's finishing writing a batch of chunks @@ -2544,6 +2562,12 @@ main(int argc, char **argv) TEST_ERROR; } + /* Enable the Legacy SWMR writing mode if specified */ + if (s.use_legacy_swmr && H5Fstart_swmr_write(s.file[0]) < 0) { + HDfprintf(stderr, "failed to start the Legacy SWMR writing mode\n"); + TEST_ERROR; + } + /* Start to write chunks. The writer writes as many chunks as possible within a tick, then * notify the reader. But it doesn't receive back the reader's notice. */ if (!write_dsets(s, &np, mat)) { |