-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalternative_run.py
executable file
·38 lines (30 loc) · 1.09 KB
/
alternative_run.py
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
#!/usr/bin/python
import os
import sys
import subprocess
if __name__ == "__main__":
# To run only specific benchmarks, restrict the [scripts] and [modes] array
scripts = ['aos', 'soa', 'aosoa']
modes = ['updates', 'populate']
#scripts = ['aosoa']
# modes = ['updates']
total = {}
os.system('rm -f bin/*')
os.system('mkdir -p bin')
for script in scripts:
options = '-fopt-info-vec-all 2> bin/' + script + '_infos.txt'
command = 'gcc -std=c11 -march=native -Wall -O3 -o bin/' + script + ' src/' + script + '.c ' + options
print(command)
os.system(command)
total[script] = 0
# quit()
for mode in modes:
for script in scripts:
program = './bin/' + script
result = subprocess.Popen([program, mode], stdout=subprocess.PIPE).communicate()[0]
exectime = float(result)
print(mode + ' using ' + script + ': %.02f' % exectime)
total[script] += exectime
print('')
for script in scripts:
print('total using ' + script + ': %.02f' % total[script])