MCPcopy Create free account
hub / github.com/clMathLibraries/clBLAS / plotFromDataFile

Function plotFromDataFile

src/scripts/perf/plotPerformance.py:68–244  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

66
67######## plotFromDataFile() Function to plot from data file begins ########
68def plotFromDataFile():
69 data = []
70 """
71 read in table(s) from file(s)
72 """
73 for thisFile in args.datafile:
74 if not os.path.isfile(thisFile):
75 print 'No file with the name \'{}\' exists. Please indicate another filename.'.format(thisFile)
76 quit()
77
78 results = open(thisFile, 'r')
79 results_contents = results.read()
80 results_contents = results_contents.rstrip().split('\n')
81
82 firstRow = results_contents.pop(0)
83 print firstRow
84 print blas_table_header()
85 print firstRow.rstrip()==blas_table_header()
86 if firstRow.rstrip() != blas_table_header():
87 print 'ERROR: input file \'{}\' does not match expected format.'.format(thisFile)
88 quit()
89
90 for row in results_contents:
91 row = row.split(',')
92 row = TableRow(BlasTestCombination(row[0],row[1],row[2],row[3],row[4],row[5],row[6],row[7],row[8],row[9],row[10],row[11],row[12],row[13],row[14], row[15], row[16], row[17][1:], row[17][0], row[18], row[19], row[20]), row[21])
93 data.append(BlasGraphPoint(row.parameters.sizem, row.parameters.sizen, row.parameters.sizek, row.parameters.lda, row.parameters.ldb, row.parameters.ldc, row.parameters.offa , row.parameters.offb , row.parameters.offc , row.parameters.device, row.parameters.order, row.parameters.transa, row.parameters.transb, row.parameters.precision + row.parameters.function, row.parameters.library, row.parameters.label, row.gflops))
94
95 """
96 data sanity check
97 """
98 # if multiple plotvalues have > 1 value among the data rows, the user must specify which to plot
99 multiplePlotValues = []
100 for option in plotvalues:
101 values = []
102 for point in data:
103 values.append(getattr(point, option))
104 multiplePlotValues.append(len(set(values)) > 1)
105 if multiplePlotValues.count(True) > 1 and args.plot == None:
106 print 'ERROR: more than one parameter of {} has multiple values. Please specify which parameter to plot with --plot'.format(plotvalues)
107 quit()
108
109 # if args.graphxaxis is not 'problemsize', the user should know that the results might be strange
110 #if args.graphxaxis != 'problemsize':
111 # xaxisvalueSet = []
112 # for option in xaxisvalues:
113 # if option != 'problemsize':
114 # values = []
115 # for point in data:
116 # values.append(getattr(point, option))
117 # xaxisvalueSet.append(len(set(values)) > 1)
118 # if xaxisvalueSet.count(True) > 1:
119 # print 'WARNING: more than one parameter of {} is varied. unexpected results may occur. please double check your graphs for accuracy.'.format(xaxisvalues)
120
121 # multiple rows should not have the same input values
122 #pointInputs = []
123 #for point in data:
124 # pointInputs.append(point.__str__().split(';')[0])
125 #if len(set(pointInputs)) != len(data):

Callers 1

plotPerformance.pyFile · 0.85

Calls 5

blas_table_headerFunction · 0.85
TableRowClass · 0.85
BlasTestCombinationClass · 0.85
BlasGraphPointClass · 0.85
DataForOnePlotClass · 0.85

Tested by

no test coverage detected