X-Git-Url: http://plrg.eecs.uci.edu/git/?p=model-checker-benchmarks.git;a=blobdiff_plain;f=bench.sh;h=c32924b8b68080a13ac39739d944a54e0571ac2d;hp=964cd28ee5c23e5d5ecda95dfcc15b1590c8e10b;hb=36c9d1f76e69a018f72a8aa85d70c58dd8f0d5cc;hpb=ac289415795f6d44f198bf5e11cbfc5e0d0e475d diff --git a/bench.sh b/bench.sh index 964cd28..c32924b 100755 --- a/bench.sh +++ b/bench.sh @@ -1,17 +1,32 @@ #!/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" -MODEL_ARGS="-f 4 -m 2" +[ $# -gt 0 ] && [ -d "$1" ] && BASEDIR="$1" && shift + +DIR="${BASEDIR}/run-${DATE}" + +TESTS="barrier/barrier" +TESTS+=" mcs-lock/mcs-lock" +TESTS+=" spsc-queue/spsc-queue" +TESTS+=" spsc-bugfix/spsc-queue" +TESTS+=" dekker-fences/dekker-fences" +TESTS+=" mpmc-queue/mpmc-2r1w" +TESTS+=" mpmc-queue/mpmc-1r2w-noinit" +TESTS+=" mpmc-queue/mpmc-queue-noinit" +TESTS+=" linuxrwlocks/linuxrwlocks" + +MODEL_ARGS="-f 10 -m 2 -e 1" COUNT=0 function run_test { @@ -26,18 +41,7 @@ function run_test { echo "Running test ${COUNT} (${t}): logging to ${LOG}" echo "ARGS=${ARGS}" echo "*******************************" - time ${RUN} ${t} ${ARGS} > ${LOG} 2>&1 - echo - grep -A 2 "Number of executions" ${LOG} | tail -3 - echo - echo "Test done; sleeping for a few seconds" - echo - sleep 3 - - echo "*******************************" - echo "Re-running test for timing data" - echo "*******************************" - time ${RUN} ${t} ${ARGS} > /dev/null 2>&1 + (time ${RUN} ${t} ${ARGS} 2>&1) 2>&1 | tee ${LOG} echo echo "Test done; sleeping for a few seconds" echo @@ -58,4 +62,4 @@ function run_all_tests { } mkdir ${DIR} -(git log --oneline -1; echo; run_all_tests) | tee ${DIR}/timing.log +(cd ..; git log --oneline -1; cd - > /dev/null; git log --oneline -1; echo; run_all_tests) | tee ${DIR}/timing.log