summaryrefslogtreecommitdiffstats
path: root/data/ref_results/compute_suite.py
blob: ce7f33cd2fee3f4903a619eb51a1c723b7479753 (plain)
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
import json
import compute_benchmarks_indices as benchmark_indices


compute_dict={};

try:
   compute_dict['DPI']=benchmark_indices.dpi_index()
except  OSError:
    pass
   
   

try:
    compute_dict['Dhrystone']=benchmark_indices.dwstone_index('dhrystone','Dhrystone')
except OSError:
    pass

try:
    compute_dict['Whetstone']=benchmark_indices.dwstone_index('whetstone','Whetstone') 
except OSError:
    pass

try:
    compute_dict['SSL']=benchmark_indices.ssl_index()
except OSError:
    pass

try:
    compute_dict['RamSpeed']=benchmark_indices.ramspeed_index()
except OSError:
    pass


compute_bench_list=['DPI','Dhrystone','Whetstone','SSL','RamSpeed']
l=len(compute_bench_list)

temp=0
for benchmark in compute_bench_list:
    try:
        temp=temp+float(compute_dict[benchmark]['1. Index'])
    except KeyError:
        l=l-1
        pass

if l == 0:
    print "No compute suite results found"
else:
    compute_suite_index=temp/l 
    compute_dict_f={};
    compute_dict_f['index']=compute_suite_index
    compute_dict_f['suite results']=compute_dict
    with open('../../results/compute_result.json', 'w+') as result_json:
        json.dump(compute_dict_f, result_json, indent=4, sort_keys=True)