-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheval.sh
More file actions
executable file
·53 lines (47 loc) · 1.27 KB
/
eval.sh
File metadata and controls
executable file
·53 lines (47 loc) · 1.27 KB
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
#!/bin/bash
file1="../1.txt"
file2="../2.txt"
for x in {1..5}
do
echo "Running $file1 $file2"
stotal=0
echo "Running $file1 $file2">>sresult
echo "Running $file1 $file2">>presult
ptotal=0
for i in {1..10}
do
t0=`python -c 'import time; print repr(time.time()*1000000)'`
time java main $file1 $file2 s >> sresult
t1=`python -c 'import time; print repr(time.time()*1000000)'`
t0=${t0/.*}
t1=${t1/.*}
stotal=$(($t1 - $t0))
t0=`python -c 'import time; print repr(time.time()*1000000)'`
time java main $file1 $file2 p >> presult
t1=`python -c 'import time; print repr(time.time()*1000000)'`
t0=${t0/.*}
t1=${t1/.*}
ptotal=$(($t1 - $t0))
if diff sequential parallel > /dev/null; then
echo same
else
echo different
fi
done
echo $stotal
echo $ptotal
echo "$(echo "scale=2; ($stotal - $ptotal) * 100 / $stotal" | bc)"
if [ $x -eq 1 ]; then
file1="../file1_1M.txt"
file2="../file2_1M.txt"
elif [ $x -eq 2 ]; then
file2="../file2_3M.txt"
file1="../file1_3M.txt"
elif [ $x -eq 3 ]; then
file2="../file2_5M.txt"
file1="../file1_5M.txt"
elif [ $x -eq 4 ]; then
file2="../file2_10M.txt"
file1="../file1_10M.txt"
fi
done