-
Notifications
You must be signed in to change notification settings - Fork 6
/
compile_run.sh
61 lines (57 loc) · 1.26 KB
/
compile_run.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
#!/bin/bash
root_dir=$(pwd)
# clean result
rm -f result.txt
# compile and run
cd $root_dir/serial
dir=$(ls -l|awk '/^d/ {print $NF}')
for i in $dir
do
cd $i
make clean
make
for j in $(seq 5)
do
echo "running $i:Serial for Round $j"
Time=$(make run|grep -i time|grep -o '[0-9]*\.[0-9]*')
result_string="$i:Serial:$Time"
echo "$i:$j:Serial:$Time"
echo $result_string >> $root_dir/result.txt
done
cd ..
done
cd $root_dir/openacc
dir=$(ls -l|awk '/^d/ {print $NF}')
for i in $dir
do
cd $i
make clean
make
for j in $(seq 5)
do
echo "running $i:openACC for Round $j"
Time=$(make run|grep -i time|grep -o '[0-9]*\.[0-9]*')
result_string="$i:openACC:$Time"
echo "$i:$j:openACC:$Time"
echo $result_string >> $root_dir/result.txt
done
cd ..
done
cd $root_dir/athread
dir=$(ls -l|awk '/^d/ {print $NF}')
for i in $dir
do
cd $i
make clean
make
for j in $(seq 5)
do
echo "running $i:Athread for Round $j"
Time=$(make run|grep -i time|grep -o '[0-9]*\.[0-9]*')
result_string="$i:Athread:$Time"
echo "$i:$j:Athread:$Time"
echo $result_string >> $root_dir/result.txt
done
cd ..
done
echo 'Finish'