source: proto/parabix2/src/perf_script.py @ 2592

Last change on this file since 2592 was 2591, checked in by ksherdy, 7 years ago

Added variable RUNS to perf script.

File size: 1.3 KB
Line 
1from subprocess import *
2import os
3from string import *
4
5RUNS=1
6
7testfile_home = "../../../trunk/QA/TD/"
8#programs = ['xmlwf','expat','Xerces_SAX','Xerces_DOM']
9programs = ['xmlwf','id','div2','logbase2','div2_logbase2','bit_byte']
10#programs = ['xmlwf', 'id','logbase2']
11#programs = ['xmlwf']
12testfiles = ['dew.xml','jaw.xml','roads-2.gml','po.xml','soap.xml']
13#testfiles = ['dew.u16','jaw.u16','po.u16','roads-2.u16','soap.u16']
14def run_test():     
15  mes_f = open('mesfile', 'w')
16  for program in programs:
17    for testfile in testfiles: 
18      for i in range(RUNS):
19        call(['./'+program, testfile_home+testfile], stderr=mes_f)
20       
21def analyze_rslt():     
22      mes_f = open('mesfile', 'r')
23      results = mes_f.read().split(' ')
24      results_int = []
25      rows = {}
26      for r in results[:-1]:
27        results_int.append(int(r))
28      first_row = '\t\t'
29      for testfile in testfiles:
30        first_row += testfile + '  &\t'
31      first_row =  first_row[:-4]
32      print first_row
33      for program in programs:
34        row = program + '   &\t'
35        for testfile in testfiles:
36          result = results_int[0:RUNS]
37          results_int = results_int[RUNS:]
38          row +=  str(min(result)/1000.0) + '   &\t' 
39        row = row[:-4] 
40        row +='\\\\ \\hline'
41        print row
42       
43       
44       
45if __name__ == "__main__":
46  run_test()
47  analyze_rslt()
48 
49
50           
51       
52       
53       
54       
55       
56       
57       
58       
59       
60       
61       
62       
63       
64       
Note: See TracBrowser for help on using the repository browser.