forked from sbradnam/JADE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpostprocess.py
89 lines (67 loc) · 2.7 KB
/
postprocess.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 3 15:33:01 2020
@author: Davide Laghi
Copyright 2021, the JADE Development Team. All rights reserved.
This file is part of JADE.
JADE is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
JADE is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with JADE. If not, see <http://www.gnu.org/licenses/>.
"""
import datetime
import sphereoutput as spho
import output as bencho
import expoutput as expo
def compareBenchmark(session, lib_input, testname):
print('\n Comparing '+testname+':' +
' '+str(datetime.datetime.now()))
lib = lib_input.split('-')
# get the correct output object
out = _get_output('compare', testname, lib, session)
if out:
out.compare()
session.log.adjourn(testname+' benchmark comparison completed' +
' ' + str(datetime.datetime.now()))
def postprocessBenchmark(session, lib, testname):
print('\n Post-Processing '+testname+':' +
' '+str(datetime.datetime.now()))
# get the correct output object
out = _get_output('pp', testname, lib, session)
if out:
out.single_postprocess()
session.log.adjourn(testname+' benchmark post-processing completed' +
' ' + str(datetime.datetime.now()))
def _get_output(action, testname, lib, session):
exp_pp_message = '\n No single pp is foreseen for experimental benchmarks'
if testname == 'Sphere':
out = spho.SphereOutput(lib, testname, session)
elif testname == 'SphereSDDR':
out = spho.SphereSDDRoutput(lib, testname, session)
elif testname == 'Oktavian':
if action == 'compare':
out = expo.OktavianOutput(lib, testname, session)
elif action == 'pp':
print(exp_pp_message)
return False
elif testname == 'Tiara':
if action == 'compare':
out = expo.TiaraOutput(lib, testname, session)
elif action == 'pp':
print(exp_pp_message)
return False
elif testname == 'FNG':
if action == 'compare':
out = expo.FNGOutput(lib, testname, session, multiplerun=True)
elif action == 'pp':
print(exp_pp_message)
return False
else:
out = bencho.BenchmarkOutput(lib, testname, session)
return out