diff options
Diffstat (limited to 'test/vfd_swmr_bigset_writer.c')
-rw-r--r-- | test/vfd_swmr_bigset_writer.c | 32 |
1 files changed, 28 insertions, 4 deletions
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)) { |