-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun
executable file
·67 lines (59 loc) · 2.11 KB
/
run
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
# Usage
# ./run clean
# ./run test
# ./run 7 [More/EvenMore]
# ./run 1-5 [More/EvenMore]
# ./run val 1-5 [More/EvenMore]
# ./run call 1-5 [More/EvenMore]
# ./run cache 1-5 [More/EvenMore]
exec=./target/crossw
make > /dev/null
if [ "x$1" = "x7" ]; then
/usr/bin/time -f "%E %Uu %Ss %P" $exec data/Empty7.txt -dict data/$2Words.txt | \
$exec data/Empty7.txt -dict data/$2Words.txt -check -draw
elif [ "x$1" = "xval" ]; then
valgrind $exec data/Crossword$2.txt -dict data/$3Words.txt
elif [ "x$1" = "xcall" ]; then
valgrind --dsymutil=yes --tool=callgrind $exec data/Crossword$2.txt -dict data/$3Words.txt | grep "refs:"
callgrind_annotate > profiler.out
rm -rf callgrind.out.*
rm -rf profiler.out
elif [ "x$1" = "xcache" ]; then
valgrind --dsymutil=yes --tool=cachegrind $exec data/Crossword$2.txt -dict data/$3Words.txt | grep "refs:"
cachegrind_annotate > profiler.out
rm -rf cachegrind.out.*
elif [ "x$1" = "xclean" ]; then
make clean &> /dev/null
rm -rf profiler.out
elif [ "x$1" = "xtest" ]; then
declare -a dicts=("Words" "MoreWords" "EvenMoreWords")
for i in {1..5}
do
for j in "${dicts[@]}"
do
echo "cross: Crossword$i.txt dict: $j.txt"
/usr/bin/time -f "%E %Uu %Ss %P" $exec data/Crossword$i.txt -dict data/$j.txt | \
$exec data/Crossword$i.txt -dict data/$j.txt -check -draw
echo ""
done
done
for j in "${dicts[@]}"
do
echo "cross: hard.txt dict: $j.txt"
/usr/bin/time -f "%E %Uu %Ss %P" $exec data/hard.txt -dict data/$j.txt | \
$exec data/hard.txt -dict data/$j.txt -check -draw
echo ""
done
elif [ "x$1" = "x" ]; then
/usr/bin/time -f "%E %Uu %Ss %P" $exec data/Crossword5.txt -dict data/Words.txt | \
$exec data/Crossword5.txt -dict data/Words.txt -check -draw
else
/usr/bin/time -f "%E %Uu %Ss %P" $exec data/Crossword$1.txt -dict data/$2Words.txt | \
$exec data/Crossword$1.txt -dict data/$2Words.txt -check -draw
fi
make clean &> /dev/null
# Words
# MoreWords
# EvenMoreWords
#./target/crossw data/Crossword5.txt -dict data/Words.txt