-
Notifications
You must be signed in to change notification settings - Fork 1
/
scale.sh
executable file
·32 lines (25 loc) · 984 Bytes
/
scale.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
NAME1=./data/coarse$1$2.txt
NAME2=./data/stm$1$2.txt
NAME3=./data/fine$1$2.txt
rm ./data/coarse$1$2.txt
rm ./data/stm$1$2.txt
rm ./data/fine$1$2.txt
c=$(($1+3))
echo $c
norm1=$(./bin/time --resize=$2 --amount=500000 | grep -A5 "Sequential" | sed "$c,$c!d" | awk '{print $NF}';)
echo $norm1
for x in {1,2,4,8,16}; do
echo "$x threads"
total=$(./bin/time --resize=$2 --workers=$x --amount=500000 | grep -A5 "Coarse" | sed "$c,$c!d" | awk '{print $NF}';)
val=$(echo "scale=2 ; $norm1 / $total" | bc)
echo "$val" >> $NAME1
echo "$val"
total=$(./bin/time --resize=$2 --workers=$x --amount=500000 | grep -A5 "STM" | sed "$c,$c!d" | awk '{print $NF}';)
val=$(echo "scale=2 ; $norm1 / $total" | bc)
echo "$val" >> $NAME2
echo "$val"
total=$(./bin/time --resize=$2 --workers=$x --amount=500000 | grep -A5 "Fine" | sed "$c,$c!d" | awk '{print $NF}';)
val=$(echo "scale=2 ; $norm1 / $total" | bc)
echo "$val" >> $NAME3
echo "$val"
done