forked from pabuhr/concurrent-locking
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunall2
executable file
·36 lines (30 loc) · 1.05 KB
/
runall2
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
#!/bin/sh -
# Experiments for: Fast Mutual Exclusion by the Triangle Algorithm, Wim H. Hesselink, Peter A. Buhr
# and David Dice, submitted
algorithms="Burns2 LamportFast Taubenfeld TaubenfeldBuhr Kessels PetersonBuhr YangAndersonFast AndersonKim Triangle TriangleMod MCS"
outdir=`hostname`
mkdir -p ${outdir}
if [ ${#} -ne 0 ] ; then
algorithms="${@}"
fi
cflag="-Wall -Wextra -Werror -Wno-implicit-fallthrough -std=gnu11 -g -O3 -DNDEBUG -fno-reorder-functions -DPIN" #
runalgorithm() {
for flag in "" "FAST" ; do
echo "${outdir}/${1}${2}${flag}"
gcc ${cflag} ${flag:+-D${flag}} ${2:+-D${2}} -DAlgorithm=${1} Harness.c -lpthread -lm
./run1 > "${outdir}/${1}${2}${flag}"
if [ -f core ] ; then
echo core generated for ${1}
break
fi
done
}
rm -rf core
for algorithm in ${algorithms} ; do
if [ ${algorithm} = "YangAndersonFast" -o ${algorithm} = "AndersonKim" -o ${algorithm} = "Triangle" -o ${algorithm} = "TriangleMod" ] ; then
runalgorithm ${algorithm} PB
runalgorithm ${algorithm} TB
else
runalgorithm ${algorithm}
fi
done