88
99parser = argparse .ArgumentParser ()
1010
11- parser .add_argument ("-f" ,
12- "--folder" ,
13- required = True ,
14- type = str ,
15- help = "Specify folder where results can be found" )
16- parser .add_argument ("-a" ,
17- "--application" ,
18- required = True ,
19- type = str ,
20- help = "Spcifies the applications name" )
21- parser .add_argument ("-g" ,
22- "--governor" ,
23- required = True ,
24- type = str ,
25- help = "Specifies the governor used in the test" )
11+ parser .add_argument ("-f" , "--folder" , required = True , type = str , help = "Specify folder where results can be found" )
12+ parser .add_argument ("-a" , "--application" , required = True , type = str , help = "Spcifies the applications name" )
13+ parser .add_argument ("-g" , "--governor" , required = True , type = str , help = "Specifies the governor used in the test" )
2614
2715args = parser .parse_args ()
2816
@@ -38,14 +26,9 @@ def writerEmptyRow(writer):
3826
3927
4028def writeResultsHeader (writer , governor , application ):
41- writer .writerow ([
42- "Governor: {}" .format (governor ), "Application: {}" .format (application )
43- ])
29+ writer .writerow (["Governor: {}" .format (governor ), "Application: {}" .format (application )])
4430 writerEmptyRow (writer )
45- writer .writerow ([
46- "B2L Reallocations" , "DVFS" , "Realloc in cluster" ,
47- "DVFS after realloc" , "Total"
48- ])
31+ writer .writerow (["B2L Reallocations" , "DVFS" , "Realloc in cluster" , "DVFS after realloc" , "Total" ])
4932
5033
5134def findOptimizationsRow (filepath ):
@@ -66,23 +49,25 @@ def findOptimizationsRow(filepath):
6649 pass
6750
6851
52+ tests = []
53+
54+
6955def getResults ():
56+ global tests
7057 res_count = 0
7158 results = [0 , 0 , 0 , 0 ]
7259 for directory , subdirectory , files in os .walk (input_dir ):
7360 for sd in subdirectory :
7461 for d , s , f in os .walk (os .path .join (directory , sd )):
7562 for r_file in f :
7663 if "results" in r_file :
77- print ("{} : {}" .format (sd , d ))
7864 test = os .path .join (d , r_file )
7965 res = findOptimizationsRow (test )
8066 res_count += 1
8167 if (len (res ) != 4 ):
82- raise Exception (
83- "File {} failed to process" .format (test ))
68+ raise Exception ("File {} failed to process" .format (test ))
8469 else :
85- print ( "{}" . format (res ) )
70+ tests . append (res )
8671 for i in range (len (res )):
8772 results [i ] += int (res [i ])
8873
@@ -92,9 +77,7 @@ def getResults():
9277 total += results [i ]
9378
9479 results .append (total )
95- print ("Total: {}, {}, {}, {} : {}" .format (results [0 ], results [1 ],
96- results [2 ], results [3 ],
97- results [4 ]))
80+ print ("Total: {}, {}, {}, {} : {}" .format (results [0 ], results [1 ], results [2 ], results [3 ], results [4 ]))
9881 return results
9982
10083
@@ -107,3 +90,8 @@ def getResults():
10790
10891 writeResultsHeader (fw , governor , application )
10992 fw .writerow (r )
93+ fw .writerow ([])
94+ fw .writerow (["Individual tests" ])
95+
96+ for i , test in enumerate (tests ):
97+ fw .writerow ([i + 1 , test [0 ], test [1 ], test [2 ], test [3 ]])
0 commit comments