diff --git a/Readme.md b/Readme.md index cb496e2..ec81e9d 100644 --- a/Readme.md +++ b/Readme.md @@ -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. @@ -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/ tests_conf/ thread_conf/ +$ ./run_rand_batch_test.sh machine_conf/ tests_conf/ thread_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/ tests_conf/` -2. Obtain the plots -`./plot_results.sh machine_conf/ tests_conf/` + +1. First aggregate results by executing the following command: +```sh +$ ./generate_dat.sh tests_conf/ machine_conf/ thread_conf/ +``` +2. Obtain the plots: +```sh +$ ./plot_results.sh tests_conf/ machine_conf/ thread_conf/ +``` 3. Find the charts in the `plots` directory diff --git a/script/clone_modules.sh b/script/clone_modules.sh old mode 100644 new mode 100755 diff --git a/script/create_machine_conf.sh b/script/create_machine_conf.sh old mode 100644 new mode 100755 index 68bd9a4..f367cab --- a/script/create_machine_conf.sh +++ b/script/create_machine_conf.sh @@ -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 @@ -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" diff --git a/script/generate_dat.sh b/script/generate_dat.sh old mode 100644 new mode 100755 index 31c0c47..50c8060 --- a/script/generate_dat.sh +++ b/script/generate_dat.sh @@ -2,6 +2,7 @@ # $1 confing_test # $2 confing_machine +# $3 confing_thread @@ -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 diff --git a/script/plotresults.sh b/script/plot_results.sh old mode 100644 new mode 100755 similarity index 99% rename from script/plotresults.sh rename to script/plot_results.sh index 4704c7b..7064dea --- a/script/plotresults.sh +++ b/script/plot_results.sh @@ -3,7 +3,7 @@ # $1 confing_test # $2 confing_machine - +# $3 confing_thread source ./$1 source ./$2 diff --git a/script/run_rand_batch_test.sh b/script/run_rand_batch_test.sh old mode 100644 new mode 100755 index 4d08880..e124969 --- a/script/run_rand_batch_test.sh +++ b/script/run_rand_batch_test.sh @@ -1,7 +1,8 @@ #!/bin/bash -# $1 confing_test -# $2 confing_machine +# $1 confing_machine +# $2 confing_test +# $3 confing_thread MAX_RETRY="5" diff --git a/script/utils/aggregate_rand_batch_test.sh b/script/utils/aggregate_rand_batch_test.sh old mode 100644 new mode 100755 index 417b02e..d237fa2 --- a/script/utils/aggregate_rand_batch_test.sh +++ b/script/utils/aggregate_rand_batch_test.sh @@ -6,6 +6,7 @@ # $1 confing_test # $2 confing_machine +# $3 confing_thread source ./$1 source ./$2