forked from pabuhr/concurrent-locking
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunall7
executable file
·40 lines (33 loc) · 1 KB
/
runall7
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
39
40
#!/bin/sh -
# Experiments for: Rectangle Algorithm
algorithms="Triangle TriangleMod Trapezium Rectangle MCS SpinLock SpinLockTicket"
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 contention in "" "FAST" ; do
outfile=${outdir}/${1}${2}${contention}
echo "${outfile}"
gcc-9 ${cflag} ${contention:+-D${contention}} ${2:+-DNEST=${2}} -DAlgorithm=${1} Harness.c -lpthread -lm
# gcc-9 ${cflag} ${contention:+-D${contention}} ${2:+-DNEST=${2}} -DAlgorithm=${1} Harness.c -lpthread -lm
# ./run1 > "${outfile}"
if [ -f core ] ; then
echo core generated for ${1}
break
fi
done
}
rm -rf core
for algorithm in ${algorithms} ; do
if [ ${algorithm} = "Trapezium" -o ${algorithm} = "TrapeziumHW" ] ; then
for K in 1 2 3 ; do # 4 5
runalgorithm ${algorithm} ${K}
done
else
runalgorithm ${algorithm}
fi
done
rm -f a.out