spsc-bugfix: duplicate the (buggy) spsc-queue
[model-checker-benchmarks.git] / bench.sh
index 8337ab3ff0dfb76057f1d4e9cc15da61f1563f14..3ccec5479e9e57f4d51c8b75de7fcdffe05e3282 100755 (executable)
--- a/bench.sh
+++ b/bench.sh
@@ -1,17 +1,30 @@
 #!/bin/bash
 
 # A (work-in-progress) test script for running our benchmarks
-# Runs all tests, logging output to a directory named 'run-<date-time>'
+# Runs all tests, logging output to a directory named
+# '${BASEDIR}/run-<date-time>', 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 linuxrwlocks/linuxrwlocks"
-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+=" 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 {