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

Last change on this file since 2704 was 2704, checked in by cameron, 7 years ago

Add experimental mode guard.

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