Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Lockbench - A benchmarks suite for evaluating lock implementations

### Dependencies

Install these software before using Lockbench:

1. gnuplot
2. texlive-font-utils

### Build

Compile the suite by simply typing make and tests will be ready to run.
Expand All @@ -21,14 +28,19 @@ It will generate a configuration file in `script/machine_conf/`.
Now, you can run standard benchmarks by executing:

```sh
$ ./run_rand_batch_test.sh machine_conf/<your machine conf> tests_conf/<tests conf> thread_conf/<thread conf>
$ ./run_rand_batch_test.sh machine_conf/<your_machine.conf> tests_conf/<test_selected.conf> thread_conf/<threads_selected.conf>
```

### Plotting results

Obtaining plots resuming the benchmark results is quite straightforward, but it might require some minutes.
1. First aggregate results by executing the following command
`./generate_dat.sh machine_conf/<your machine conf> tests_conf/<tests conf>`
2. Obtain the plots
`./plot_results.sh machine_conf/<your machine conf> tests_conf/<tests conf>`

1. First aggregate results by executing the following command:
```sh
$ ./generate_dat.sh tests_conf/<test_selected.conf> machine_conf/<your_machine.conf> thread_conf/<threads_selected.conf>
```
2. Obtain the plots:
```sh
$ ./plot_results.sh tests_conf/<test_selected.conf> machine_conf/<your_machine.conf> thread_conf/<threads_selected.conf>
```
3. Find the charts in the `plots` directory
Empty file modified script/clone_modules.sh
100644 → 100755
Empty file.
20 changes: 10 additions & 10 deletions script/create_machine_conf.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ make clean
cd ..

val=`../bin/test-QUEUED_SPINLOCK_LOCK -s 1 -rnd_cs_lower 100000 -rnd_cs_higher 100000 -rnd_ncs_lower 0 -rnd_ncs_higher 0 -t 1 -seq | grep CS/sec`
val=`python -c "print '$val'.strip().split(' ')[-1]"`
val=`python -c "print ('$val'.strip().split(' ')[-1])"`
result=`echo 100000/$val | bc`
echo LAST LOOPER $result

Expand All @@ -34,20 +34,20 @@ cpucount=`lscpu | grep "CPU(s):"|head -n1`
vendor=`lscpu | grep "Vendor ID"`


cpu=`python -c "print '$cpu'.split(':')[1]"`
cpucount=`python -c "print '$cpucount'.split(':')[1].replace(' ', '')"`
vendor=`python -c "print '$vendor'.split(':')[1].replace(' ', '')"`
cpu=`python -c "print ('$cpu'.split(':')[1])"`
cpucount=`python -c "print ('$cpucount'.split(':')[1].replace(' ', ''))"`
vendor=`python -c "print ('$vendor'.split(':')[1].replace(' ', ''))"`
cpu_label=$cpu
cpu_label=`python -c "print '$cpu_label'.replace('Intel(R) ', '').replace('Xeon(R)', '').replace('Core(TM)', '').replace('CPU', '').replace(' ', '').split('@')[0]"`
cpu_label=`python -c "print '$cpu_label'.replace('(tm)', '').replace('AMD', '').replace('Processor', '-').replace(' ', '')"`
cpu_label=`python -c "print ('$cpu_label'.replace('Intel(R) ', '').replace('Xeon(R)', '').replace('Core(TM)', '').replace('CPU', '').replace(' ', '').split('@')[0])"`
cpu_label=`python -c "print ('$cpu_label'.replace('(tm)', '').replace('AMD', '').replace('Processor', '-').replace(' ', ''))"`

python -c "print '$cpu_label'"
python -c "print '$cpucount'"
python -c "print '$vendor'"
python -c "print ('$cpu_label')"
python -c "print ('$cpucount')"
python -c "print ('$vendor')"


distro=`lsb_release -a | grep Descr`
distro=`python -c "print '$distro'.split(':')[1].strip()"`
distro=`python -c "print ('$distro'.split(':')[1].strip())"`

file="machine_conf/`uname -n`.conf"

Expand Down
16 changes: 14 additions & 2 deletions script/generate_dat.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# $1 confing_test
# $2 confing_machine
# $3 confing_thread



Expand Down Expand Up @@ -44,9 +45,20 @@ FOLDER="batch_res_${LOWER_RANGE_CS}_${UPPER_RANGE_CS}_${LOWER_RANGE_NCS}_${UPPER
SRC_FOLDER="../out/${MACHINE_NAME}-out-$FOLDER/dat"
DST_FOLDER="../out/${MACHINE_NAME}-out-$FOLDER/dat-aggregated"

if [ ! -d ../out ]; then

# if './out' directory exists remove it and run './utils/aggregate_rand_batch_test.sh'
# if './out' directory does not exist run './utils/aggregate_rand_batch_test.sh'
# '../out' because when executing 'generate_dat.sh' we are in the directory 'lockbench/script/' and 'out' is in 'lockbench/out/'
if [ -d ../out ]; then
echo "The './out' directory exists: removing it."
rm ../out -r
echo "Aggregating data..."
./utils/aggregate_rand_batch_test.sh $1 $2 $3
echo "DONE!"
elif [ ! -d ../out ]; then
echo "The './out' directory does not exist."
echo "Aggregating data..."
./utils/aggregate_rand_batch_test.sh $1 $2
./utils/aggregate_rand_batch_test.sh $1 $2 $3
echo "DONE!"
fi

Expand Down
2 changes: 1 addition & 1 deletion script/plotresults.sh → script/plot_results.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# $1 confing_test
# $2 confing_machine

# $3 confing_thread

source ./$1
source ./$2
Expand Down
5 changes: 3 additions & 2 deletions script/run_rand_batch_test.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/bash

# $1 confing_test
# $2 confing_machine
# $1 confing_machine
# $2 confing_test
# $3 confing_thread

MAX_RETRY="5"

Expand Down
1 change: 1 addition & 0 deletions script/utils/aggregate_rand_batch_test.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

# $1 confing_test
# $2 confing_machine
# $3 confing_thread

source ./$1
source ./$2
Expand Down