Skip to content

Commit

Permalink
Individually track the steps verified on each dataset. Take care
Browse files Browse the repository at this point in the history
not to skip a step.
  • Loading branch information
gnuoyd committed Sep 3, 2020
1 parent 6864377 commit 9bb7431
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions test/vfd_swmr_bigset_writer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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++)
Expand Down

0 comments on commit 9bb7431

Please sign in to comment.