Skip to content

Instantly share code, notes, and snippets.

@mlamina
Last active August 29, 2015 14:11
Show Gist options
  • Save mlamina/780065d5c787880e229c to your computer and use it in GitHub Desktop.
Save mlamina/780065d5c787880e229c to your computer and use it in GitHub Desktop.
Script for running the NUMA-aware RW lock benchmarks
1. Download benchmark code: https://github.com/azu-labs/rw-numa-locks/
2. Build the benchmark executables with "make"
3. Copy run.sh into the folder with the executables
4. (optional) Adjust the parameters in the script
5. ./run.sh
#!/bin/sh
NEUTRAL=0
READER=1
WRITER=2
READER_OPT=3
BENCHMARK="rw_tkt_tkt" # Name of the benchmark executable
THREADS=32 # Number of threads to be used
PREFERENCE=$NEUTRAL # Preference
WCSLEN=100 # time to be elapsed in the critical section when in read-write mode
RCSLEN=100 # time to be elapsed in the critical section when in read-only mode
NCSLEN=100 # time to be elapsed in the non-critical section
PROBABILITY=10 # probability to enter the CS in read-write mode
RUNTIME=10000 # Runtime in ms
echo -e "\nExecuting Benchmark: $BENCHMARK"
echo -e "Threads:\t $THREADS"
echo -e "Runtime:\t $RUNTIME milliseconds"
echo -e "Probability:\t $PROBABILITY %"
RESULT=$("./$BENCHMARK" $WCSLEN $RCSLEN $NCSLEN $PROBABILITY $THREADS $PREFERENCE $RUNTIME)
echo -e "\nThroughput: $RESULT\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment