-
Notifications
You must be signed in to change notification settings - Fork 0
/
tester.sh
executable file
·69 lines (64 loc) · 1.29 KB
/
tester.sh
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
68
69
#!/bin/bash
PARAMS=""
while (("$#")); do
case "$1" in
-l | --lab)
LAB=$2
shift 2
;;
--) # end argument parsing
shift
break
;;
-* | --*=) # unsupported flags
echo "Error: Unsupported flag $1" >&2
exit 1
;;
*) # preserve positional arguments
PARAMS="$PARAMS $1"
shift
;;
esac
done
# set positional arguments in their proper place
eval set -- "$PARAMS"
if [ $LAB == "lab-1" ]; then
# SHELL SORT
echo "SHELL SORT STATISTICS :"
# Sequential
echo "Sequential"
for size in 5000000, 10000000, 30000000; do
${PWD}/$LAB/shellsort -s $size
done
# Parallel
echo "Parallel"
for size in 5000000, 10000000, 30000000; do
for threads in 1, 2, 4, 8, 16, 32, 64; do
${PWD}/$LAB/shellsort-parallel -s 10 -n $threads
done
done
# RADIX SORT
echo "RADIX SORT STATISTICS :"
# Sequential
echo "Sequential"
for size in 5000000, 10000000, 30000000; do
${PWD}/$LAB/shellsort -s $size
done
# Parallel
echo "Parallel"
for size in 5000000, 10000000, 30000000; do
for threads in 1, 2, 4, 8, 16, 32, 64; do
${PWD}/$LAB/shellsort-parallel -s 10 -n $threads
done
done
fi
if [ $LAB == "lab-2" ]; then
cd ${PWD}/$LAB/
./tests.sh
cd ../
fi
if [ $LAB == "lab-3" ]; then
cd ${PWD}/$LAB/
./tests.sh
cd ../
fi