VMS/2__runs_and_data

changeset 27:2ef6476f3628 tip

movie
author Nina Engelhardt <nengel@mailbox.tu-berlin.de>
date Fri, 01 Feb 2013 18:17:21 +0100
parents 3adfef46f3a7
children
files scripts/ucc_and_loop_graph_treatment/column_view.py scripts/ucc_and_loop_graph_treatment/parse_loop_graph.py scripts/ucc_and_loop_graph_treatment/parse_ucc.py
diffstat 3 files changed, 25 insertions(+), 15 deletions(-) [+]
line diff
     1.1 --- a/scripts/ucc_and_loop_graph_treatment/column_view.py	Fri Aug 31 18:21:25 2012 +0200
     1.2 +++ b/scripts/ucc_and_loop_graph_treatment/column_view.py	Fri Feb 01 18:17:21 2013 +0100
     1.3 @@ -9,10 +9,10 @@
     1.4  
     1.5  __num_idle = 0 #graph.node['start']['numcores'] * 2
     1.6  
     1.7 -__vertical_scale_factor = 0.000001 #10000.0/float(total_height)
     1.8 +__vertical_scale_factor = 0.00001 #10000.0/float(total_height)
     1.9  
    1.10 -__cache_miss_min = 0.0002
    1.11 -__cache_miss_max = 0.0007
    1.12 +__cache_miss_min = 0.001
    1.13 +__cache_miss_max = 0.003
    1.14  ### saving ###
    1.15  
    1.16  def save_computed_column_view(graph,num_cores,total_height,positioning,dependencies=None,filename=None):
     2.1 --- a/scripts/ucc_and_loop_graph_treatment/parse_loop_graph.py	Fri Aug 31 18:21:25 2012 +0200
     2.2 +++ b/scripts/ucc_and_loop_graph_treatment/parse_loop_graph.py	Fri Feb 01 18:17:21 2013 +0100
     2.3 @@ -49,7 +49,11 @@
     2.4  			print "(Difference:", dif, "- Relative Error:", 100*float(dif)/float(lend['end']),"%)"
     2.5  			#print g.node['start']['starttimes']
     2.6  			#print g.node['start']['tscstarttimes']
     2.7 -			column_view.save_computed_column_view(g,g.node['start']['numcores'],lend['end'],lend,[d["commDep"], d["dataDep"], d["ctlDep"]],"{0}.svg".format(sys.argv[1]))
     2.8 +			filteredDeps = []
     2.9 +			for key in ["commDep","dataDep","ctlDep"]:
    2.10 +				if d.has_key(key):
    2.11 +					filteredDeps.append(d[key])
    2.12 +			column_view.save_computed_column_view(g,g.node['start']['numcores'],lend['end'],lend,filteredDeps,"{0}.svg".format(sys.argv[1]))
    2.13  			#column_view.save_comparative_column_view(g,g.node['start']['numcores'],max(actual_time,lend['end']),lend)
    2.14  			#column_view.save_tsc_scale(g,g.node['start']['numcores'],lend['end'])
    2.15  			return #
     3.1 --- a/scripts/ucc_and_loop_graph_treatment/parse_ucc.py	Fri Aug 31 18:21:25 2012 +0200
     3.2 +++ b/scripts/ucc_and_loop_graph_treatment/parse_ucc.py	Fri Feb 01 18:17:21 2013 +0100
     3.3 @@ -16,6 +16,8 @@
     3.4  	uccfile = open(sys.argv[1])
     3.5  	d = read_from_file(uccfile)
     3.6  	g = uccgraph_from_dict(d)
     3.7 +	nx.draw(g)
     3.8 +	plt.show()
     3.9  	print "Parsed UCC from file", sys.argv[1], "and found:"
    3.10  	if d.has_key("unit"):
    3.11  		print len(d["unit"]), "Units"
    3.12 @@ -54,8 +56,8 @@
    3.13  				if not aliases.has_key(unit):
    3.14  					d["unit"].append( unit )
    3.15  					aliases[unit]=unit
    3.16 -				if int(row[4]) == 1:
    3.17 -					aliases[unit[0],unit[1]+1]=aliases[unit]
    3.18 +				#if int(row[4]) == 1:
    3.19 +				#	aliases[unit[0],unit[1]+1]=aliases[unit]
    3.20  			if row[0] == "ctlDep":
    3.21  				if not d.has_key("ctlDep"):
    3.22  					d["ctlDep"] = []
    3.23 @@ -90,15 +92,19 @@
    3.24  	g = nx.DiGraph()
    3.25  	g.add_node("start")
    3.26  	g.add_node("end")
    3.27 -	g.add_nodes_from(d["unit"])
    3.28 -	g.add_edges_from(d["ctlDep"], color=(0,0,0))
    3.29 -	g.add_edges_from(d["commDep"], color=(255,0,0))
    3.30 -	for i,(senders,receivers) in enumerate(d["NtoN"]):
    3.31 -		g.add_node("NtoN"+str(i))
    3.32 -		for node in senders:
    3.33 -			g.add_edge(node,"NtoN0",color=(0,255,0))
    3.34 -		for node in receivers:
    3.35 -			g.add_edge("NtoN0",node,color=(0,255,0))
    3.36 +	if d.has_key("unit"):
    3.37 +		g.add_nodes_from(d["unit"])
    3.38 +	if d.has_key("ctlDep"):
    3.39 +		g.add_edges_from(d["ctlDep"], color=(0,0,0))
    3.40 +	if d.has_key("commDep"):
    3.41 +		g.add_edges_from(d["commDep"], color=(255,0,0))
    3.42 +	if d.has_key("NtoN"):
    3.43 +		for i,(senders,receivers) in enumerate(d["NtoN"]):
    3.44 +			g.add_node("NtoN"+str(i))
    3.45 +			for node in senders:
    3.46 +				g.add_edge(node,"NtoN0",color=(0,255,0))
    3.47 +			for node in receivers:
    3.48 +				g.add_edge("NtoN0",node,color=(0,255,0))
    3.49  	for node in g:
    3.50  		if node != "start" and node != "end":
    3.51  			if len(g.predecessors(node)) == 0: