forked from pabuhr/concurrent-locking
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunall3
executable file
·39 lines (33 loc) · 959 Bytes
/
runall3
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
#!/bin/sh -
algorithms="MCS RMRS ElevatorLinear ElevatorTree"
#algorithms="ElevatorLinear ElevatorTree"
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 contention in "" "FAST" ; do
echo "${outdir}/${1}${2}${3}${contention}"
gcc ${cflag} ${contention:+-D${contention}} ${2:+-D${2}} ${3:+-D${3}} ${4:+-D${4}} -DAlgorithm=${1} Harness.c -lpthread -lm
./run1 > "${outdir}/${1}${2}${3}${contention}"
if [ -f core ] ; then
echo core generated for ${1}
break
fi
done
}
rm -rf core
for algorithm in ${algorithms} ; do
if [ ${algorithm} = "ElevatorLinear" -o ${algorithm} = "ElevatorTree" ] ; then
for cas in "CAS" "WCasBL" "WCasLF" ; do
for flag in "" "FLAG" ; do
runalgorithm ${algorithm} ${cas} ${flag}
done
done
else
runalgorithm ${algorithm}
fi
done
rm -f a.out