diff --git a/openmp/runtime/tools/summarizeStats.py b/openmp/runtime/tools/summarizeStats.py --- a/openmp/runtime/tools/summarizeStats.py +++ b/openmp/runtime/tools/summarizeStats.py @@ -37,7 +37,7 @@ frame_dict = {'polygon': draw_poly_frame, 'circle': draw_circle_frame} if frame not in frame_dict: - raise ValueError, 'unknown value for `frame`: %s' % frame + raise ValueError('unknown value for `frame`: %s' % frame) class RadarAxes(PolarAxes): """ @@ -143,7 +143,7 @@ res["counters"] = readCounters(f) return res except (OSError, IOError): - print "Cannot open " + fname + print("Cannot open " + fname) return None def usefulValues(l): @@ -235,7 +235,7 @@ compKeys[key] = data[key] else: nonCompKeys[key] = data[key] - print "comp keys:", compKeys, "\n\n non comp keys:", nonCompKeys + print("comp keys:", compKeys, "\n\n non comp keys:", nonCompKeys) return [compKeys, nonCompKeys] def drawMainPie(data, filebase, colors): @@ -250,8 +250,8 @@ def drawSubPie(data, tag, filebase, colors): explode = [] - labels = data.keys() - sizes = data.values() + labels = list(data.keys()) + sizes = list(data.values()) total = sum(sizes) percent = [] for i in range(len(sizes)): @@ -295,13 +295,13 @@ normalizeValues(tmp["counters"], "SampleCount", elapsedTime / 1.e9) """Plotting radar charts""" - params = setRadarFigure(data.keys()) + params = setRadarFigure(list(data.keys())) chartType = "radar" drawRadarChart(data, s, filebase, params, colors[n]) """radar Charts finish here""" plt.savefig(filebase+"_"+s+"_"+chartType, bbox_inches='tight') elif s == 'timers': - print "overheads in "+filebase + print("overheads in "+filebase) numThreads = tmp[s]['SampleCount']['Total_OMP_parallel'] for key in data.keys(): if key[0:5] == 'Total': @@ -315,7 +315,7 @@ drawSubPie(dataSubSet[1], "Non Computational Time", filebase, colors) with open('derivedStats_{}.csv'.format(filebase), 'w') as f: f.write('================={}====================\n'.format(filebase)) - f.write(pd.DataFrame(stats[filebase].items()).to_csv()+'\n') + f.write(pd.DataFrame(list(stats[filebase].items())).to_csv()+'\n') n += 1 plt.close()