-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathtimeit.sh
executable file
·57 lines (49 loc) · 1.31 KB
/
timeit.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
#!/bin/bash
#
# timeit.sh -- Times various MCGPU strategies on a couple of sample input files.
#
# Directory containing test files
DIR=resources/exampleFiles
# Test files on which to compute timings
TESTFILES="indole4000.config meoh8788.config"
#TESTFILES="indole267.config meoh500.config"
function run_test {
name=$1
args=$2
printf '%30s' "$name"
printf ' '
for file in $TESTFILES; do
runtime=`bin/metrosim $args "$DIR/$file" | grep 'Run Time:' | sed -e 's/[^0-9.]//g'`
printf '%20.04f' $runtime
printf ' '
done
printf '\n'
}
echo 'MCGPU will be run on each of the files listed below, once per test.'
echo 'Each run may take several minutes. Please be patient.'
echo 'Runtimes are in seconds.'
echo ''
# Display headers (config filenames)
printf '%30s' ''
printf ' '
for file in $TESTFILES
do
printf '%20s' "$file"
printf ' '
done
printf '\n'
# Display separators (-------)
printf '%30s' ''
printf ' '
for file in $TESTFILES
do
printf '%20s' '--------------------'
printf ' '
done
printf '\n'
# Now run tests and display runtimes
run_test 'Parallel, Proximity Matrix: ' '-p -S proximity-matrix'
run_test 'Parallel, Brute Force: ' '-p -S brute-force'
run_test 'Serial, Proximity Matrix: ' '-s -S proximity-matrix'
run_test 'Serial, Brute Force: ' '-s -S brute-force'
exit 0