summaryrefslogtreecommitdiffstats
path: root/tools/test/h5repack/h5repack.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'tools/test/h5repack/h5repack.sh.in')
-rw-r--r--tools/test/h5repack/h5repack.sh.in103
1 files changed, 103 insertions, 0 deletions
diff --git a/tools/test/h5repack/h5repack.sh.in b/tools/test/h5repack/h5repack.sh.in
index bc6b527..e474bc3 100644
--- a/tools/test/h5repack/h5repack.sh.in
+++ b/tools/test/h5repack/h5repack.sh.in
@@ -36,6 +36,9 @@ H5DIFF_BIN=`pwd`/$H5DIFF # The path of the h5diff tool binary
H5DUMP=../../src/h5dump/h5dump # The h5dump tool name
H5DUMP_BIN=`pwd`/$H5DUMP # The path of the h5dump tool binary
+H5STAT=../../src/h5stat/h5stat # The h5stat tool name
+H5STAT_BIN=`pwd`/$H5STAT # The path of the h5stat tool binary
+
RM='rm -rf'
CMP='cmp'
DIFF='diff -c'
@@ -101,6 +104,12 @@ $SRC_H5REPACK_TESTFILES/h5repack_refs.h5
$SRC_H5REPACK_TESTFILES/h5repack_shuffle.h5
$SRC_H5REPACK_TESTFILES/h5repack_soffset.h5
$SRC_H5REPACK_TESTFILES/h5repack_szip.h5
+$SRC_H5REPACK_TESTFILES/h5repack_aggr.h5
+$SRC_H5REPACK_TESTFILES/h5repack_fsm_aggr_nopersist.h5
+$SRC_H5REPACK_TESTFILES/h5repack_fsm_aggr_persist.h5
+$SRC_H5REPACK_TESTFILES/h5repack_none.h5
+$SRC_H5REPACK_TESTFILES/h5repack_paged_nopersist.h5
+$SRC_H5REPACK_TESTFILES/h5repack_paged_persist.h5
$SRC_H5DIFF_TESTFILES/h5diff_attr1.h5
$SRC_TOOLS_TESTFILES/tfamily00000.h5
$SRC_TOOLS_TESTFILES/tfamily00001.h5
@@ -156,6 +165,12 @@ $SRC_H5REPACK_TESTFILES/2_vds.h5-vds_chunk3x6x9-v.ddl
$SRC_H5REPACK_TESTFILES/3_1_vds.h5-vds_chunk2x5x8-v.ddl
$SRC_H5REPACK_TESTFILES/4_vds.h5-vds_compa-v.ddl
$SRC_H5REPACK_TESTFILES/4_vds.h5-vds_conti-v.ddl
+$SRC_H5REPACK_TESTFILES/SP.h5repack_fsm_aggr_nopersist.h5.ddl
+$SRC_H5REPACK_TESTFILES/S.h5repack_fsm_aggr_persist.h5.ddl
+$SRC_H5REPACK_TESTFILES/STG.h5repack_none.h5.ddl
+$SRC_H5REPACK_TESTFILES/GS.h5repack_paged_nopersist.h5.ddl
+$SRC_H5REPACK_TESTFILES/SP.h5repack_paged_persist.h5.ddl
+$SRC_H5REPACK_TESTFILES/SPT.h5repack_aggr.h5.ddl
"
#
@@ -707,6 +722,58 @@ TOOLTEST_DUMP()
rm -f $outfile
}
+# This is similar to TOOLTEST_DUMP().
+# Test h5repack with options added for paged aggregation.
+# h5stat is used on the repacked file and the expected output
+# is compared for correctness.
+#
+TOOLTEST_STAT()
+{
+ infile=$2
+ outfile=out-$1.$2
+ expect="$TESTDIR/$1.$2.ddl"
+ actual="$TESTDIR/out-$1.$2.out"
+ actual_err="$TESTDIR/out-$1.$2.err"
+
+ shift
+ shift
+
+ # Run test.
+ TESTING $H5REPACK $@
+ (
+ cd $TESTDIR
+ $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile
+ ) >$actual 2>$actual_err
+ RET=$?
+ if [ $RET != 0 ] ; then
+ echo "*FAILED*"
+ nerrors="`expr $nerrors + 1`"
+ else
+ echo " PASSED"
+ VERIFY h5stat output $@
+ (
+ cd $TESTDIR
+ $RUNSERIAL $H5STAT_BIN -S -s $outfile
+ ) >$actual 2>$actual_err
+ cat $actual_err >> $actual
+
+ RET=$?
+
+ fi
+
+ if cmp -s $expect $actual; then
+ echo " PASSED"
+ else
+ echo "*FAILED*"
+ echo " Expected result (*.ddl) differs from actual result (*.out)"
+ nerrors="`expr $nerrors + 1`"
+ test yes = "$verbose" && diff -c $expect $actual |sed 's/^/ /'
+ fi
+
+ rm -f $actual $actual_err
+ rm -f $outfile
+}
+
# TOOLTEST_META:
# Test metadata block size option.
# Reason to create a function here is to localize all special steps related to
@@ -1057,6 +1124,42 @@ fi
arg="tordergr.h5 -L"
TOOLTEST_DUMP crtorder $arg
+###################################################################################################
+# Testing paged aggregation related options:
+# -G pagesize
+# -P 1 or 0
+# -S strategy
+# -T threshold
+#
+# The testfiles used are generated by test/gen_filespace.c and the file names are prepended with "h5repack_":
+# (1) "fsm_aggr_nopersist.h5" /* H5F_FSPACE_STRATEGY_FSM_AGGR + not persisting free-space */
+# (2) "fsm_aggr_persist.h5" /* H5F_FSPACE_STRATEGY_FSM_AGGR + persisting free-space */
+# (3) "paged_nopersist.h5" /* H5F_FSPACE_STRATEGY_PAGE + not persisting free-space */
+# (4) "paged_persist.h5" /* H5F_FSPACE_STRATEGY_PAGE + persisting free-space */
+# (5) "aggr.h5" /* H5F_FSPACE_STRATEGY_AGGR */
+# (6) "none.h5" /* H5F_FSPACE_STRATEGY_NONE */
+#
+#####################################################################################################
+#
+arg="h5repack_fsm_aggr_nopersist.h5 -S PAGE -P 1"
+TOOLTEST_STAT SP $arg
+#
+arg="h5repack_fsm_aggr_persist.h5 -S AGGR"
+TOOLTEST_STAT S $arg
+#
+arg="h5repack_none.h5 -S PAGE -T 10 -G 2048"
+TOOLTEST_STAT STG $arg
+#
+arg="h5repack_paged_nopersist.h5 -G 512 -S AGGR"
+TOOLTEST_STAT GS $arg
+#
+arg="h5repack_paged_persist.h5 -S NONE -P 1"
+TOOLTEST_STAT SP $arg
+#
+arg="h5repack_aggr.h5 -S FSM_AGGR -P 1 -T 5"
+TOOLTEST_STAT SPT $arg
+
+
#########################################################
# layout options (these files have no filters)
#########################################################