# HG changeset patch # User Nina Engelhardt # Date 1331319759 -3600 # Node ID b77d4ace3619b6be43681d4d92cae3f4a1b59bf0 # Parent c946cba3fda00105bcb8425665989330e5f7db0b make stats treatment general for any number of cores diff -r c946cba3fda0 -r b77d4ace3619 scripts/ucc_and_loop_graph_treatment/column_view.py --- a/scripts/ucc_and_loop_graph_treatment/column_view.py Thu Mar 08 18:52:19 2012 +0100 +++ b/scripts/ucc_and_loop_graph_treatment/column_view.py Fri Mar 09 20:02:39 2012 +0100 @@ -29,10 +29,11 @@ else: raise NameError('Node insufficiently annotated') y2 = y1 + graph.node[node]['weight'] - if positioning != None and node[0]>7: - f='blue' - elif node[0]>7: - f='red' + if node[0]>= 2*graph.node['start']['numcores']: + if positioning != None: + f='blue' + else: + f='red' else: f='gray' r = sf.Rect(x1,y1,x2,y2,fill=f) @@ -53,7 +54,7 @@ y2 = graph.node[node]['Timestamp_end'] - tscstarttime else: y2 = y1 + graph.node[node]['weight'] - if node[0]>7: + if node[0]>=2*graph.node['start']['numcores']: f='yellow' else: f='gray' diff -r c946cba3fda0 -r b77d4ace3619 scripts/ucc_and_loop_graph_treatment/parse_loop_graph.py --- a/scripts/ucc_and_loop_graph_treatment/parse_loop_graph.py Thu Mar 08 18:52:19 2012 +0100 +++ b/scripts/ucc_and_loop_graph_treatment/parse_loop_graph.py Fri Mar 09 20:02:39 2012 +0100 @@ -70,6 +70,7 @@ starttimes = {} tscstarttimes = {} tscendtimes = {} + highestcore = 0 for n in g: try: if n!="start" and n!="end": @@ -101,12 +102,15 @@ if g.node[n].has_key('Timestamp_start'): if not tscendtimes.has_key(g.node[n]['core']) or tscendtimes[g.node[n]['core']] < g.node[n]['Timestamp_start']: tscendtimes[g.node[n]['core']] = g.node[n]['Timestamp_start'] + if g.node[n].has_key('core') and g.node[n]['core'] > highestcore: + highestcore = g.node[n]['core'] except Exception as e: print e,n g.node['start']['starttimes']=starttimes g.node['start']['tscstarttimes']=tscstarttimes g.node['start']['tscstarttime']=min(tscstarttimes.values()) g.node['start']['tscendtime']=max(tscendtimes.values()) + g.node['start']['numcores']=highestcore+1 def path_length(graph,path): length = 0 @@ -199,8 +203,8 @@ print "(Difference:", dif, "- Relative Error:", 100*float(dif)/float(lend['end']),"%)" print g.node['start']['starttimes'] print g.node['start']['tscstarttimes'] - column_view.save_column_view(g,4,max(actual_time,lend['end']),lend) - #column_view.save_tsc_scale(g,4,lend['end']) + column_view.save_column_view(g,g.node['start']['numcores'],max(actual_time,lend['end']),lend) + #column_view.save_tsc_scale(g,g.node['start']['numcores'],lend['end']) return # print "Node \tCalculated\t Actual\tCore\tDifference\tNon-cumulative part" drf = 0