forked from pabuhr/concurrent-locking
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunall
executable file
·38 lines (32 loc) · 1.17 KB
/
runall
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh -
# Experiments for: High-Performance N-Thread Software Solutions for Mutual Exclusion, Peter A. Buhr,
# David Dice and Wim H. Hesselink, Concurrency and Computation: Practice and Experience,
# http://dx.doi.org/10.1002/cpe.3263
algorithms="Communicate Aravind Burns2 DeBruijn Dijkstra Eisenberg Hehner Hesselink Kessels Knuth LamportRetract LamportBakery LamportFast LycklamaBuhr Lynch Peterson PetersonT PetersonBuhr Szymanski Taubenfeld TaubenfeldBuhr Arbiter MCS SpinLock PthreadLock ZhangYA Zhang2T ZhangdT"
outdir=`hostname`
mkdir -p ${outdir}
if [ ${#} -ne 0 ] ; then
algorithms="${@}"
fi
cflag="-Wall -Wextra -Werror -std=gnu11 -O3 -DNDEBUG -fno-reorder-functions -DPIN" # -DFAST
runalgorithm() {
echo "${outdir}/${1}${2}"
gcc ${cflag} -DAlgorithm=${1} Harness.c -lpthread -lm
./run1 "${2}" > "${outdir}/${1}${2}"
if [ -f core ] ; then
echo core generated for ${1}
break
fi
}
rm -rf core
for algorithm in ${algorithms} ; do
if [ ${algorithm} = "ZhangdT" -o ${algorithm} = "ZhangdTWHH" ] ; then
d=2
while [ ${d} -le 32 ] ; do
runalgorithm ${algorithm} ${d}
d=`expr ${d} + ${d}`
done
else
runalgorithm ${algorithm}
fi
done