# This program is free software; you can redistribute it and/or modify it
# under the terms of the license (GNU LGPL) which comes with this package.
# This program is free software; you can redistribute it and/or modify it
# under the terms of the license (GNU LGPL) which comes with this package.
downlinks = [v for v in graph if 'DOWN' in v]
mapping = {}
for down in downlinks:
up = down.replace('DOWN', 'UP')
downlinks = [v for v in graph if 'DOWN' in v]
mapping = {}
for down in downlinks:
up = down.replace('DOWN', 'UP')
Remove all the 'link' vertices from the graph to directly connect the nodes.
Note: it assumes that link vertices have the "link" string in their name.
'''
Remove all the 'link' vertices from the graph to directly connect the nodes.
Note: it assumes that link vertices have the "link" string in their name.
'''
# First, we compute the graph layout, i.e. the position of the nodes.
# The neato algorithm from graphviz is nicer, but this is an extra-dependency.
# The spring_layout is also not too bad.
# First, we compute the graph layout, i.e. the position of the nodes.
# The neato algorithm from graphviz is nicer, but this is an extra-dependency.
# The spring_layout is also not too bad.
nx.draw_networkx_edges(graph, pos, alpha=0.3)
if label:
nx.draw_networkx_labels(graph, pos)
nx.draw_networkx_edges(graph, pos, alpha=0.3)
if label:
nx.draw_networkx_labels(graph, pos)
parser = argparse.ArgumentParser(description='Visualization of topologies for SimGrid C++ platforms')
parser.add_argument('input', type=str, help='SimGrid C++ platform file name (input)')
parser.add_argument('output', type=str, help='File name of the output image')
parser = argparse.ArgumentParser(description='Visualization of topologies for SimGrid C++ platforms')
parser.add_argument('input', type=str, help='SimGrid C++ platform file name (input)')
parser.add_argument('output', type=str, help='File name of the output image')
compile_platform(platform_cpp, platform_so)
dump_csv(platform_so, platform_csv)
generate_svg(platform_csv, args.output, args.simplify)
compile_platform(platform_cpp, platform_so)
dump_csv(platform_so, platform_csv)
generate_svg(platform_csv, args.output, args.simplify)