|
@@ -28,8 +28,9 @@ def usage():
|
|
|
print("Usage: %s <output_execution>" % PROGNAME)
|
|
|
print("")
|
|
|
print("Options:")
|
|
|
- print( " -h, --help display this help and exit")
|
|
|
+ print(" -h, --help display this help and exit")
|
|
|
print(" -v, --version output version information and exit")
|
|
|
+ print(" -png produce plots in png format (default is pdf)")
|
|
|
print("")
|
|
|
print("Report bugs to <@PACKAGE_BUGREPORT@>")
|
|
|
sys.exit(1)
|
|
@@ -43,7 +44,14 @@ if len(sys.argv) >= 2:
|
|
|
if (len(sys.argv) == 1):
|
|
|
usage()
|
|
|
|
|
|
-outputfile=sys.argv[1]
|
|
|
+if len(sys.argv) >= 2 and sys.argv[1] == '-png':
|
|
|
+ outputformat='png'
|
|
|
+ outputext='png'
|
|
|
+ outputfile=sys.argv[2]
|
|
|
+else:
|
|
|
+ outputformat='pdf color'
|
|
|
+ outputext='pdf'
|
|
|
+ outputfile=sys.argv[1]
|
|
|
|
|
|
# find the number of nodes
|
|
|
nodes=0
|
|
@@ -87,8 +95,8 @@ def generateGnuplotScript(filename, datafilename, outputfile, nodes):
|
|
|
for node in range(nodes-1):
|
|
|
srctics += "\"src%d\" %d, " % (node, node)
|
|
|
dsttics += "\"dst%d\" %d, " % (node, node)
|
|
|
- ofile.write("set term pdf color\n")
|
|
|
- ofile.write("set output \"%s\"\n" % outputfile)
|
|
|
+ ofile.write("set term %s\n" % outputformat)
|
|
|
+ ofile.write("set output \"%s.%s\"\n" % (outputfile, outputext))
|
|
|
ofile.write("set view map scale 1\nset style data lines\n")
|
|
|
ofile.write("set palette model RGB defined ( 0 'white', 100 'black' )\n")
|
|
|
ofile.write("set xtics (%s\"src%d\" %d)\n" % (srctics, nodes-1, nodes-1))
|
|
@@ -98,10 +106,10 @@ def generateGnuplotScript(filename, datafilename, outputfile, nodes):
|
|
|
|
|
|
# generate gnuplot volume data and script file
|
|
|
writeData(outputfile+"_volume.data", nodes, volumes)
|
|
|
-generateGnuplotScript(outputfile+"_volume.gp", outputfile+"_volume.data", outputfile+"_volume_heatmap.pdf", nodes)
|
|
|
+generateGnuplotScript(outputfile+"_volume.gp", outputfile+"_volume.data", outputfile+"_volume_heatmap", nodes)
|
|
|
os.system("gnuplot " + outputfile+"_volume.gp")
|
|
|
|
|
|
# generate gnuplot bandwidth data and script file
|
|
|
writeData(outputfile+"_bw.data", nodes, bandwidth)
|
|
|
-generateGnuplotScript(outputfile+"_bw.gp", outputfile+"_bw.data", outputfile+"_bw_heatmap.pdf", nodes)
|
|
|
+generateGnuplotScript(outputfile+"_bw.gp", outputfile+"_bw.data", outputfile+"_bw_heatmap", nodes)
|
|
|
os.system("gnuplot " + outputfile+"_bw.gp")
|