Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 1 | import argparse |
| 2 | import sqlite3 |
| 3 | import re |
| 4 | import pandas as pd |
| 5 | import numpy as np |
Christophe Favergeon | ed0eab8 | 2020-05-18 08:43:38 +0200 | [diff] [blame] | 6 | from TestScripts.doc.Structure import * |
| 7 | from TestScripts.doc.Format import * |
Christophe Favergeon | c3f455c | 2020-05-14 09:24:07 +0200 | [diff] [blame] | 8 | |
Christophe Favergeon | c3f455c | 2020-05-14 09:24:07 +0200 | [diff] [blame] | 9 | |
Christophe Favergeon | 670b167 | 2020-05-28 12:47:58 +0200 | [diff] [blame^] | 10 | runidCMD = "runid = ?" |
Christophe Favergeon | c3f455c | 2020-05-14 09:24:07 +0200 | [diff] [blame] | 11 | |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 12 | # Command to get last runid |
| 13 | lastID="""SELECT runid FROM RUN ORDER BY runid DESC LIMIT 1 |
| 14 | """ |
| 15 | |
Christophe Favergeon | e15894e | 2020-05-14 07:25:53 +0200 | [diff] [blame] | 16 | # Command to get last runid and date |
| 17 | lastIDAndDate="""SELECT date FROM RUN WHERE runid=? |
| 18 | """ |
| 19 | |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 20 | def getLastRunID(): |
| 21 | r=c.execute(lastID) |
| 22 | return(int(r.fetchone()[0])) |
| 23 | |
Christophe Favergeon | e15894e | 2020-05-14 07:25:53 +0200 | [diff] [blame] | 24 | def getrunIDDate(forID): |
| 25 | r=c.execute(lastIDAndDate,(forID,)) |
| 26 | return(r.fetchone()[0]) |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 27 | |
| 28 | runid = 1 |
| 29 | |
| 30 | parser = argparse.ArgumentParser(description='Generate summary benchmarks') |
| 31 | |
Christophe Favergeon | feb7393 | 2020-05-20 14:48:06 +0200 | [diff] [blame] | 32 | parser.add_argument('-b', nargs='?',type = str, default="bench.db", help="Database") |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 33 | parser.add_argument('-o', nargs='?',type = str, default="full.md", help="Full summary") |
| 34 | parser.add_argument('-r', action='store_true', help="Regression database") |
Christophe Favergeon | c3f455c | 2020-05-14 09:24:07 +0200 | [diff] [blame] | 35 | parser.add_argument('-t', nargs='?',type = str, default="md", help="md,html") |
Christophe Favergeon | feb7393 | 2020-05-20 14:48:06 +0200 | [diff] [blame] | 36 | parser.add_argument('-byc', action='store_true', help="By Compiler") |
Christophe Favergeon | 670b167 | 2020-05-28 12:47:58 +0200 | [diff] [blame^] | 37 | parser.add_argument('-g', action='store_true', help="Include graphs in regression report") |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 38 | |
| 39 | # For runid or runid range |
Christophe Favergeon | 4fa1e23 | 2020-05-15 12:28:17 +0200 | [diff] [blame] | 40 | parser.add_argument('others', nargs=argparse.REMAINDER,help="Run ID") |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 41 | |
| 42 | args = parser.parse_args() |
| 43 | |
| 44 | c = sqlite3.connect(args.b) |
| 45 | |
| 46 | if args.others: |
Christophe Favergeon | 670b167 | 2020-05-28 12:47:58 +0200 | [diff] [blame^] | 47 | if len(args.others) == 1: |
| 48 | runid=int(args.others[0]) |
| 49 | runidval = (runid,) |
| 50 | else: |
| 51 | runidCMD = "runid >= ? AND runid <= ?" |
| 52 | runid=int(args.others[1]) |
| 53 | runidLOW=int(args.others[0]) |
| 54 | runidval = (runidLOW,runid) |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 55 | else: |
| 56 | runid=getLastRunID() |
Christophe Favergeon | 670b167 | 2020-05-28 12:47:58 +0200 | [diff] [blame^] | 57 | print("Last run ID = %d\n" % runid) |
| 58 | runidval=(runid,) |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 59 | |
| 60 | # We extract data only from data tables |
| 61 | # Those tables below are used for descriptions |
Christophe Favergeon | 4fa1e23 | 2020-05-15 12:28:17 +0200 | [diff] [blame] | 62 | REMOVETABLES=['TESTNAME','TESTDATE','RUN','CORE', 'PLATFORM', 'COMPILERKIND', 'COMPILER', 'TYPE', 'CATEGORY', 'CONFIG'] |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 63 | |
| 64 | # This is assuming the database is generated by the regression script |
| 65 | # So platform is the same for all benchmarks. |
| 66 | # Category and type is coming from the test name in the yaml |
| 67 | # So no need to add this information here |
| 68 | # Name is removed here because it is added at the beginning |
Christophe Favergeon | 4fa1e23 | 2020-05-15 12:28:17 +0200 | [diff] [blame] | 69 | REMOVECOLUMNS=['runid','name','type','platform','category','coredef','OPTIMIZED','HARDFP','FASTMATH','NEON','HELIUM','UNROLL','ROUNDING','DATE','compilerkindid','date','categoryid', 'ID', 'platformid', 'coreid', 'compilerid', 'typeid'] |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 70 | |
Christophe Favergeon | feb7393 | 2020-05-20 14:48:06 +0200 | [diff] [blame] | 71 | REMOVECOLUMNSFORHISTORY=['Regression','MAXREGCOEF','name','type','platform','category','coredef','OPTIMIZED','HARDFP','FASTMATH','NEON','HELIUM','UNROLL','ROUNDING','DATE','compilerkindid','date','categoryid', 'ID', 'platformid', 'coreid', 'compilerid', 'typeid'] |
| 72 | |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 73 | # Get existing benchmark tables |
| 74 | def getBenchTables(): |
| 75 | r=c.execute("SELECT name FROM sqlite_master WHERE type='table'") |
| 76 | benchtables=[] |
| 77 | for table in r: |
| 78 | if not table[0] in REMOVETABLES: |
| 79 | benchtables.append(table[0]) |
| 80 | return(benchtables) |
| 81 | |
| 82 | # get existing types in a table |
| 83 | def getExistingTypes(benchTable): |
Christophe Favergeon | e15894e | 2020-05-14 07:25:53 +0200 | [diff] [blame] | 84 | r=c.execute("select distinct typeid from %s order by typeid desc" % benchTable).fetchall() |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 85 | result=[x[0] for x in r] |
| 86 | return(result) |
| 87 | |
| 88 | # Get compilers from specific type and table |
Christophe Favergeon | 4fa1e23 | 2020-05-15 12:28:17 +0200 | [diff] [blame] | 89 | allCompilers="""select distinct compilerid from %s WHERE typeid=?""" |
| 90 | |
Christophe Favergeon | feb7393 | 2020-05-20 14:48:06 +0200 | [diff] [blame] | 91 | # Get compilers from specific type and table |
| 92 | allCores="""select distinct coreid from %s WHERE typeid=?""" |
| 93 | |
| 94 | |
Christophe Favergeon | 4fa1e23 | 2020-05-15 12:28:17 +0200 | [diff] [blame] | 95 | compilerDesc="""select compiler,version from COMPILER |
| 96 | INNER JOIN COMPILERKIND USING(compilerkindid) WHERE compilerid=?""" |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 97 | |
Christophe Favergeon | feb7393 | 2020-05-20 14:48:06 +0200 | [diff] [blame] | 98 | coreDesc="""select core from CORE WHERE coreid=?""" |
| 99 | |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 100 | # Get existing compiler in a table for a specific type |
| 101 | # (In case report is structured by types) |
| 102 | def getExistingCompiler(benchTable,typeid): |
Christophe Favergeon | 4fa1e23 | 2020-05-15 12:28:17 +0200 | [diff] [blame] | 103 | r=c.execute(allCompilers % benchTable,(typeid,)).fetchall() |
| 104 | return([x[0] for x in r]) |
| 105 | |
Christophe Favergeon | feb7393 | 2020-05-20 14:48:06 +0200 | [diff] [blame] | 106 | def getExistingCores(benchTable,typeid): |
| 107 | r=c.execute(allCores % benchTable,(typeid,)).fetchall() |
| 108 | return([x[0] for x in r]) |
| 109 | |
| 110 | |
| 111 | |
| 112 | def getCoreDesc(compilerid): |
| 113 | r=c.execute(coreDesc,(compilerid,)).fetchone() |
| 114 | return(r) |
| 115 | |
Christophe Favergeon | 4fa1e23 | 2020-05-15 12:28:17 +0200 | [diff] [blame] | 116 | def getCompilerDesc(compilerid): |
| 117 | r=c.execute(compilerDesc,(compilerid,)).fetchone() |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 118 | return(r) |
| 119 | |
| 120 | # Get type name from type id |
| 121 | def getTypeName(typeid): |
| 122 | r=c.execute("select type from TYPE where typeid=?",(typeid,)).fetchone() |
| 123 | return(r[0]) |
| 124 | |
| 125 | # Diff of 2 lists |
| 126 | def diff(first, second): |
| 127 | second = set(second) |
| 128 | return [item for item in first if item not in second] |
| 129 | |
| 130 | |
Christophe Favergeon | feb7393 | 2020-05-20 14:48:06 +0200 | [diff] [blame] | 131 | # Command to get data for specific core |
| 132 | # and type |
| 133 | historyCmd="""select %s from %s |
| 134 | INNER JOIN CATEGORY USING(categoryid) |
| 135 | INNER JOIN PLATFORM USING(platformid) |
| 136 | INNER JOIN CORE USING(coreid) |
| 137 | INNER JOIN COMPILER USING(compilerid) |
| 138 | INNER JOIN COMPILERKIND USING(compilerkindid) |
| 139 | INNER JOIN TYPE USING(typeid) |
| 140 | INNER JOIN TESTNAME USING(testnameid) |
| 141 | WHERE compilerid=? AND coreid=? AND typeid = ? AND ID = ? AND runid > (? - 10) |
| 142 | """ |
| 143 | |
| 144 | compilersForHistory="""select distinct compilerid,compiler,version from %s |
| 145 | INNER JOIN COMPILER USING(compilerid) |
| 146 | INNER JOIN COMPILERKIND USING(compilerkindid) |
| 147 | WHERE coreid=? AND typeid = ? AND ID = ? AND runid > (? - 10) |
| 148 | """ |
| 149 | |
| 150 | # Command to get data for specific core |
| 151 | # and type |
| 152 | benchCmdForCore="""select %s from %s |
| 153 | INNER JOIN CATEGORY USING(categoryid) |
| 154 | INNER JOIN PLATFORM USING(platformid) |
| 155 | INNER JOIN CORE USING(coreid) |
| 156 | INNER JOIN COMPILER USING(compilerid) |
| 157 | INNER JOIN COMPILERKIND USING(compilerkindid) |
| 158 | INNER JOIN TYPE USING(typeid) |
| 159 | INNER JOIN TESTNAME USING(testnameid) |
Christophe Favergeon | 670b167 | 2020-05-28 12:47:58 +0200 | [diff] [blame^] | 160 | WHERE coreid=? AND typeid = ? AND %s |
Christophe Favergeon | feb7393 | 2020-05-20 14:48:06 +0200 | [diff] [blame] | 161 | """ |
| 162 | |
| 163 | coresForHistory="""select distinct coreid,core from %s |
| 164 | INNER JOIN CORE USING(coreid) |
| 165 | WHERE compilerid=? AND typeid = ? AND ID = ? AND runid > (? - 10) |
| 166 | """ |
| 167 | |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 168 | # Command to get data for specific compiler |
| 169 | # and type |
Christophe Favergeon | feb7393 | 2020-05-20 14:48:06 +0200 | [diff] [blame] | 170 | benchCmdForCompiler="""select %s from %s |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 171 | INNER JOIN CATEGORY USING(categoryid) |
| 172 | INNER JOIN PLATFORM USING(platformid) |
| 173 | INNER JOIN CORE USING(coreid) |
| 174 | INNER JOIN COMPILER USING(compilerid) |
| 175 | INNER JOIN COMPILERKIND USING(compilerkindid) |
| 176 | INNER JOIN TYPE USING(typeid) |
Christophe Favergeon | 4fa1e23 | 2020-05-15 12:28:17 +0200 | [diff] [blame] | 177 | INNER JOIN TESTNAME USING(testnameid) |
Christophe Favergeon | 670b167 | 2020-05-28 12:47:58 +0200 | [diff] [blame^] | 178 | WHERE compilerid=? AND typeid = ? AND %s |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 179 | """ |
| 180 | |
| 181 | # Command to get test names for specific compiler |
| 182 | # and type |
Christophe Favergeon | feb7393 | 2020-05-20 14:48:06 +0200 | [diff] [blame] | 183 | benchNamesForCore="""select distinct ID,name from %s |
| 184 | INNER JOIN COMPILER USING(compilerid) |
| 185 | INNER JOIN COMPILERKIND USING(compilerkindid) |
| 186 | INNER JOIN TYPE USING(typeid) |
| 187 | INNER JOIN TESTNAME USING(testnameid) |
Christophe Favergeon | 670b167 | 2020-05-28 12:47:58 +0200 | [diff] [blame^] | 188 | WHERE coreid=? AND typeid = ? AND %s |
Christophe Favergeon | feb7393 | 2020-05-20 14:48:06 +0200 | [diff] [blame] | 189 | """ |
| 190 | # Command to get test names for specific compiler |
| 191 | # and type |
| 192 | benchNamesForCompiler="""select distinct ID,name from %s |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 193 | INNER JOIN COMPILER USING(compilerid) |
| 194 | INNER JOIN COMPILERKIND USING(compilerkindid) |
| 195 | INNER JOIN TYPE USING(typeid) |
Christophe Favergeon | 4fa1e23 | 2020-05-15 12:28:17 +0200 | [diff] [blame] | 196 | INNER JOIN TESTNAME USING(testnameid) |
Christophe Favergeon | 670b167 | 2020-05-28 12:47:58 +0200 | [diff] [blame^] | 197 | WHERE compilerid=? AND typeid = ? AND %s |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 198 | """ |
| 199 | |
| 200 | # Command to get columns for specific table |
| 201 | benchCmdColumns="""select * from %s |
| 202 | INNER JOIN CATEGORY USING(categoryid) |
| 203 | INNER JOIN PLATFORM USING(platformid) |
| 204 | INNER JOIN CORE USING(coreid) |
| 205 | INNER JOIN COMPILER USING(compilerid) |
| 206 | INNER JOIN COMPILERKIND USING(compilerkindid) |
Christophe Favergeon | 4fa1e23 | 2020-05-15 12:28:17 +0200 | [diff] [blame] | 207 | INNER JOIN TESTNAME USING(testnameid) |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 208 | INNER JOIN TYPE USING(typeid) |
| 209 | """ |
| 210 | |
| 211 | def joinit(iterable, delimiter): |
| 212 | it = iter(iterable) |
| 213 | yield next(it) |
| 214 | for x in it: |
| 215 | yield delimiter |
| 216 | yield x |
| 217 | |
| 218 | # Is not a column name finishing by id |
| 219 | # (often primary key for thetable) |
| 220 | def isNotIDColumn(col): |
| 221 | if re.match(r'^.*id$',col): |
| 222 | return(False) |
| 223 | else: |
| 224 | return(True) |
Christophe Favergeon | feb7393 | 2020-05-20 14:48:06 +0200 | [diff] [blame] | 225 | |
| 226 | # Get test names |
| 227 | # for specific typeid and core (for the data) |
| 228 | def getTestNamesForCore(benchTable,core,typeid): |
Christophe Favergeon | 670b167 | 2020-05-28 12:47:58 +0200 | [diff] [blame^] | 229 | vals=(core,typeid) + runidval |
| 230 | result=c.execute(benchNamesForCore % (benchTable,runidCMD),vals).fetchall() |
Christophe Favergeon | feb7393 | 2020-05-20 14:48:06 +0200 | [diff] [blame] | 231 | names=[(x[0],x[1]) for x in list(result)] |
| 232 | return(names) |
| 233 | |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 234 | # Get test names |
| 235 | # for specific typeid and compiler (for the data) |
Christophe Favergeon | feb7393 | 2020-05-20 14:48:06 +0200 | [diff] [blame] | 236 | def getTestNamesForCompiler(benchTable,comp,typeid): |
Christophe Favergeon | 670b167 | 2020-05-28 12:47:58 +0200 | [diff] [blame^] | 237 | vals=(comp,typeid) + runidval |
| 238 | result=c.execute(benchNamesForCompiler % (benchTable,runidCMD),vals).fetchall() |
Christophe Favergeon | feb7393 | 2020-05-20 14:48:06 +0200 | [diff] [blame] | 239 | names=[(x[0],x[1]) for x in list(result)] |
| 240 | return(names) |
| 241 | |
| 242 | # Command to get data for specific core |
| 243 | # and type |
| 244 | nbElemsInBenchAndTypeAndCoreCmd="""select count(*) from %s |
Christophe Favergeon | 670b167 | 2020-05-28 12:47:58 +0200 | [diff] [blame^] | 245 | WHERE coreid=? AND typeid = ? AND %s |
Christophe Favergeon | feb7393 | 2020-05-20 14:48:06 +0200 | [diff] [blame] | 246 | """ |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 247 | |
Christophe Favergeon | e15894e | 2020-05-14 07:25:53 +0200 | [diff] [blame] | 248 | # Command to get data for specific compiler |
| 249 | # and type |
| 250 | nbElemsInBenchAndTypeAndCompilerCmd="""select count(*) from %s |
Christophe Favergeon | 670b167 | 2020-05-28 12:47:58 +0200 | [diff] [blame^] | 251 | WHERE compilerid=? AND typeid = ? AND %s |
Christophe Favergeon | e15894e | 2020-05-14 07:25:53 +0200 | [diff] [blame] | 252 | """ |
| 253 | |
| 254 | nbElemsInBenchAndTypeCmd="""select count(*) from %s |
Christophe Favergeon | 670b167 | 2020-05-28 12:47:58 +0200 | [diff] [blame^] | 255 | WHERE typeid = ? AND %s |
Christophe Favergeon | e15894e | 2020-05-14 07:25:53 +0200 | [diff] [blame] | 256 | """ |
| 257 | |
| 258 | nbElemsInBenchCmd="""select count(*) from %s |
Christophe Favergeon | 670b167 | 2020-05-28 12:47:58 +0200 | [diff] [blame^] | 259 | WHERE %s |
Christophe Favergeon | e15894e | 2020-05-14 07:25:53 +0200 | [diff] [blame] | 260 | """ |
| 261 | |
Christophe Favergeon | 4fa1e23 | 2020-05-15 12:28:17 +0200 | [diff] [blame] | 262 | categoryName="""select distinct category from %s |
| 263 | INNER JOIN CATEGORY USING(categoryid) |
Christophe Favergeon | 670b167 | 2020-05-28 12:47:58 +0200 | [diff] [blame^] | 264 | WHERE %s |
Christophe Favergeon | 4fa1e23 | 2020-05-15 12:28:17 +0200 | [diff] [blame] | 265 | """ |
| 266 | |
| 267 | def getCategoryName(benchTable,runid): |
Christophe Favergeon | 670b167 | 2020-05-28 12:47:58 +0200 | [diff] [blame^] | 268 | result=c.execute(categoryName % (benchTable,runidCMD),runidval).fetchone() |
Christophe Favergeon | 4fa1e23 | 2020-05-15 12:28:17 +0200 | [diff] [blame] | 269 | return(result[0]) |
| 270 | |
Christophe Favergeon | 4f75070 | 2020-05-13 15:56:15 +0200 | [diff] [blame] | 271 | # Get nb elems in a table |
Christophe Favergeon | feb7393 | 2020-05-20 14:48:06 +0200 | [diff] [blame] | 272 | def getNbElemsInBenchAndTypeAndCoreCmd(benchTable,coreid,typeid): |
Christophe Favergeon | 670b167 | 2020-05-28 12:47:58 +0200 | [diff] [blame^] | 273 | vals=(coreid,typeid) + runidval |
| 274 | result=c.execute(nbElemsInBenchAndTypeAndCoreCmd % (benchTable,runidCMD),vals).fetchone() |
Christophe Favergeon | feb7393 | 2020-05-20 14:48:06 +0200 | [diff] [blame] | 275 | return(result[0]) |
| 276 | |
| 277 | # Get nb elems in a table |
Christophe Favergeon | e15894e | 2020-05-14 07:25:53 +0200 | [diff] [blame] | 278 | def getNbElemsInBenchAndTypeAndCompilerCmd(benchTable,comp,typeid): |
Christophe Favergeon | 670b167 | 2020-05-28 12:47:58 +0200 | [diff] [blame^] | 279 | vals=(comp,typeid) + runidval |
| 280 | result=c.execute(nbElemsInBenchAndTypeAndCompilerCmd % (benchTable,runidCMD),vals).fetchone() |
Christophe Favergeon | e15894e | 2020-05-14 07:25:53 +0200 | [diff] [blame] | 281 | return(result[0]) |
| 282 | |
| 283 | def getNbElemsInBenchAndTypeCmd(benchTable,typeid): |
Christophe Favergeon | 670b167 | 2020-05-28 12:47:58 +0200 | [diff] [blame^] | 284 | vals=(typeid,) + runidval |
| 285 | result=c.execute(nbElemsInBenchAndTypeCmd % (benchTable,runidCMD),vals).fetchone() |
Christophe Favergeon | e15894e | 2020-05-14 07:25:53 +0200 | [diff] [blame] | 286 | return(result[0]) |
| 287 | |
| 288 | def getNbElemsInBenchCmd(benchTable): |
Christophe Favergeon | 670b167 | 2020-05-28 12:47:58 +0200 | [diff] [blame^] | 289 | result=c.execute(nbElemsInBenchCmd % (benchTable,runidCMD),runidval).fetchone() |
Christophe Favergeon | 4f75070 | 2020-05-13 15:56:15 +0200 | [diff] [blame] | 290 | return(result[0]) |
| 291 | |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 292 | # Get names of columns and data for a table |
Christophe Favergeon | feb7393 | 2020-05-20 14:48:06 +0200 | [diff] [blame] | 293 | # for specific typeid and coreid (for the data) |
| 294 | def getColNamesAndHistory(benchTable,compiler,core,typeid,testid): |
| 295 | cursor=c.cursor() |
| 296 | result=cursor.execute(benchCmdColumns % (benchTable)) |
| 297 | cols= [member[0] for member in cursor.description] |
| 298 | keepCols = ['name','runid'] + [c for c in diff(cols , REMOVECOLUMNSFORHISTORY) if isNotIDColumn(c)] |
| 299 | keepColsStr = "".join(joinit(keepCols,",")) |
| 300 | vals=(compiler,core,typeid,testid,runid) |
| 301 | result=cursor.execute(historyCmd % (keepColsStr,benchTable),vals) |
| 302 | vals =np.array([list(x) for x in list(result)]) |
| 303 | return(keepCols,vals) |
| 304 | |
| 305 | # Get names of columns and data for a table |
| 306 | # for specific typeid and coreid (for the data) |
| 307 | def getColNamesAndDataForCore(benchTable,core,typeid): |
| 308 | cursor=c.cursor() |
| 309 | result=cursor.execute(benchCmdColumns % (benchTable)) |
| 310 | cols= [member[0] for member in cursor.description] |
| 311 | keepCols = ['name'] + [c for c in diff(cols , REMOVECOLUMNS) if isNotIDColumn(c)] |
| 312 | keepColsStr = "".join(joinit(keepCols,",")) |
Christophe Favergeon | 670b167 | 2020-05-28 12:47:58 +0200 | [diff] [blame^] | 313 | vals=(core,typeid) + runidval |
| 314 | result=cursor.execute(benchCmdForCore % (keepColsStr,benchTable,runidCMD),vals) |
Christophe Favergeon | feb7393 | 2020-05-20 14:48:06 +0200 | [diff] [blame] | 315 | vals =np.array([list(x) for x in list(result)]) |
| 316 | return(keepCols,vals) |
| 317 | |
| 318 | |
| 319 | # Get names of columns and data for a table |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 320 | # for specific typeid and compiler (for the data) |
Christophe Favergeon | feb7393 | 2020-05-20 14:48:06 +0200 | [diff] [blame] | 321 | def getColNamesAndDataForCompiler(benchTable,comp,typeid): |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 322 | cursor=c.cursor() |
| 323 | result=cursor.execute(benchCmdColumns % (benchTable)) |
| 324 | cols= [member[0] for member in cursor.description] |
Christophe Favergeon | 4fa1e23 | 2020-05-15 12:28:17 +0200 | [diff] [blame] | 325 | keepCols = ['name'] + [c for c in diff(cols , REMOVECOLUMNS) if isNotIDColumn(c)] |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 326 | keepColsStr = "".join(joinit(keepCols,",")) |
Christophe Favergeon | 670b167 | 2020-05-28 12:47:58 +0200 | [diff] [blame^] | 327 | vals=(comp,typeid) + runidval |
| 328 | result=cursor.execute(benchCmdForCompiler % (keepColsStr,benchTable,runidCMD),vals) |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 329 | vals =np.array([list(x) for x in list(result)]) |
| 330 | return(keepCols,vals) |
| 331 | |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 332 | |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 333 | |
| 334 | PARAMS=["NB","NumTaps", "NBA", "NBB", "Factor", "NumStages","VECDIM","NBR","NBC","NBI","IFFT", "BITREV"] |
| 335 | |
Christophe Favergeon | feb7393 | 2020-05-20 14:48:06 +0200 | [diff] [blame] | 336 | def regressionTableFor(byname,name,section,ref,toSort,indexCols,field): |
| 337 | data=ref.pivot_table(index=indexCols, columns=byname, |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 338 | values=[field], aggfunc='first') |
| 339 | |
| 340 | data=data.sort_values(toSort) |
| 341 | |
| 342 | cores = [c[1] for c in list(data.columns)] |
Christophe Favergeon | 4fa1e23 | 2020-05-15 12:28:17 +0200 | [diff] [blame] | 343 | columns = diff(indexCols,['name']) |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 344 | |
Christophe Favergeon | 34d313a | 2020-05-14 15:09:41 +0200 | [diff] [blame] | 345 | dataTable=Table(columns,cores) |
Christophe Favergeon | feb7393 | 2020-05-20 14:48:06 +0200 | [diff] [blame] | 346 | section.addContent(dataTable) |
Christophe Favergeon | c3f455c | 2020-05-14 09:24:07 +0200 | [diff] [blame] | 347 | |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 348 | dataForFunc=data.loc[name] |
| 349 | if type(dataForFunc) is pd.DataFrame: |
Christophe Favergeon | 0dcf9a1 | 2020-05-27 15:55:27 +0200 | [diff] [blame] | 350 | bars={'cols':columns,'cores':cores,'data':[]} |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 351 | for row in dataForFunc.itertuples(): |
| 352 | row=list(row) |
| 353 | if type(row[0]) is int: |
| 354 | row=[row[0]] + row[1:] |
| 355 | else: |
| 356 | row=list(row[0]) + row[1:] |
Christophe Favergeon | ed0eab8 | 2020-05-18 08:43:38 +0200 | [diff] [blame] | 357 | if field=="MAXREGCOEF": |
Christophe Favergeon | 670b167 | 2020-05-28 12:47:58 +0200 | [diff] [blame^] | 358 | newrow = row |
| 359 | newrow[len(columns):] = [("%.3f" % x) for x in row[len(columns):]] |
| 360 | row=newrow |
Christophe Favergeon | c3f455c | 2020-05-14 09:24:07 +0200 | [diff] [blame] | 361 | dataTable.addRow(row) |
Christophe Favergeon | 0dcf9a1 | 2020-05-27 15:55:27 +0200 | [diff] [blame] | 362 | bars['data'].append(row) |
| 363 | return(bars) |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 364 | else: |
Christophe Favergeon | ed0eab8 | 2020-05-18 08:43:38 +0200 | [diff] [blame] | 365 | if field=="MAXREGCOEF": |
| 366 | dataForFunc=[("%.3f" % x) for x in dataForFunc] |
Christophe Favergeon | c3f455c | 2020-05-14 09:24:07 +0200 | [diff] [blame] | 367 | dataTable.addRow(dataForFunc) |
Christophe Favergeon | feb7393 | 2020-05-20 14:48:06 +0200 | [diff] [blame] | 368 | return(list(zip(cores,dataForFunc))) |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 369 | |
Christophe Favergeon | feb7393 | 2020-05-20 14:48:06 +0200 | [diff] [blame] | 370 | def formatColumnName(c): |
| 371 | return("".join(joinit(c,":"))) |
| 372 | |
| 373 | def getCoresForHistory(benchTable,compilerid,typeid,testid,runid): |
| 374 | vals=(compilerid,typeid,testid,runid) |
| 375 | result=c.execute(coresForHistory % benchTable,vals).fetchall() |
| 376 | ids=[(x[0],x[1]) for x in list(result)] |
| 377 | return(ids) |
| 378 | |
| 379 | def getCompilerForHistory(benchTable,coreid,typeid,testid,runid): |
| 380 | vals=(coreid,typeid,testid,runid) |
| 381 | result=c.execute(compilersForHistory % benchTable,vals).fetchall() |
| 382 | ids=[(x[0],x[1],x[2]) for x in list(result)] |
| 383 | return(ids) |
| 384 | |
| 385 | def getHistory(desc,testid,indexCols): |
| 386 | benchName,sectionID,typeid,runid = desc |
| 387 | |
| 388 | #print(benchName) |
| 389 | #print(sectionID) |
| 390 | #print(typeid) |
| 391 | #print(testid) |
| 392 | columns = diff(indexCols,['name']) |
| 393 | #print(columns) |
| 394 | if args.byc: |
| 395 | coreid=sectionID |
| 396 | compilerids=getCompilerForHistory(benchName,coreid,typeid,testid,runid) |
| 397 | series={} |
| 398 | for compilerid,compilername,version in compilerids: |
| 399 | result=getColNamesAndHistory(benchName,compilerid,coreid,typeid,testid) |
| 400 | #print("%s:%s" % (compilername,version)) |
| 401 | maxpos = result[0].index('MAX') |
| 402 | lrunid = result[0].index('runid') |
| 403 | r=[[int(x[lrunid]),int(x[maxpos])] for x in result[1:][0]] |
| 404 | series[corename]=r |
| 405 | hist=History(series,runid) |
| 406 | return(hist) |
| 407 | else: |
| 408 | compilerid=sectionID |
| 409 | coreids = getCoresForHistory(benchName,compilerid,typeid,testid,runid) |
| 410 | series={} |
| 411 | for coreid,corename in coreids: |
| 412 | result=getColNamesAndHistory(benchName,compilerid,coreid,typeid,testid) |
| 413 | #print(corename) |
| 414 | maxpos = result[0].index('MAX') |
| 415 | corepos = result[0].index('core') |
| 416 | lrunid = result[0].index('runid') |
| 417 | r=[[int(x[lrunid]),int(x[maxpos])] for x in result[1:][0]] |
| 418 | series[corename]=r |
| 419 | hist=History(series,runid) |
| 420 | return(hist) |
| 421 | |
| 422 | def formatTableBy(desc,byname,section,typeSection,testNames,cols,vals): |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 423 | if vals.size != 0: |
| 424 | ref=pd.DataFrame(vals,columns=cols) |
Christophe Favergeon | 4fa1e23 | 2020-05-15 12:28:17 +0200 | [diff] [blame] | 425 | toSort=["name"] |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 426 | |
| 427 | for param in PARAMS: |
| 428 | if param in ref.columns: |
| 429 | ref[param]=pd.to_numeric(ref[param]) |
| 430 | toSort.append(param) |
| 431 | if args.r: |
| 432 | # Regression table |
| 433 | ref['MAX']=pd.to_numeric(ref['MAX']) |
| 434 | ref['MAXREGCOEF']=pd.to_numeric(ref['MAXREGCOEF']) |
| 435 | |
Christophe Favergeon | feb7393 | 2020-05-20 14:48:06 +0200 | [diff] [blame] | 436 | indexCols=diff(cols,byname + ['Regression','MAXREGCOEF','MAX'] + section) |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 437 | valList = ['Regression'] |
| 438 | else: |
| 439 | ref['CYCLES']=pd.to_numeric(ref['CYCLES']) |
| 440 | |
Christophe Favergeon | feb7393 | 2020-05-20 14:48:06 +0200 | [diff] [blame] | 441 | indexCols=diff(cols,byname + ['CYCLES'] + section) |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 442 | valList = ['CYCLES'] |
| 443 | |
| 444 | |
| 445 | |
Christophe Favergeon | feb7393 | 2020-05-20 14:48:06 +0200 | [diff] [blame] | 446 | for testid,name in testNames: |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 447 | if args.r: |
Christophe Favergeon | c3f455c | 2020-05-14 09:24:07 +0200 | [diff] [blame] | 448 | testSection = Section(name) |
| 449 | typeSection.addSection(testSection) |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 450 | |
Christophe Favergeon | c3f455c | 2020-05-14 09:24:07 +0200 | [diff] [blame] | 451 | maxCyclesSection = Section("Max cycles") |
| 452 | testSection.addSection(maxCyclesSection) |
Christophe Favergeon | feb7393 | 2020-05-20 14:48:06 +0200 | [diff] [blame] | 453 | theCycles=regressionTableFor(byname,name,maxCyclesSection,ref,toSort,indexCols,'MAX') |
Christophe Favergeon | 670b167 | 2020-05-28 12:47:58 +0200 | [diff] [blame^] | 454 | if args.g: |
| 455 | if type(theCycles) is dict: |
| 456 | nbParams=len(theCycles['cols']) |
| 457 | for bar in theCycles['data']: |
| 458 | params=bar[0:nbParams] |
| 459 | values=bar[nbParams:] |
| 460 | title=[("%s=%s" % x) for x in list(zip(theCycles['cols'],params))] |
| 461 | title="".join(joinit(title," ")) |
| 462 | sec=Section(title) |
| 463 | maxCyclesSection.addSection(sec) |
| 464 | values=list(zip(theCycles['cores'],values)) |
| 465 | barChart=BarChart(values) |
| 466 | sec.addContent(barChart) |
| 467 | else: |
| 468 | #print(theCycles) |
| 469 | sec=Section("Graph") |
Christophe Favergeon | 0dcf9a1 | 2020-05-27 15:55:27 +0200 | [diff] [blame] | 470 | maxCyclesSection.addSection(sec) |
Christophe Favergeon | 670b167 | 2020-05-28 12:47:58 +0200 | [diff] [blame^] | 471 | barChart=BarChart(theCycles) |
Christophe Favergeon | 0dcf9a1 | 2020-05-27 15:55:27 +0200 | [diff] [blame] | 472 | sec.addContent(barChart) |
Christophe Favergeon | feb7393 | 2020-05-20 14:48:06 +0200 | [diff] [blame] | 473 | |
Christophe Favergeon | 670b167 | 2020-05-28 12:47:58 +0200 | [diff] [blame^] | 474 | #history=getHistory(desc,testid,indexCols) |
| 475 | #testSection.addContent(history) |
Christophe Favergeon | feb7393 | 2020-05-20 14:48:06 +0200 | [diff] [blame] | 476 | |
| 477 | regressionSection = Section("Regression") |
| 478 | testSection.addSection(regressionSection) |
| 479 | regressionTableFor(byname,name,regressionSection,ref,toSort,indexCols,'Regression') |
| 480 | |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 481 | |
Christophe Favergeon | c3f455c | 2020-05-14 09:24:07 +0200 | [diff] [blame] | 482 | maxRegCoefSection = Section("Max Reg Coef") |
| 483 | testSection.addSection(maxRegCoefSection) |
Christophe Favergeon | feb7393 | 2020-05-20 14:48:06 +0200 | [diff] [blame] | 484 | regressionTableFor(byname,name,maxRegCoefSection,ref,toSort,indexCols,'MAXREGCOEF') |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 485 | |
| 486 | else: |
Christophe Favergeon | feb7393 | 2020-05-20 14:48:06 +0200 | [diff] [blame] | 487 | data=ref.pivot_table(index=indexCols, columns=byname, |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 488 | values=valList, aggfunc='first') |
| 489 | |
| 490 | data=data.sort_values(toSort) |
| 491 | |
Christophe Favergeon | feb7393 | 2020-05-20 14:48:06 +0200 | [diff] [blame] | 492 | #print(list(data.columns)) |
| 493 | columnsID = [formatColumnName(c[1:]) for c in list(data.columns)] |
Christophe Favergeon | 4fa1e23 | 2020-05-15 12:28:17 +0200 | [diff] [blame] | 494 | columns = diff(indexCols,['name']) |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 495 | |
Christophe Favergeon | c3f455c | 2020-05-14 09:24:07 +0200 | [diff] [blame] | 496 | testSection = Section(name) |
| 497 | typeSection.addSection(testSection) |
| 498 | |
Christophe Favergeon | feb7393 | 2020-05-20 14:48:06 +0200 | [diff] [blame] | 499 | dataTable=Table(columns,columnsID) |
| 500 | testSection.addContent(dataTable) |
Christophe Favergeon | c3f455c | 2020-05-14 09:24:07 +0200 | [diff] [blame] | 501 | |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 502 | dataForFunc=data.loc[name] |
| 503 | if type(dataForFunc) is pd.DataFrame: |
| 504 | for row in dataForFunc.itertuples(): |
| 505 | row=list(row) |
| 506 | if type(row[0]) is int: |
| 507 | row=[row[0]] + row[1:] |
| 508 | else: |
| 509 | row=list(row[0]) + row[1:] |
Christophe Favergeon | c3f455c | 2020-05-14 09:24:07 +0200 | [diff] [blame] | 510 | dataTable.addRow(row) |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 511 | else: |
Christophe Favergeon | c3f455c | 2020-05-14 09:24:07 +0200 | [diff] [blame] | 512 | dataTable.addRow(dataForFunc) |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 513 | |
| 514 | # Add a report for each table |
Christophe Favergeon | ed0eab8 | 2020-05-18 08:43:38 +0200 | [diff] [blame] | 515 | def addReportFor(document,runid,benchName): |
Christophe Favergeon | e15894e | 2020-05-14 07:25:53 +0200 | [diff] [blame] | 516 | nbElems = getNbElemsInBenchCmd(benchName) |
| 517 | if nbElems > 0: |
Christophe Favergeon | ed0eab8 | 2020-05-18 08:43:38 +0200 | [diff] [blame] | 518 | categoryName = getCategoryName(benchName,runid) |
Christophe Favergeon | 4fa1e23 | 2020-05-15 12:28:17 +0200 | [diff] [blame] | 519 | benchSection = Section(categoryName) |
Christophe Favergeon | c3f455c | 2020-05-14 09:24:07 +0200 | [diff] [blame] | 520 | document.addSection(benchSection) |
Christophe Favergeon | e15894e | 2020-05-14 07:25:53 +0200 | [diff] [blame] | 521 | print("Process %s\n" % benchName) |
Christophe Favergeon | e15894e | 2020-05-14 07:25:53 +0200 | [diff] [blame] | 522 | allTypes = getExistingTypes(benchName) |
| 523 | # Add report for each type |
| 524 | for aTypeID in allTypes: |
| 525 | nbElems = getNbElemsInBenchAndTypeCmd(benchName,aTypeID) |
| 526 | if nbElems > 0: |
| 527 | typeName = getTypeName(aTypeID) |
Christophe Favergeon | c3f455c | 2020-05-14 09:24:07 +0200 | [diff] [blame] | 528 | typeSection = Section(typeName) |
| 529 | benchSection.addSection(typeSection) |
Christophe Favergeon | feb7393 | 2020-05-20 14:48:06 +0200 | [diff] [blame] | 530 | if args.byc: |
| 531 | ## Add report for each core |
| 532 | allCores = getExistingCores(benchName,aTypeID) |
| 533 | for core in allCores: |
| 534 | #print(core) |
| 535 | nbElems = getNbElemsInBenchAndTypeAndCoreCmd(benchName,core,aTypeID) |
| 536 | # Print test results for table, type, compiler |
| 537 | if nbElems > 0: |
| 538 | coreName=getCoreDesc(core) |
| 539 | coreSection = Section("%s" % coreName) |
| 540 | typeSection.addSection(coreSection) |
| 541 | cols,vals=getColNamesAndDataForCore(benchName,core,aTypeID) |
| 542 | desc=(benchName,core,aTypeID,runid) |
| 543 | names=getTestNamesForCore(benchName,core,aTypeID) |
| 544 | formatTableBy(desc,['compiler','version'],['core'],coreSection,names,cols,vals) |
| 545 | else: |
| 546 | ## Add report for each compiler |
| 547 | allCompilers = getExistingCompiler(benchName,aTypeID) |
| 548 | for compiler in allCompilers: |
| 549 | #print(compiler) |
| 550 | nbElems = getNbElemsInBenchAndTypeAndCompilerCmd(benchName,compiler,aTypeID) |
| 551 | # Print test results for table, type, compiler |
| 552 | if nbElems > 0: |
| 553 | compilerName,version=getCompilerDesc(compiler) |
| 554 | compilerSection = Section("%s (%s)" % (compilerName,version)) |
| 555 | typeSection.addSection(compilerSection) |
| 556 | cols,vals=getColNamesAndDataForCompiler(benchName,compiler,aTypeID) |
| 557 | desc=(benchName,compiler,aTypeID,runid) |
| 558 | names=getTestNamesForCompiler(benchName,compiler,aTypeID) |
| 559 | formatTableBy(desc,['core'],['version','compiler'],compilerSection,names,cols,vals) |
| 560 | |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 561 | |
| 562 | |
| 563 | |
Christophe Favergeon | ed0eab8 | 2020-05-18 08:43:38 +0200 | [diff] [blame] | 564 | toc=[Hierarchy("BasicMathsBenchmarks"), |
| 565 | Hierarchy("ComplexMathsBenchmarks"), |
| 566 | Hierarchy("FastMath"), |
| 567 | Hierarchy("Filters", |
| 568 | [Hierarchy("FIR"), |
| 569 | Hierarchy("BIQUAD"), |
| 570 | Hierarchy("DECIM"), |
| 571 | Hierarchy("MISC")]), |
| 572 | |
| 573 | Hierarchy("Support Functions", |
| 574 | [Hierarchy("Support"), |
| 575 | Hierarchy("SupportBar")]), |
| 576 | |
| 577 | Hierarchy("Matrix Operations" , |
| 578 | [Hierarchy("Binary"), |
| 579 | Hierarchy("Unary")]), |
| 580 | Hierarchy("Transform"), |
| 581 | |
| 582 | ] |
| 583 | |
| 584 | processed=[] |
| 585 | |
| 586 | def createDoc(document,sections,benchtables): |
| 587 | global processed |
| 588 | for s in sections: |
| 589 | if s.name in benchtables: |
| 590 | addReportFor(document,runid,s.name) |
| 591 | processed.append(s.name) |
| 592 | else: |
| 593 | section=Section(s.name) |
| 594 | document.addSection(section) |
| 595 | createDoc(section,s.sections,benchtables) |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 596 | |
| 597 | try: |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 598 | benchtables=getBenchTables() |
Christophe Favergeon | e15894e | 2020-05-14 07:25:53 +0200 | [diff] [blame] | 599 | theDate = getrunIDDate(runid) |
Christophe Favergeon | c3f455c | 2020-05-14 09:24:07 +0200 | [diff] [blame] | 600 | document = Document(runid,theDate) |
Christophe Favergeon | ed0eab8 | 2020-05-18 08:43:38 +0200 | [diff] [blame] | 601 | createDoc(document,toc,benchtables) |
| 602 | misc=Section("Miscellaneous") |
| 603 | document.addSection(misc) |
| 604 | remaining=diff(benchtables,processed) |
| 605 | for bench in remaining: |
| 606 | addReportFor(misc,runid,bench) |
| 607 | |
| 608 | #for bench in benchtables: |
| 609 | # addReportFor(document,bench) |
Christophe Favergeon | c3f455c | 2020-05-14 09:24:07 +0200 | [diff] [blame] | 610 | with open(args.o,"w") as output: |
| 611 | if args.t=="md": |
| 612 | document.accept(Markdown(output)) |
| 613 | if args.t=="html": |
Christophe Favergeon | 4fa1e23 | 2020-05-15 12:28:17 +0200 | [diff] [blame] | 614 | document.accept(HTML(output,args.r)) |
Christophe Favergeon | c3f455c | 2020-05-14 09:24:07 +0200 | [diff] [blame] | 615 | |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 616 | finally: |
| 617 | c.close() |
| 618 | |
Christophe Favergeon | c3f455c | 2020-05-14 09:24:07 +0200 | [diff] [blame] | 619 | |
| 620 | |
Christophe Favergeon | 8cb3730 | 2020-05-13 13:06:58 +0200 | [diff] [blame] | 621 | |