From 9bb743136ed3a262eca6e6fcbe0f0d8f5b78cd09 Mon Sep 17 00:00:00 2001 From: David Young Date: Thu, 3 Sep 2020 14:44:56 -0500 Subject: Individually track the steps verified on each dataset. Take care not to skip a step. --- test/vfd_swmr_bigset_writer.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/test/vfd_swmr_bigset_writer.c b/test/vfd_swmr_bigset_writer.c index 0a7c79b..7105e21 100644 --- a/test/vfd_swmr_bigset_writer.c +++ b/test/vfd_swmr_bigset_writer.c @@ -1021,7 +1021,7 @@ verify_extensible_dset(state_t *s, unsigned int which, mat_t *mat, verify_dset_attribute(ds, which, step); } - *stepp = last_step; + *stepp = step; out: if (H5Sclose(filespace) < 0) @@ -1196,19 +1196,33 @@ main(int argc, char **argv) nanosleep(&s.update_interval, NULL); } } else { + unsigned *nextstep = calloc(s.ndatasets, sizeof(*nextstep)); + unsigned finished_step; + + if (nextstep == NULL) + err(EXIT_FAILURE, "could not allocate `nextstep` array"); + for (which = s.ndatasets; which > 0; which--) open_extensible_dset(&s, which - 1); - for (step = 0; hang_back + step < s.nsteps;) { + do { + finished_step = UINT_MAX; /* the greatest step finished on + * *all* datasets + */ + for (which = s.ndatasets; which-- > 0; ) { - dbgf(2, "step %d which %d\n", step, which); - verify_extensible_dset(&s, which, mat, &step); + dbgf(2, "step %d which %d\n", nextstep[which], which); + verify_extensible_dset(&s, which, mat, &nextstep[which]); + if (nextstep[which] < finished_step) + finished_step = nextstep[which]; if (s.ndatasets <= s.nsteps) nanosleep(&s.update_interval, NULL); } if (s.ndatasets > s.nsteps) nanosleep(&s.update_interval, NULL); - } + } while (hang_back + finished_step < s.nsteps); + + free(nextstep); } for (which = 0; which < s.ndatasets; which++) -- cgit v0.12