X-Git-Url: http://plrg.eecs.uci.edu/git/?p=model-checker-benchmarks.git;a=blobdiff_plain;f=bench.sh;h=8886bccaf385f502c22a2d3ee904744d730a1000;hp=964cd28ee5c23e5d5ecda95dfcc15b1590c8e10b;hb=12f92a94d28b2a674f5ec2c0b112fa654734f19d;hpb=ac289415795f6d44f198bf5e11cbfc5e0d0e475d diff --git a/bench.sh b/bench.sh index 964cd28..8886bcc 100755 --- a/bench.sh +++ b/bench.sh @@ -1,16 +1,22 @@ #!/bin/bash # A (work-in-progress) test script for running our benchmarks -# Runs all tests, logging output to a directory named 'run-' +# Runs all tests, logging output to a directory named +# '${BASEDIR}/run-', where ${BASEDIR} is either the current +# directory or the first parameter to this script ## Unfinished benchmarks - do not use # queue williams-queue DATECMD="date +%Y-%m-%d-%R" DATE="`${DATECMD}`" -DIR="run-${DATE}" +BASEDIR=. -TESTS="barrier/barrier mcs-lock/mcs-lock spsc-queue/spsc-queue mpmc-queue/mpmc-1r2w mpmc-queue/mpmc-2r1w mpmc-queue/mpmc-queue" +[ $# -gt 0 ] && [ -d "$1" ] && BASEDIR="$1" && shift + +DIR="${BASEDIR}/run-${DATE}" + +TESTS="barrier/barrier mcs-lock/mcs-lock spsc-queue/spsc-queue mpmc-queue/mpmc-1r2w mpmc-queue/mpmc-2r1w mpmc-queue/mpmc-queue linuxrwlocks/linuxrwlocks" MODEL_ARGS="-f 4 -m 2" COUNT=0 @@ -37,7 +43,7 @@ function run_test { echo "*******************************" echo "Re-running test for timing data" echo "*******************************" - time ${RUN} ${t} ${ARGS} > /dev/null 2>&1 + (time ${RUN} ${t} ${ARGS} > /dev/null 2>&1) 2>&1 echo echo "Test done; sleeping for a few seconds" echo