summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2009-07-23 22:55:13 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2009-07-23 22:55:13 (GMT)
commit239c45e0f5845406f931f612cf1e88a2203917ae (patch)
treeade1e7d3fbba832a197f70628b785adbae92e381 /test
parent0d41b14350829b8b48799ce494125eab0db96099 (diff)
downloadhdf5-239c45e0f5845406f931f612cf1e88a2203917ae.zip
hdf5-239c45e0f5845406f931f612cf1e88a2203917ae.tar.gz
hdf5-239c45e0f5845406f931f612cf1e88a2203917ae.tar.bz2
[svn-r17232] Code improvement:
Added control variable to control the debugging output. Changed default writer records to 200,000 since 1 million took a long time to run in Linew. 200,000 still take 1.5minutes to finish for linew to run. Verified the error detection does work by making swrm_writer to fail by setting the number of records to 10000.o Tested: Jam, amani and linew
Diffstat (limited to 'test')
-rwxr-xr-xtest/testswmr.sh27
1 files changed, 18 insertions, 9 deletions
diff --git a/test/testswmr.sh b/test/testswmr.sh
index ef8ad78..44c6eea 100755
--- a/test/testswmr.sh
+++ b/test/testswmr.sh
@@ -1,4 +1,4 @@
-#! /bin/sh -x
+#! /bin/sh
#
# Copyright by The HDF Group.
# Copyright by the Board of Trustees of the University of Illinois.
@@ -24,10 +24,18 @@
###############################################################################
Nreaders=5 # number of readers to launch
-Nrecords=1000000 # number of records to write
+Nrecords=200000 # number of records to write
Nsecs=5 # number of seconds per read interval
nerrors=0
+###############################################################################
+## short hands
+###############################################################################
+DPRINT=: # Set to "echo Debug:" for debugging printing,
+ # else ":" for noop.
+IFDEBUG=: # Set to null to turn on debugging, else ":" for noop.
+
+
# The build (current) directory might be different than the source directory.
if test -z "$srcdir"; then
srcdir=.
@@ -53,10 +61,12 @@ TESTING() {
echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012'
}
+echo launch the swmr_generator
./swmr_generator
echo launch the swmr_writer
./swmr_writer $Nrecords &
-pid_write=$!
+pid_writer=$!
+$DPRINT pid_writer=$pid_writer
# launch readers
n=0
@@ -66,13 +76,12 @@ while [ $n -lt $Nreaders ]; do
pid_readers="$pid_readers $!"
n=`expr $n + 1`
done
-echo pid_write=$pid_write
-echo pid_readers=$pid_readers
-ps
+$DPRINT pid_readers=$pid_readers
+$IFDEBUG ps
# collect exit code of the readers.
for xpid in $pid_readers; do
- echo checked reader $xpid
+ $DPRINT checked reader $xpid
wait $xpid
if test $? -ne 0; then
echo reader had error
@@ -80,7 +89,7 @@ for xpid in $pid_readers; do
fi
done
# collect exit code of the writer
-echo checked write $pid_writer
+$DPRINT checked writer $pid_writer
wait $pid_writer
if test $? -ne 0; then
echo writer had error
@@ -91,7 +100,7 @@ fi
# # END
# ##############################################################################
-echo nerrors=$nerrors
+$DPRINT nerrors=$nerrors
if test $nerrors -eq 0 ; then
echo "SWMR tests passed."
fi