Skip to content

Commit

Permalink
Merge pull request #7 from HDFGroup/feature/vfd_swmr
Browse files Browse the repository at this point in the history
Feature/vfd swmr
  • Loading branch information
vchoi-hdfgroup authored Apr 28, 2021
2 parents 62198a3 + 41ab0ce commit 49600e5
Show file tree
Hide file tree
Showing 3 changed files with 2,078 additions and 1 deletion.
4 changes: 4 additions & 0 deletions test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ check_PROGRAMS=$(TEST_PROG) error_test err_compat tcheck_version \
vfd_swmr_group_reader vfd_swmr_group_writer \
vfd_swmr_vlstr_reader vfd_swmr_vlstr_writer \
vfd_swmr_zoo_reader vfd_swmr_zoo_writer \
vfd_swmr_attrdset_reader vfd_swmr_attrdset_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 @@ -173,6 +174,9 @@ vfd_swmr_zoo_reader_SOURCES=vfd_swmr_zoo_writer.c genall5.c
vfd_swmr_bigset_reader_SOURCES=vfd_swmr_bigset_writer.c
vfd_swmr_group_reader_SOURCES=vfd_swmr_group_writer.c

vfd_swmr_attrdset_writer_SOURCES=vfd_swmr_attrdset_writer.c
vfd_swmr_attrdset_reader_SOURCES=vfd_swmr_attrdset_writer.c

VFD_LIST = sec2 stdio core core_paged split multi family
if DIRECT_VFD_CONDITIONAL
VFD_LIST += direct
Expand Down
58 changes: 57 additions & 1 deletion test/testvfdswmr.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ WRITER_MESSAGE=VFD_SWMR_WRITER_MESSAGE # The message file created by writer tha
# This should be the same as the define in "./swmr_common.h"
MESSAGE_TIMEOUT=300 # Message timeout length in secs
# This should be the same as the define in "./h5test.h"

###############################################################################
## For attrdset test: definitions for fifo files to coordinate test runs
###############################################################################
FIFO_WRITER_TO_READER=fifo_attrdset_writer_to_reader
FIFO_READER_TO_WRITER=fifo_attrdset_reader_to_writer

###############################################################################
## short hands and function definitions
Expand Down Expand Up @@ -146,7 +152,7 @@ if [ $rc -ne 0 ] ; then
exit 0
fi

all_tests="generator expand shrink expand_shrink sparse vlstr_null vlstr_oob zoo groups"
all_tests="generator expand shrink expand_shrink sparse vlstr_null vlstr_oob zoo groups attrdset"
all_tests="${all_tests} few_big many_small"
tests=${all_tests}

Expand Down Expand Up @@ -191,6 +197,7 @@ mkdir vfd_swmr_test

cd vfd_swmr_test


# Loop over index types
for index_type in "-i ea" "-i b2"
do
Expand Down Expand Up @@ -611,6 +618,55 @@ if [ ${do_zoo:-no} = yes ]; then
rm -f vfd_swmr_zoo_reader.*.{out,rc}
fi

# attrdset test
for options in "-p -g -a 10 -v -m -d 10 -c 3 -u 5" "-k -a 20 -v -m -d 5"; do
#
# Test a few big datasets of one and two dimensions.
#
if [ ${do_attrdset:-no} = no ]; then
continue
fi
# Clean up any existing fifo files from previous runs
if [ -e ./$FIFO_WRITER_TO_READER ]; then # If writer fifo file is found
rm -f ./$FIFO_WRITER_TO_READER
fi
if [ -e ./$FIFO_READER_TO_WRITER ]; then # If reader fifo file is found
rm -f ./$FIFO_READER_TO_WRITER
fi
#
echo launch vfd_swmr_attrdset_writer attrdset, options $options
catch_out_err_and_rc vfd_swmr_attrdset_writer \
../vfd_swmr_attrdset_writer $options &
pid_writer=$!

catch_out_err_and_rc vfd_swmr_attrdset_reader \
../vfd_swmr_attrdset_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_attrdset_reader.rc) -ne 0 ]; then
echo reader had error
nerrors=$((nerrors + 1))
fi

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

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

#
# Make sure that we can create GROUP_n groups (40, 100, or 400 depending on the HDF5TestExpress level)
# while a reader waits for each to appear.
Expand Down
Loading

0 comments on commit 49600e5

Please sign in to comment.