|
From: <mm...@us...> - 2012-12-10 09:45:12
|
Revision: 3308
http://dmcs.svn.sourceforge.net/dmcs/?rev=3308&view=rev
Author: mmsc
Date: 2012-12-10 09:45:03 +0000 (Mon, 10 Dec 2012)
Log Message:
-----------
Update ouput collecting script.
Modified Paths:
--------------
dmcs/branches/dmcs1.5/examples/test/genTest.sh
dmcs/branches/dmcs1.5/examples/test/tables.py
dmcs/branches/dmcs1.5/examples/test/templates/tex_footer.tpl
Added Paths:
-----------
dmcs/branches/dmcs1.5/examples/test/config/
dmcs/branches/dmcs1.5/examples/test/config/diamond.cfg
dmcs/branches/dmcs1.5/examples/test/config/diamond.out1
dmcs/branches/dmcs1.5/examples/test/config/diamond.out2
dmcs/branches/dmcs1.5/examples/test/config/ring.cfg
dmcs/branches/dmcs1.5/examples/test/config/ring.out1
dmcs/branches/dmcs1.5/examples/test/config/ring.out2
dmcs/branches/dmcs1.5/examples/test/config/zigzag.cfg
Added: dmcs/branches/dmcs1.5/examples/test/config/diamond.cfg
===================================================================
--- dmcs/branches/dmcs1.5/examples/test/config/diamond.cfg (rev 0)
+++ dmcs/branches/dmcs1.5/examples/test/config/diamond.cfg 2012-12-10 09:45:03 UTC (rev 3308)
@@ -0,0 +1,60 @@
+1,4,10,5,5,a
+1,4,10,5,5,b
+1,4,10,5,5,c
+1,4,10,5,5,d
+1,4,10,5,5,e
+1,4,20,10,10,a
+1,4,20,10,10,b
+1,4,20,10,10,c
+1,4,20,10,10,d
+1,4,20,10,10,e
+1,7,10,5,5,a
+1,7,10,5,5,b
+1,7,10,5,5,c
+1,7,10,5,5,d
+1,7,10,5,5,e
+1,7,20,10,10,a
+1,7,20,10,10,b
+1,7,20,10,10,c
+1,7,20,10,10,d
+1,7,20,10,10,e
+1,10,10,5,5,a
+1,10,10,5,5,b
+1,10,10,5,5,c
+1,10,10,5,5,d
+1,10,10,5,5,e
+1,10,20,10,10,a
+1,10,20,10,10,b
+1,10,20,10,10,c
+1,10,20,10,10,d
+1,10,20,10,10,e
+1,13,10,5,5,a
+1,13,10,5,5,b
+1,13,10,5,5,c
+1,13,10,5,5,d
+1,13,10,5,5,e
+1,13,20,10,10,a
+1,13,20,10,10,b
+1,13,20,10,10,c
+1,13,20,10,10,d
+1,13,20,10,10,e
+1,25,10,5,5,a
+1,25,10,5,5,b
+1,25,10,5,5,c
+1,25,10,5,5,d
+1,25,10,5,5,e
+1,25,20,10,10,a
+1,25,20,10,10,b
+1,25,20,10,10,c
+1,25,20,10,10,d
+1,25,20,10,10,e
+1,31,10,5,5,a
+1,31,10,5,5,b
+1,31,10,5,5,c
+1,31,10,5,5,d
+1,31,10,5,5,e
+1,31,20,10,10,a
+1,31,20,10,10,b
+1,31,20,10,10,c
+1,31,20,10,10,d
+1,31,20,10,10,e
Added: dmcs/branches/dmcs1.5/examples/test/config/diamond.out1
===================================================================
--- dmcs/branches/dmcs1.5/examples/test/config/diamond.out1 (rev 0)
+++ dmcs/branches/dmcs1.5/examples/test/config/diamond.out1 2012-12-10 09:45:03 UTC (rev 3308)
@@ -0,0 +1,30 @@
+1,4,10,5,5,a
+1,4,10,5,5,b
+1,4,10,5,5,c
+1,4,10,5,5,d
+1,4,10,5,5,e
+1,4,20,10,10,a
+1,4,20,10,10,b
+1,4,20,10,10,c
+1,4,20,10,10,d
+1,4,20,10,10,e
+1,7,10,5,5,a
+1,7,10,5,5,b
+1,7,10,5,5,c
+1,7,10,5,5,d
+1,7,10,5,5,e
+1,7,20,10,10,a
+1,7,20,10,10,b
+1,7,20,10,10,c
+1,7,20,10,10,d
+1,7,20,10,10,e
+1,10,10,5,5,a
+1,10,10,5,5,b
+1,10,10,5,5,c
+1,10,10,5,5,d
+1,10,10,5,5,e
+1,10,20,10,10,a
+1,10,20,10,10,b
+1,10,20,10,10,c
+1,10,20,10,10,d
+1,10,20,10,10,e
Added: dmcs/branches/dmcs1.5/examples/test/config/diamond.out2
===================================================================
--- dmcs/branches/dmcs1.5/examples/test/config/diamond.out2 (rev 0)
+++ dmcs/branches/dmcs1.5/examples/test/config/diamond.out2 2012-12-10 09:45:03 UTC (rev 3308)
@@ -0,0 +1,30 @@
+1,13,10,5,5,a
+1,13,10,5,5,b
+1,13,10,5,5,c
+1,13,10,5,5,d
+1,13,10,5,5,e
+1,13,20,10,10,a
+1,13,20,10,10,b
+1,13,20,10,10,c
+1,13,20,10,10,d
+1,13,20,10,10,e
+1,25,10,5,5,a
+1,25,10,5,5,b
+1,25,10,5,5,c
+1,25,10,5,5,d
+1,25,10,5,5,e
+1,25,20,10,10,a
+1,25,20,10,10,b
+1,25,20,10,10,c
+1,25,20,10,10,d
+1,25,20,10,10,e
+1,31,10,5,5,a
+1,31,10,5,5,b
+1,31,10,5,5,c
+1,31,10,5,5,d
+1,31,10,5,5,e
+1,31,20,10,10,a
+1,31,20,10,10,b
+1,31,20,10,10,c
+1,31,20,10,10,d
+1,31,20,10,10,e
Added: dmcs/branches/dmcs1.5/examples/test/config/ring.cfg
===================================================================
--- dmcs/branches/dmcs1.5/examples/test/config/ring.cfg (rev 0)
+++ dmcs/branches/dmcs1.5/examples/test/config/ring.cfg 2012-12-10 09:45:03 UTC (rev 3308)
@@ -0,0 +1,50 @@
+4,4,10,5,5,a
+4,4,10,5,5,b
+4,4,10,5,5,c
+4,4,10,5,5,d
+4,4,10,5,5,e
+4,4,20,10,10,a
+4,4,20,10,10,b
+4,4,20,10,10,c
+4,4,20,10,10,d
+4,4,20,10,10,e
+4,7,10,5,5,a
+4,7,10,5,5,b
+4,7,10,5,5,c
+4,7,10,5,5,d
+4,7,10,5,5,e
+4,7,20,10,10,a
+4,7,20,10,10,b
+4,7,20,10,10,c
+4,7,20,10,10,d
+4,7,20,10,10,e
+4,10,10,5,5,a
+4,10,10,5,5,b
+4,10,10,5,5,c
+4,10,10,5,5,d
+4,10,10,5,5,e
+4,10,20,10,10,a
+4,10,20,10,10,b
+4,10,20,10,10,c
+4,10,20,10,10,d
+4,10,20,10,10,e
+4,13,10,5,5,a
+4,13,10,5,5,b
+4,13,10,5,5,c
+4,13,10,5,5,d
+4,13,10,5,5,e
+4,13,20,10,10,a
+4,13,20,10,10,b
+4,13,20,10,10,c
+4,13,20,10,10,d
+4,13,20,10,10,e
+4,70,10,5,5,a
+4,70,10,5,5,b
+4,70,10,5,5,c
+4,70,10,5,5,d
+4,70,10,5,5,e
+4,70,20,10,10,a
+4,70,20,10,10,b
+4,70,20,10,10,c
+4,70,20,10,10,d
+4,70,20,10,10,e
\ No newline at end of file
Added: dmcs/branches/dmcs1.5/examples/test/config/ring.out1
===================================================================
--- dmcs/branches/dmcs1.5/examples/test/config/ring.out1 (rev 0)
+++ dmcs/branches/dmcs1.5/examples/test/config/ring.out1 2012-12-10 09:45:03 UTC (rev 3308)
@@ -0,0 +1,31 @@
+4,4,10,5,5,a
+4,4,10,5,5,b
+4,4,10,5,5,c
+4,4,10,5,5,d
+4,4,10,5,5,e
+4,4,20,10,10,a
+4,4,20,10,10,b
+4,4,20,10,10,c
+4,4,20,10,10,d
+4,4,20,10,10,e
+4,7,10,5,5,a
+4,7,10,5,5,b
+4,7,10,5,5,c
+4,7,10,5,5,d
+4,7,10,5,5,e
+4,7,20,10,10,a
+4,7,20,10,10,b
+4,7,20,10,10,c
+4,7,20,10,10,d
+4,7,20,10,10,e
+4,10,10,5,5,a
+4,10,10,5,5,b
+4,10,10,5,5,c
+4,10,10,5,5,d
+4,10,10,5,5,e
+4,10,20,10,10,a
+4,10,20,10,10,b
+4,10,20,10,10,c
+4,10,20,10,10,d
+4,10,20,10,10,e
+
Added: dmcs/branches/dmcs1.5/examples/test/config/ring.out2
===================================================================
--- dmcs/branches/dmcs1.5/examples/test/config/ring.out2 (rev 0)
+++ dmcs/branches/dmcs1.5/examples/test/config/ring.out2 2012-12-10 09:45:03 UTC (rev 3308)
@@ -0,0 +1,20 @@
+4,13,10,5,5,a
+4,13,10,5,5,b
+4,13,10,5,5,c
+4,13,10,5,5,d
+4,13,10,5,5,e
+4,13,20,10,10,a
+4,13,20,10,10,b
+4,13,20,10,10,c
+4,13,20,10,10,d
+4,13,20,10,10,e
+4,70,10,5,5,a
+4,70,10,5,5,b
+4,70,10,5,5,c
+4,70,10,5,5,d
+4,70,10,5,5,e
+4,70,20,10,10,a
+4,70,20,10,10,b
+4,70,20,10,10,c
+4,70,20,10,10,d
+4,70,20,10,10,e
Added: dmcs/branches/dmcs1.5/examples/test/config/zigzag.cfg
===================================================================
--- dmcs/branches/dmcs1.5/examples/test/config/zigzag.cfg (rev 0)
+++ dmcs/branches/dmcs1.5/examples/test/config/zigzag.cfg 2012-12-10 09:45:03 UTC (rev 3308)
@@ -0,0 +1,70 @@
+3,4,10,5,5,a
+3,4,10,5,5,b
+3,4,10,5,5,c
+3,4,10,5,5,d
+3,4,10,5,5,e
+3,4,20,10,10,a
+3,4,20,10,10,b
+3,4,20,10,10,c
+3,4,20,10,10,d
+3,4,20,10,10,e
+3,7,10,5,5,a
+3,7,10,5,5,b
+3,7,10,5,5,c
+3,7,10,5,5,d
+3,7,10,5,5,e
+3,7,20,10,10,a
+3,7,20,10,10,b
+3,7,20,10,10,c
+3,7,20,10,10,d
+3,7,20,10,10,e
+3,10,10,5,5,a
+3,10,10,5,5,b
+3,10,10,5,5,c
+3,10,10,5,5,d
+3,10,10,5,5,e
+3,10,20,10,10,a
+3,10,20,10,10,b
+3,10,20,10,10,c
+3,10,20,10,10,d
+3,10,20,10,10,e
+3,13,10,5,5,a
+3,13,10,5,5,b
+3,13,10,5,5,c
+3,13,10,5,5,d
+3,13,10,5,5,e
+3,13,20,10,10,a
+3,13,20,10,10,b
+3,13,20,10,10,c
+3,13,20,10,10,d
+3,13,20,10,10,e
+3,25,10,5,5,a
+3,25,10,5,5,b
+3,25,10,5,5,c
+3,25,10,5,5,d
+3,25,10,5,5,e
+3,25,20,10,10,a
+3,25,20,10,10,b
+3,25,20,10,10,c
+3,25,20,10,10,d
+3,25,20,10,10,e
+3,31,10,5,5,a
+3,31,10,5,5,b
+3,31,10,5,5,c
+3,31,10,5,5,d
+3,31,10,5,5,e
+3,31,20,10,10,a
+3,31,20,10,10,b
+3,31,20,10,10,c
+3,31,20,10,10,d
+3,31,20,10,10,e
+3,70,10,5,5,a
+3,70,10,5,5,b
+3,70,10,5,5,c
+3,70,10,5,5,d
+3,70,10,5,5,e
+3,70,20,10,10,a
+3,70,20,10,10,b
+3,70,20,10,10,c
+3,70,20,10,10,d
+3,70,20,10,10,e
Modified: dmcs/branches/dmcs1.5/examples/test/genTest.sh
===================================================================
--- dmcs/branches/dmcs1.5/examples/test/genTest.sh 2012-12-04 18:15:13 UTC (rev 3307)
+++ dmcs/branches/dmcs1.5/examples/test/genTest.sh 2012-12-10 09:45:03 UTC (rev 3308)
@@ -93,7 +93,7 @@
createSubDir config
createSubDir data
-python listTests.py
+python listTests.py --ext=cfg
for topofile in `ls config/*.cfg` ; do
length=${#topofile}
Modified: dmcs/branches/dmcs1.5/examples/test/tables.py
===================================================================
--- dmcs/branches/dmcs1.5/examples/test/tables.py 2012-12-04 18:15:13 UTC (rev 3307)
+++ dmcs/branches/dmcs1.5/examples/test/tables.py 2012-12-10 09:45:03 UTC (rev 3308)
@@ -5,8 +5,8 @@
import string
import re
import os
+from optparse import OptionParser
-
def get_running_time(log_time):
# Watchout: we only expect time of the form MM:SS.SS
str_time = 'Notime'
@@ -142,22 +142,38 @@
return True
+def compare(outcome1, outcome2):
+ val1 = float(outcome1[0][0])
+ val2 = float(outcome2[0][0])
+ if (val1 > val2):
+ return 1
+ elif (val1 < val2):
+ return -1
+ else: # val1 == val2
+ val1 = float(outcome1[1][0])
+ val2 = float(outcome2[1][0])
+ if (val1 > val2):
+ return 1
+ elif (val1 < val2):
+ return -1
+
+ return 0
+
def ordered_push(outcomes, outcome, sorted_testcases, testcase):
if outcomes == []:
outcomes.append(outcome)
sorted_testcases.append(testcase)
else:
i = 0
- new_val = float(outcome[0][0])
found = False
while i < len(outcomes):
- old_val = float(outcomes[i][0][0])
- i = i + 1
- if old_val > new_val:
+ if compare(outcomes[i], outcome) == 1:
+ i = i + 1
found = True
break
+ i = i + 1
if found == True:
outcomes.insert(i-1, outcome)
@@ -252,8 +268,8 @@
final_display(outcome[0][1]),
final_display(outcome[1][0]),
final_display(outcome[1][1]),
- nice_display(outcome[2][0], outcome[2][1]),
- nice_display(outcome[3][0], outcome[3][1]),
+ final_display(outcome[2][0]),
+ final_display(outcome[3][0]),
final_display(outcome[4][0]),
outcome[4][1],
nice_display(outcome[5][0], outcome[5][1]),
@@ -268,9 +284,28 @@
nice_display(outcome[11][0], outcome[11][1])))
+
+
+def build_footer(tex_output, topo, inputext):
+ with open('templates/tex_footer.tpl') as f:
+ for line in f.readlines():
+ tex_output.write(line.format(topo + '-' + inputext))
+
+
+
+
def main(argv):
+ parser = OptionParser()
+ parser.add_option("-i", "--inp", dest="inputext", help="extension of output instances", metavar="INP")
+ parser.add_option("-t", "--topo", dest="topology", help="topology to create table", metavar="TOPO")
+
+ (options, args) = parser.parse_args()
+
+ topo = options.topology
+ inputext = options.inputext
+
# copy header
- tex_output = open('./table.tex', 'w')
+ tex_output = open('./table-' + topo + '-' + inputext + '.tex', 'w')
copy_text(tex_output, 'templates/tex_header.tpl')
# read row template
@@ -279,50 +314,48 @@
t.closed
topo_abbreviation = {'diamond' : 'D', 'ring' : 'R', 'tree' : 'T', 'zigzag' : 'Z'}
- #topologies = ['diamond', 'ring', 'tree', 'zigzag']
- topologies = ['ring']
testpacks = ['all', '1', '10', '100' ]
subdirs = ['', '/all', '/opt_all', '/1', '/opt_1', '/10', '/noloop_10', '/opt_10', '/opt_noloop_10', '/100', '/noloop_100', '/opt_100', '/opt_noloop_100']
- for topo in topologies:
- filename = 'config/' + topo + '.out'
- with open(filename, 'r') as config_file:
- line = config_file.readline()
- line = line[:len(line)-1]
- current_instance = re.split(',', line)
- current_test_case = [current_instance]
- while True:
- while True:
- line = config_file.readline()
- if line == "":
- break
- line = line[:len(line)-1]
- current_instance = re.split(',', line)
- if instance_compare(current_instance, current_test_case[0]) == 0:
- current_test_case.append(current_instance)
- else:
- break
+ filename = 'config/' + topo + '.' + inputext
+ with open(filename, 'r') as config_file:
+ line = config_file.readline()
+ line = line[:len(line)-1]
+ current_instance = re.split(',', line)
+ current_test_case = [current_instance]
+ while True:
- outcomes, sorted_testcases = process_test_cases(topo, testpacks, current_test_case)
+ while True:
+ line = config_file.readline()
+ if line == "":
+ break
+ line = line[:len(line)-1]
+ current_instance = re.split(',', line)
+ if instance_compare(current_instance, current_test_case[0]) == 0:
+ current_test_case.append(current_instance)
+ else:
+ break
- if outcomes != []:
- build_row(tex_output, tex_row_template,
- outcomes, sorted_testcases,
- topo, topo_abbreviation[topo])
+ outcomes, sorted_testcases = process_test_cases(topo, testpacks, current_test_case)
+
+ if outcomes != []:
+ build_row(tex_output, tex_row_template,
+ outcomes, sorted_testcases,
+ topo, topo_abbreviation[topo])
- #print outcomes
- #print "\n"
- #print sorted_testcases
- #print "\n"
+ #print outcomes
+ #print "\n"
+ #print sorted_testcases
+ #print "\n"
- if line == "":
- break
+ if line == "":
+ break
- current_test_case = [current_instance]
- config_file.closed
+ current_test_case = [current_instance]
+ config_file.closed
- copy_text(tex_output, 'templates/tex_footer.tpl')
+ build_footer(tex_output, topo, inputext)
tex_output.closed
if __name__ == "__main__":
Modified: dmcs/branches/dmcs1.5/examples/test/templates/tex_footer.tpl
===================================================================
--- dmcs/branches/dmcs1.5/examples/test/templates/tex_footer.tpl 2012-12-04 18:15:13 UTC (rev 3307)
+++ dmcs/branches/dmcs1.5/examples/test/templates/tex_footer.tpl 2012-12-10 09:45:03 UTC (rev 3308)
@@ -1,7 +1,7 @@
\bottomrule
-\end{tabular}
-%\vspace{-.2cm}
-\caption{Runtime in secs, timeout 600 secs (---)}
-\label{tab:simple-timings}
-\vspace{-.5cm}
-\end{table}
\ No newline at end of file
+\end{{tabular}}
+%\vspace{{-.2cm}}
+\caption{{Runtime in secs, timeout 600 secs (---)}}
+\label{{tab:{0}-timings}}
+\vspace{{-.5cm}}
+\end{{table}}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|