diff --git a/PowerDiagram.py b/PowerDiagram.py index d01e0b3..3ab402e 100644 --- a/PowerDiagram.py +++ b/PowerDiagram.py @@ -474,18 +474,12 @@ def power_config_to_svg(power_config, svg_file_path, worst_case_scenario=True): # graph.add_edge(con.from_plug.machine.name, con.to_plug.machine.name, color="%s:%s" % (color, wsc_color), label=label, penwidth="%s:%s" % (penwidth, penwidth)) graph.add_edge(con.from_plug.machine.name, con.to_plug.machine.name, color=color, label=label, penwidth=penwidth) - if False: # len(con.from_plug.machine.input_plugs) == 0: - ultimate_power_provider_node = graph.get_node(con.from_plug.machine.name) - total_power_consumption = int(con.from_plug.machine.get_power_consumption(worst_case_scenario=worst_case_scenario)) - ultimate_power_provider_node.attr['label']='%s (%d W)' % (con.from_plug.machine.name, total_power_consumption) - - if True: - for rack_id, rack in racks.iteritems(): - # sub = graph.add_subgraph(rack, name='cluster_%s' % rack_id, rank='same') - machine_names = list(machine.name for machine in rack['machines']) - sub = graph.add_subgraph(machine_names, name='cluster_%s' % rack_id, style='rounded') - sub.graph_attr['label'] = rack_id - # sub.graph_attr['rank']='same' + for rack_id, rack in racks.iteritems(): + # sub = graph.add_subgraph(rack, name='cluster_%s' % rack_id, rank='same') + machine_names = list(machine.name for machine in rack['machines']) + sub = graph.add_subgraph(machine_names, name='cluster_%s' % rack_id, style='rounded') + sub.graph_attr['label'] = rack_id + # sub.graph_attr['rank']='same' # assert False #graph.layout(prog='twopi') with open('./toto.dot', 'w') as f: