Skip to content

Commit

Permalink
Merge pull request #759 from vchoi-hdfgroup/dsetchks_feature_vfd_swmr
Browse files Browse the repository at this point in the history
Dsetchks feature vfd swmr
  • Loading branch information
vchoi-hdfgroup authored Jun 30, 2021
2 parents 79c2a90 + 823b8a8 commit 18c08c5
Show file tree
Hide file tree
Showing 4 changed files with 2,353 additions and 3 deletions.
3 changes: 2 additions & 1 deletion MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -1412,11 +1412,12 @@
./test/vfd_swmr.c
./test/vfd_swmr_addrem_writer.c
./test/vfd_swmr_attrdset_writer.c
./test/vfd_swmr_dsetops_writer.c
./test/vfd_swmr_dsetchks_writer.c
./test/vfd_swmr_bigset_writer.c
./test/vfd_swmr_check_compat.c
./test/vfd_swmr_common.c
./test/vfd_swmr_common.h
./test/vfd_swmr_dsetops_writer.c
./test/vfd_swmr_generator.c
./test/vfd_swmr_group_writer.c
./test/vfd_swmr_reader.c
Expand Down
4 changes: 4 additions & 0 deletions test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ check_PROGRAMS=$(TEST_PROG) error_test err_compat tcheck_version \
vfd_swmr_zoo_reader vfd_swmr_zoo_writer \
vfd_swmr_attrdset_reader vfd_swmr_attrdset_writer \
vfd_swmr_check_compat \
vfd_swmr_dsetchks_reader vfd_swmr_dsetchks_writer \
swmr_check_compat_vfd vds_env vds_swmr_gen vds_swmr_reader vds_swmr_writer \
mirror_vfd
if HAVE_SHARED_CONDITIONAL
Expand Down Expand Up @@ -182,6 +183,9 @@ vfd_swmr_dsetops_reader_SOURCES=vfd_swmr_dsetops_writer.c
vfd_swmr_attrdset_writer_SOURCES=vfd_swmr_attrdset_writer.c
vfd_swmr_attrdset_reader_SOURCES=vfd_swmr_attrdset_writer.c

vfd_swmr_dsetchks_writer_SOURCES=vfd_swmr_dsetchks_writer.c
vfd_swmr_dsetchks_reader_SOURCES=vfd_swmr_dsetchks_writer.c

# Additional target for running timing test
timings _timings: testmeta
@for timing in $(TIMINGS) dummy; do \
Expand Down
75 changes: 73 additions & 2 deletions test/testvfdswmr.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ ATTRDSET_FIFO_READER_TO_WRITER=fifo_attrdset_reader_to_writer
DSETOPS_FIFO_WRITER_TO_READER=fifo_dsetops_writer_to_reader
DSETOPS_FIFO_READER_TO_WRITER=fifo_dsetops_reader_to_writer

###############################################################################
## For dsetchks test: definitions for fifo files to coordinate test runs
###############################################################################
#
DSETCHKS_FIFO_WRITER_TO_READER=fifo_dsetchks_writer_to_reader
DSETCHKS_FIFO_READER_TO_WRITER=fifo_dsetchks_reader_to_writer

###############################################################################
## short hands and function definitions
###############################################################################
Expand Down Expand Up @@ -138,9 +145,9 @@ all_tests="generator expand shrink expand_shrink sparse vlstr_null vlstr_oob zoo
all_tests="${all_tests} groups groups_attrs groups_ops few_big many_small attrdset"
tests=${all_tests}

# For exhaustive run, add: os_groups_attrs, os_groups_ops, dsetops
# For exhaustive run, add: os_groups_attrs, os_groups_ops, dsetops, dsetchks
if [[ "$HDF5TestExpress" -eq 0 ]] ; then # exhaustive run
all_tests="${all_tests} os_groups_attrs os_groups_ops dsetops"
all_tests="${all_tests} os_groups_attrs os_groups_ops dsetops dsetchks"
fi

if [ $# -gt 0 ]; then
Expand Down Expand Up @@ -1251,6 +1258,70 @@ for options in "-p -e 20 -t -q" "-g -m 5 -n 2 -s 10 -w 7 -q" "-k -m 10 -n 5 -r 5
rm -f vfd_swmr_dsetops_reader.*.{out,rc}
done

###############################################################################
#
# "dsetchks" test
#
# Only for exhaustive run
#
###############################################################################
#
#
dsetchks_list=(
"-s -m 8 -n 3 -g 1 -q"
"-i -o -g 3 -q"
"-f -p 4 -q"
"-e -m 3 -n 5 -t 1 -q"
"-r -m 11 -n 5 -l 7 -q"
"-f -x 5 -y 2 -q"
)
for options in "${dsetchks_list[@]}"; do
#
#
if [ ${do_dsetchks:-no} = no ]; then
continue
fi
# Clean up any existing fifo files from previous runs
if [ -e ./$DSETCHKS_FIFO_WRITER_TO_READER ]; then # If writer fifo file is found
rm -f ./$DSETCHKS_FIFO_WRITER_TO_READER
fi
if [ -e ./$DSETCHKS_FIFO_READER_TO_WRITER ]; then # If reader fifo file is found
rm -f ./$DSETCHKS_FIFO_READER_TO_WRITER
fi
#
echo launch vfd_swmr_dsetchks_writer dsetchks, options $options ......may take some time......
catch_out_err_and_rc vfd_swmr_dsetchks_writer \
../vfd_swmr_dsetchks_writer $options &
pid_writer=$!

catch_out_err_and_rc vfd_swmr_dsetchks_reader \
../vfd_swmr_dsetchks_reader $options &
pid_reader=$!

# Wait for the reader to finish before signaling 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
wait $pid_writer

# Collect exit code of the reader
if [ $(cat vfd_swmr_dsetchks_reader.rc) -ne 0 ]; then
echo reader had error
nerrors=$((nerrors + 1))
fi

# Collect exit code of the writer
if [ $(cat vfd_swmr_dsetchks_writer.rc) -ne 0 ]; then
echo writer had error
nerrors=$((nerrors + 1))
fi

# Clean up output files
rm -f vfd_swmr_dsetchks_writer.{out,rc}
rm -f vfd_swmr_dsetchks_reader.*.{out,rc}
done

###############################################################################
## Report and exit
###############################################################################
Expand Down
Loading

0 comments on commit 18c08c5

Please sign in to comment.