浏览代码

give examples of plots generated by tools/starpu_mpi_comm_matrix.py in the documentation

Nathalie Furmento 6 年之前
父节点
当前提交
f708058a7e

+ 1 - 1
doc/doxygen/chapters/370_online_performance_tools.doxy

@@ -183,7 +183,7 @@ a summary will then be displayed at program termination:
 [starpu_comm_stats][0:1]	456.000000 B	0.000435 MB	 0.000188 B/s	 0.000000 MB/s
 \endverbatim
 
-These statistics can be plotted as heatmaps using StarPU tool <c>starpu_mpi_comm_matrix.py</c>
+These statistics can be plotted as heatmaps using StarPU tool <c>starpu_mpi_comm_matrix.py</c> (see \ref MPIDebug).
 
 \subsection StarPU-TopInterface StarPU-Top Interface
 

+ 28 - 0
doc/doxygen/chapters/410_mpi_support.doxy

@@ -899,6 +899,34 @@ When the environment variable \ref STARPU_COMM_STATS is set to \c 1,
 StarPU will display at the end of the execution for each node the
 volume and the bandwidth of data sent to all the other nodes.
 
+Here an example of such a trace.
+
+\verbatim
+[starpu_comm_stats][3] TOTAL:	476.000000 B	0.000454 MB	 0.000098 B/s	 0.000000 MB/s
+[starpu_comm_stats][3:0]	248.000000 B	0.000237 MB	 0.000051 B/s	 0.000000 MB/s
+[starpu_comm_stats][3:2]	50.000000 B	0.000217 MB	 0.000047 B/s	 0.000000 MB/s
+
+[starpu_comm_stats][2] TOTAL:	288.000000 B	0.000275 MB	 0.000059 B/s	 0.000000 MB/s
+[starpu_comm_stats][2:1]	70.000000 B	0.000103 MB	 0.000022 B/s	 0.000000 MB/s
+[starpu_comm_stats][2:3]	288.000000 B	0.000172 MB	 0.000037 B/s	 0.000000 MB/s
+
+[starpu_comm_stats][1] TOTAL:	188.000000 B	0.000179 MB	 0.000038 B/s	 0.000000 MB/s
+[starpu_comm_stats][1:0]	80.000000 B	0.000114 MB	 0.000025 B/s	 0.000000 MB/s
+[starpu_comm_stats][1:2]	188.000000 B	0.000065 MB	 0.000014 B/s	 0.000000 MB/s
+
+[starpu_comm_stats][0] TOTAL:	376.000000 B	0.000359 MB	 0.000077 B/s	 0.000000 MB/s
+[starpu_comm_stats][0:1]	376.000000 B	0.000141 MB	 0.000030 B/s	 0.000000 MB/s
+[starpu_comm_stats][0:3]	10.000000 B	0.000217 MB	 0.000047 B/s	 0.000000 MB/s
+\endverbatim
+
+These statistics can be plotted as heatmaps using StarPU tool <c>starpu_mpi_comm_matrix.py</c>, this will produce 2 PDF files, one plot for the bandwidth, and one plot for the data volume.
+
+\image latex trace_bw_heatmap.pdf "Bandwidth Heatmap" width=0.5\textwidth
+\image html trace_bw_heatmap.png "Bandwidth Heatmap"
+
+\image latex trace_volume_heatmap.pdf "Data Volume Heatmap" width=0.5\textwidth
+\image html trace_volume_heatmap.png "Data Bandwidth Heatmap"
+
 \section MPIExamples More MPI examples
 
 MPI examples are available in the StarPU source code in mpi/examples:

二进制
doc/doxygen/chapters/images/trace_bw_heatmap.pdf


二进制
doc/doxygen/chapters/images/trace_bw_heatmap.png


二进制
doc/doxygen/chapters/images/trace_volume_heatmap.pdf


二进制
doc/doxygen/chapters/images/trace_volume_heatmap.png


+ 14 - 6
tools/starpu_mpi_comm_matrix.py.in

@@ -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")