|
|
|
@ -8,10 +8,17 @@ import numpy as np
|
|
|
|
lastID="""SELECT runid FROM RUN ORDER BY runid DESC LIMIT 1
|
|
|
|
lastID="""SELECT runid FROM RUN ORDER BY runid DESC LIMIT 1
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Command to get last runid and date
|
|
|
|
|
|
|
|
lastIDAndDate="""SELECT date FROM RUN WHERE runid=?
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
def getLastRunID():
|
|
|
|
def getLastRunID():
|
|
|
|
r=c.execute(lastID)
|
|
|
|
r=c.execute(lastID)
|
|
|
|
return(int(r.fetchone()[0]))
|
|
|
|
return(int(r.fetchone()[0]))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def getrunIDDate(forID):
|
|
|
|
|
|
|
|
r=c.execute(lastIDAndDate,(forID,))
|
|
|
|
|
|
|
|
return(r.fetchone()[0])
|
|
|
|
|
|
|
|
|
|
|
|
runid = 1
|
|
|
|
runid = 1
|
|
|
|
|
|
|
|
|
|
|
|
@ -55,7 +62,7 @@ def getBenchTables():
|
|
|
|
|
|
|
|
|
|
|
|
# get existing types in a table
|
|
|
|
# get existing types in a table
|
|
|
|
def getExistingTypes(benchTable):
|
|
|
|
def getExistingTypes(benchTable):
|
|
|
|
r=c.execute("select distinct typeid from %s" % benchTable).fetchall()
|
|
|
|
r=c.execute("select distinct typeid from %s order by typeid desc" % benchTable).fetchall()
|
|
|
|
result=[x[0] for x in r]
|
|
|
|
result=[x[0] for x in r]
|
|
|
|
return(result)
|
|
|
|
return(result)
|
|
|
|
|
|
|
|
|
|
|
|
@ -93,17 +100,6 @@ benchCmd="""select %s from %s
|
|
|
|
WHERE compiler=? AND VERSION=? AND typeid = ? AND runid = ?
|
|
|
|
WHERE compiler=? AND VERSION=? AND typeid = ? AND runid = ?
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
# Command to get data for specific compiler
|
|
|
|
|
|
|
|
# and type
|
|
|
|
|
|
|
|
nbElemsCmd="""select count(*) from %s
|
|
|
|
|
|
|
|
INNER JOIN CATEGORY USING(categoryid)
|
|
|
|
|
|
|
|
INNER JOIN PLATFORM USING(platformid)
|
|
|
|
|
|
|
|
INNER JOIN CORE USING(coreid)
|
|
|
|
|
|
|
|
INNER JOIN COMPILER USING(compilerid)
|
|
|
|
|
|
|
|
INNER JOIN COMPILERKIND USING(compilerkindid)
|
|
|
|
|
|
|
|
INNER JOIN TYPE USING(typeid)
|
|
|
|
|
|
|
|
WHERE compiler=? AND VERSION=? AND typeid = ? AND runid = ?
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Command to get test names for specific compiler
|
|
|
|
# Command to get test names for specific compiler
|
|
|
|
# and type
|
|
|
|
# and type
|
|
|
|
@ -146,10 +142,52 @@ def getTestNames(benchTable,comp,typeid):
|
|
|
|
result=c.execute(benchNames % benchTable,vals).fetchall()
|
|
|
|
result=c.execute(benchNames % benchTable,vals).fetchall()
|
|
|
|
return([x[0] for x in list(result)])
|
|
|
|
return([x[0] for x in list(result)])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Command to get data for specific compiler
|
|
|
|
|
|
|
|
# and type
|
|
|
|
|
|
|
|
nbElemsInBenchAndTypeAndCompilerCmd="""select count(*) from %s
|
|
|
|
|
|
|
|
INNER JOIN CATEGORY USING(categoryid)
|
|
|
|
|
|
|
|
INNER JOIN PLATFORM USING(platformid)
|
|
|
|
|
|
|
|
INNER JOIN CORE USING(coreid)
|
|
|
|
|
|
|
|
INNER JOIN COMPILER USING(compilerid)
|
|
|
|
|
|
|
|
INNER JOIN COMPILERKIND USING(compilerkindid)
|
|
|
|
|
|
|
|
INNER JOIN TYPE USING(typeid)
|
|
|
|
|
|
|
|
WHERE compiler=? AND VERSION=? AND typeid = ? AND runid = ?
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nbElemsInBenchAndTypeCmd="""select count(*) from %s
|
|
|
|
|
|
|
|
INNER JOIN CATEGORY USING(categoryid)
|
|
|
|
|
|
|
|
INNER JOIN PLATFORM USING(platformid)
|
|
|
|
|
|
|
|
INNER JOIN CORE USING(coreid)
|
|
|
|
|
|
|
|
INNER JOIN COMPILER USING(compilerid)
|
|
|
|
|
|
|
|
INNER JOIN COMPILERKIND USING(compilerkindid)
|
|
|
|
|
|
|
|
INNER JOIN TYPE USING(typeid)
|
|
|
|
|
|
|
|
WHERE typeid = ? AND runid = ?
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nbElemsInBenchCmd="""select count(*) from %s
|
|
|
|
|
|
|
|
INNER JOIN CATEGORY USING(categoryid)
|
|
|
|
|
|
|
|
INNER JOIN PLATFORM USING(platformid)
|
|
|
|
|
|
|
|
INNER JOIN CORE USING(coreid)
|
|
|
|
|
|
|
|
INNER JOIN COMPILER USING(compilerid)
|
|
|
|
|
|
|
|
INNER JOIN COMPILERKIND USING(compilerkindid)
|
|
|
|
|
|
|
|
INNER JOIN TYPE USING(typeid)
|
|
|
|
|
|
|
|
WHERE runid = ?
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
# Get nb elems in a table
|
|
|
|
# Get nb elems in a table
|
|
|
|
def getNbElems(benchTable,comp,typeid):
|
|
|
|
def getNbElemsInBenchAndTypeAndCompilerCmd(benchTable,comp,typeid):
|
|
|
|
vals=(comp[0],comp[1],typeid,runid)
|
|
|
|
vals=(comp[0],comp[1],typeid,runid)
|
|
|
|
result=c.execute(nbElemsCmd % benchTable,vals).fetchone()
|
|
|
|
result=c.execute(nbElemsInBenchAndTypeAndCompilerCmd % benchTable,vals).fetchone()
|
|
|
|
|
|
|
|
return(result[0])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def getNbElemsInBenchAndTypeCmd(benchTable,typeid):
|
|
|
|
|
|
|
|
vals=(typeid,runid)
|
|
|
|
|
|
|
|
result=c.execute(nbElemsInBenchAndTypeCmd % benchTable,vals).fetchone()
|
|
|
|
|
|
|
|
return(result[0])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def getNbElemsInBenchCmd(benchTable):
|
|
|
|
|
|
|
|
vals=(runid,)
|
|
|
|
|
|
|
|
result=c.execute(nbElemsInBenchCmd % benchTable,vals).fetchone()
|
|
|
|
return(result[0])
|
|
|
|
return(result[0])
|
|
|
|
|
|
|
|
|
|
|
|
# Get names of columns and data for a table
|
|
|
|
# Get names of columns and data for a table
|
|
|
|
@ -270,24 +308,28 @@ def formatTableByCore(output,testNames,cols,vals):
|
|
|
|
|
|
|
|
|
|
|
|
# Add a report for each table
|
|
|
|
# Add a report for each table
|
|
|
|
def addReportFor(output,benchName):
|
|
|
|
def addReportFor(output,benchName):
|
|
|
|
print("Process %s\n" % benchName)
|
|
|
|
nbElems = getNbElemsInBenchCmd(benchName)
|
|
|
|
output.write("# %s\n" % benchName)
|
|
|
|
if nbElems > 0:
|
|
|
|
allTypes = getExistingTypes(benchName)
|
|
|
|
print("Process %s\n" % benchName)
|
|
|
|
# Add report for each type
|
|
|
|
output.write("# %s\n" % benchName)
|
|
|
|
for aTypeID in allTypes:
|
|
|
|
allTypes = getExistingTypes(benchName)
|
|
|
|
typeName = getTypeName(aTypeID)
|
|
|
|
# Add report for each type
|
|
|
|
output.write("## %s\n" % typeName)
|
|
|
|
for aTypeID in allTypes:
|
|
|
|
## Add report for each compiler
|
|
|
|
nbElems = getNbElemsInBenchAndTypeCmd(benchName,aTypeID)
|
|
|
|
allCompilers = getExistingCompiler(benchName,aTypeID)
|
|
|
|
if nbElems > 0:
|
|
|
|
for compiler in allCompilers:
|
|
|
|
typeName = getTypeName(aTypeID)
|
|
|
|
#print(compiler)
|
|
|
|
output.write("## %s\n" % typeName)
|
|
|
|
nbElems = getNbElems(benchName,compiler,aTypeID)
|
|
|
|
## Add report for each compiler
|
|
|
|
# Print test results for table, type, compiler
|
|
|
|
allCompilers = getExistingCompiler(benchName,aTypeID)
|
|
|
|
if nbElems > 0:
|
|
|
|
for compiler in allCompilers:
|
|
|
|
output.write("### %s (%s)\n" % compiler)
|
|
|
|
#print(compiler)
|
|
|
|
cols,vals=getColNamesAndData(benchName,compiler,aTypeID)
|
|
|
|
nbElems = getNbElemsInBenchAndTypeAndCompilerCmd(benchName,compiler,aTypeID)
|
|
|
|
names=getTestNames(benchName,compiler,aTypeID)
|
|
|
|
# Print test results for table, type, compiler
|
|
|
|
formatTableByCore(output,names,cols,vals)
|
|
|
|
if nbElems > 0:
|
|
|
|
|
|
|
|
output.write("### %s (%s)\n" % compiler)
|
|
|
|
|
|
|
|
cols,vals=getColNamesAndData(benchName,compiler,aTypeID)
|
|
|
|
|
|
|
|
names=getTestNames(benchName,compiler,aTypeID)
|
|
|
|
|
|
|
|
formatTableByCore(output,names,cols,vals)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -296,6 +338,8 @@ def addReportFor(output,benchName):
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
with open(args.o,"w") as output:
|
|
|
|
with open(args.o,"w") as output:
|
|
|
|
benchtables=getBenchTables()
|
|
|
|
benchtables=getBenchTables()
|
|
|
|
|
|
|
|
theDate = getrunIDDate(runid)
|
|
|
|
|
|
|
|
output.write("Run number %d on %s\n" % (runid, str(theDate)))
|
|
|
|
for bench in benchtables:
|
|
|
|
for bench in benchtables:
|
|
|
|
addReportFor(output,bench)
|
|
|
|
addReportFor(output,bench)
|
|
|
|
finally:
|
|
|
|
finally:
|
|
|
|
|