3 # A (work-in-progress) test script for running our benchmarks
4 # Runs all tests, logging output to a directory named 'run-<date-time>'
6 ## Unfinished benchmarks - do not use
9 DATECMD="date +%Y-%m-%d-%R"
13 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"
14 MODEL_ARGS="-f 4 -m 2"
22 LOG=${DIR}/log-${COUNT}
24 echo "-----------------------------------------------"
25 echo "*******************************"
26 echo "Running test ${COUNT} (${t}): logging to ${LOG}"
28 echo "*******************************"
29 time ${RUN} ${t} ${ARGS} > ${LOG} 2>&1
31 grep -A 2 "Number of executions" ${LOG} | tail -3
33 echo "Test done; sleeping for a few seconds"
37 echo "*******************************"
38 echo "Re-running test for timing data"
39 echo "*******************************"
40 (time ${RUN} ${t} ${ARGS} > /dev/null 2>&1) 2>&1
42 echo "Test done; sleeping for a few seconds"
48 function run_all_tests {
53 run_test ${t} ${MODEL_ARGS}
55 #run_test mpmc-queue/mpmc-queue ${MODEL_ARGS} -- -r 2 -w 1
56 #run_test mpmc-queue/mpmc-queue ${MODEL_ARGS} -- -r 1 -w 2
57 #run_test mpmc-queue/mpmc-queue ${MODEL_ARGS} -- -r 2 -w 2
61 (git log --oneline -1; echo; run_all_tests) | tee ${DIR}/timing.log