forked from pabuhr/concurrent-locking
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunall4
executable file
·45 lines (38 loc) · 1.07 KB
/
runall4
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
41
42
43
44
45
#!/bin/sh -
algorithms2P="DekkerB DekkerRW Doran Peterson2 Tsay Kessels2"
algorithms2="DekkerOrig ${algorithms2P}"
algorithmsNP="PetersonBuhr TaubenfeldBuhr"
algorithmsN="LamportBakery MCS"
outdir=`hostname`
mkdir -p ${outdir}
if [ ${#} -ne 0 ] ; then
algorithms="${@}"
fi
cflag="-Wall -Wextra -Werror -std=gnu11 -O3 -DNDEBUG -fno-reorder-functions -DPIN" #
runalgorithm() {
for flag in "" "FAST" ; do
echo "${outdir}/${1}${3}${flag}"
gcc ${cflag} ${flag:+-D${flag}} ${3:+-D${3}} -DAlgorithm=${1} Harness.c -lpthread -lm
if [ ${2} -eq 2 ] ; then
./run1 N=${2} T=2 > "${outdir}/${1}${3}${flag}"
else
./run1 N=${2} > "${outdir}/${1}${3}${flag}"
fi
if [ -f core ] ; then
echo core generated for ${1}
break
fi
done
}
rm -rf core
for algorithm in ${algorithms2} ; do
runalgorithm ${algorithm} 2
done
for algorithm in ${algorithmsNP} ; do
for algorithm2 in ${algorithms2P} ; do
runalgorithm ${algorithm} 32 `echo ${algorithm2} | tr '[:lower:]' '[:upper:]'`
done
done
for algorithm in ${algorithmsN} ; do
runalgorithm ${algorithm} 32
done