diff options
author | David Young <dyoung@hdfgroup.org> | 2020-05-28 20:49:12 (GMT) |
---|---|---|
committer | David Young <dyoung@hdfgroup.org> | 2020-05-28 20:49:12 (GMT) |
commit | 7bfba8aa398a485810be6647214c30cfb20a9796 (patch) | |
tree | 75fae7de67236831243223ef11329af6ef8c70ae | |
parent | a9ad1568108b000734c4b06900b1b10e9921b36b (diff) | |
parent | 7ecf5d54665edba3a9fb052eb50b3b2e90e3c685 (diff) | |
download | hdf5-7bfba8aa398a485810be6647214c30cfb20a9796.zip hdf5-7bfba8aa398a485810be6647214c30cfb20a9796.tar.gz hdf5-7bfba8aa398a485810be6647214c30cfb20a9796.tar.bz2 |
Merge branch 'feature/vfd_swmr' into may-merge-mainzer-to-mine
-rw-r--r-- | test/testvfdswmr.sh.in | 197 | ||||
-rw-r--r-- | test/vfd_swmr_group_writer.c | 3 |
2 files changed, 144 insertions, 56 deletions
diff --git a/test/testvfdswmr.sh.in b/test/testvfdswmr.sh.in index 10fe3f2..48f29f4 100644 --- a/test/testvfdswmr.sh.in +++ b/test/testvfdswmr.sh.in @@ -118,7 +118,8 @@ if [ $rc -ne 0 ] ; then exit 0 fi -all_tests="generator expand shrink expand_shrink sparse vlstr_null vlstr_oob zoo" +all_tests="generator expand shrink expand_shrink sparse vlstr_null vlstr_oob zoo groups" +#all_tests="${all_tests} few_big many_small" tests=${all_tests} if [ $# -gt 0 ]; then @@ -190,13 +191,6 @@ do echo generator had error nerrors=`expr $nerrors + 1` fi - - # Check for error and exit if one occured - $DPRINT nerrors=$nerrors - if test $nerrors -ne 0 ; then - echo "VFD SWMR tests failed with $nerrors errors." - exit 1 - fi fi if [ ${do_expand:-no} = yes ]; then @@ -266,14 +260,6 @@ do nerrors=$((nerrors + 1)) fi - # Check for error and exit if one occured - $DPRINT nerrors=$nerrors - if test $nerrors -ne 0 ; then - echo "VFD SWMR tests failed with $nerrors errors." - echo "(Writer and reader output preserved)" - exit 1 - fi - # Clean up output files rm -f vfd_swmr_writer.{out,rc} rm -f vfd_swmr_reader.*.{out,rc} @@ -341,14 +327,6 @@ do nerrors=$((nerrors + 1)) fi - # Check for error and exit if one occured - $DPRINT nerrors=$nerrors - if test $nerrors -ne 0 ; then - echo "VFD SWMR tests failed with $nerrors errors." - echo "(Writer and reader output preserved)" - exit 1 - fi - # Clean up output files rm -f vfd_swmr_writer.{out,rc} rm -f vfd_swmr_reader.*.{out,rc} @@ -431,14 +409,6 @@ do nerrors=$((nerrors + 1)) fi - # Check for error and exit if one occured - $DPRINT nerrors=$nerrors - if test $nerrors -ne 0 ; then - echo "VFD SWMR tests failed with $nerrors errors." - echo "(Writer and reader output preserved)" - exit 1 - fi - # Clean up output files rm -f vfd_swmr_writer.{out,rc} rm -f vfd_swmr_reader.*.{out,rc} @@ -514,14 +484,6 @@ do nerrors=$((nerrors + 1)) fi - # Check for error and exit if one occured - $DPRINT nerrors=$nerrors - if test $nerrors -ne 0 ; then - echo "VFD SWMR tests failed with $nerrors errors." - echo "(Writer and reader output preserved)" - exit 1 - fi - # Clean up output files rm -f vfd_swmr_writer.{out,rc} rm -f vfd_swmr_reader.*.{out,rc} @@ -575,13 +537,6 @@ for ty in null oob; do nerrors=$((nerrors + 1)) fi - # Check for error and exit if one occured - if test $nerrors -ne 0 ; then - echo "VFD SWMR tests failed with $nerrors errors." - echo "(Writer and reader output preserved)" - exit 1 - fi - # Clean up output files rm -f vfd_swmr_vlstr_writer.{out,rc} rm -f vfd_swmr_vlstr_reader.*.{out,rc} @@ -615,7 +570,7 @@ if [ ${do_zoo:-no} = yes ]; then # Collect exit code of the reader if [ $(cat vfd_swmr_zoo_reader.rc) -ne 0 ]; then echo reader had error - nsofterrors=$((nsofterrors + 1)) + nerrors=$((nerrors + 1)) fi # Collect exit code of the writer @@ -624,19 +579,148 @@ if [ ${do_zoo:-no} = yes ]; then nerrors=$((nerrors + 1)) fi - # Check for error and exit if one occured - if test $nerrors -ne 0 ; then - echo "VFD SWMR tests failed with $nerrors errors." - echo "(Writer and reader output preserved)" - exit 1 - fi - # Clean up output files rm -f ./fifo rm -f vfd_swmr_zoo_writer.{out,rc} rm -f vfd_swmr_zoo_reader.*.{out,rc} fi +# +# Make sure that we can create 10000 groups while a reader waits +# for each to appear. +# +if [ ${do_groups:-no} = yes ]; then + echo launch vfd_swmr_group_writer + catch_out_err_and_rc vfd_swmr_group_writer \ + ../vfd_swmr_group_writer -q -u 10 -n 10000 & + pid_writer=$! + + catch_out_err_and_rc vfd_swmr_group_reader \ + ../vfd_swmr_group_reader -q -u 10 -n 10000 -W & + pid_reader=$! + + # Wait for the reader to finish before signalling the + # writer to quit: the writer holds the file open so that the + # reader will find the shadow file when it opens + # the .h5 file. + wait $pid_reader + kill -USR1 $(cat vfd_swmr_group_writer.pid) + wait $pid_writer + + # Collect exit code of the reader + if [ $(cat vfd_swmr_group_reader.rc) -ne 0 ]; then + echo reader had error + nerrors=$((nerrors + 1)) + fi + + # Collect exit code of the writer + if [ $(cat vfd_swmr_group_writer.rc) -ne 0 ]; then + echo writer had error + nerrors=$((nerrors + 1)) + fi + + # Clean up output files + rm -f vfd_swmr_group_writer.{out,rc} + rm -f vfd_swmr_group_reader.*.{out,rc} +fi + +# +# Test many small datasets of one and two dimensions. +# +# Perform 50 iterations on 1000 extensible datasets configured with 16x16 +# chunks of 32-bit unsigned integer elements, +# expanding each dataset by a chunk in one dimension (up to 50x1 16x16 chunks) +# on each iteration. +# +# Perform the test again, extending each dataset +# in *two* dimensions (up to 50x50 16x16 chunks). +# +for dims in 1 2; do + if [ ${do_many_small:-no} = no ]; then + continue + fi + echo launch vfd_swmr_bigset_writer many small, $dims dimensions + catch_out_err_and_rc vfd_swmr_bigset_writer \ + ../vfd_swmr_bigset_writer -n 50 -d $dims -s 1000 -r 16 -c 16 -q & + pid_writer=$! + + catch_out_err_and_rc vfd_swmr_bigset_reader \ + ../vfd_swmr_bigset_reader -n 50 -d $dims -s 1000 -r 16 -c 16 -q -W & + pid_reader=$! + + # Wait for the reader to finish before signalling the + # writer to quit: the writer holds the file open so that the + # reader will find the shadow file when it opens + # the .h5 file. + wait $pid_reader + kill -USR1 $(cat vfd_swmr_bigset_writer.pid) + wait $pid_writer + + # Collect exit code of the reader + if [ $(cat vfd_swmr_bigset_reader.rc) -ne 0 ]; then + echo reader had error + nerrors=$((nerrors + 1)) + fi + + # Collect exit code of the writer + if [ $(cat vfd_swmr_bigset_writer.rc) -ne 0 ]; then + echo writer had error + nerrors=$((nerrors + 1)) + fi + + # Clean up output files + rm -f vfd_swmr_bigset_writer.{out,rc} + rm -f vfd_swmr_bigset_reader.*.{out,rc} +done + +# +# Test a few big datasets of one and two dimensions. +# +# Perform 50 iterations on 5 extensible datasets configured with 256x256 +# chunks of 32-bit unsigned integer elements, +# expanding each dataset by a chunk in one dimension (up to 50x1 256x256 chunks) +# on each iteration. +# +# Perform the test again, extending each dataset +# in *two* dimensions (up to 50x50 256x256 chunks). +# +for dims in 1 2; do + if [ ${do_few_big:-no} = no ]; then + continue + fi + echo launch vfd_swmr_bigset_writer few big, $dims dimensions + catch_out_err_and_rc vfd_swmr_bigset_writer \ + ../vfd_swmr_bigset_writer -n 50 -d $dims -s 5 -r 256 -c 256 -q & + pid_writer=$! + + catch_out_err_and_rc vfd_swmr_bigset_reader \ + ../vfd_swmr_bigset_reader -n 50 -d $dims -s 5 -r 256 -c 256 -q -W & + pid_reader=$! + + # Wait for the reader to finish before signalling the + # writer to quit: the writer holds the file open so that the + # reader will find the shadow file when it opens + # the .h5 file. + wait $pid_reader + kill -USR1 $(cat vfd_swmr_bigset_writer.pid) + wait $pid_writer + + # Collect exit code of the reader + if [ $(cat vfd_swmr_bigset_reader.rc) -ne 0 ]; then + echo reader had error + nerrors=$((nerrors + 1)) + fi + + # Collect exit code of the writer + if [ $(cat vfd_swmr_bigset_writer.rc) -ne 0 ]; then + echo writer had error + nerrors=$((nerrors + 1)) + fi + + # Clean up output files + rm -f vfd_swmr_bigset_writer.{out,rc} + rm -f vfd_swmr_bigset_reader.*.{out,rc} +done ############################################################################### ## Report and exit @@ -655,7 +739,8 @@ if test $nerrors -eq 0 ; then fi exit 0 else - echo "VFD SWMR tests failed with $nerrors errors." + echo -n "VFD SWMR tests failed with $nerrors hard errors " + echo "and $nsofterrors soft errors." exit 1 fi diff --git a/test/vfd_swmr_group_writer.c b/test/vfd_swmr_group_writer.c index ae70cf1..9e36876 100644 --- a/test/vfd_swmr_group_writer.c +++ b/test/vfd_swmr_group_writer.c @@ -167,12 +167,15 @@ verify_group(state_t *s, unsigned int which) { char name[sizeof("/group-9999999999")]; hid_t g; + estack_state_t es; assert(which < s->nsteps); esnprintf(name, sizeof(name), "/group-%d", which); + es = disable_estack(); g = H5Gopen(s->file, name, H5P_DEFAULT); + restore_estack(es); if (g < 0) return false; |