瀏覽代碼

Add starpu_codelet_histo_profile, tool which draws a histogram of the profile of a codelet.

Samuel Thibault 12 年之前
父節點
當前提交
7f0033162e
共有 5 個文件被更改,包括 48 次插入11 次删除
  1. 2 1
      ChangeLog
  2. 9 0
      doc/chapters/perf-feedback.texi
  3. 1 0
      tools/Makefile.am
  4. 35 9
      tools/model_distrib.sh
  5. 1 1
      tools/starpu_codelet_profile

+ 2 - 1
ChangeLog

@@ -120,7 +120,8 @@ Small features:
   traces from starpu_init.
   * Add trace_buffer_size configuration field to permit to specify the tracing
   buffer size.
-  * Add starpu_codelet_profile, a tool that draws the profile of a codelet.
+  * Add starpu_codelet_profile and starpu_codelet_histo_profile, tools which draw
+  the profile of a codelet.
 
 Small changes:
   * STARPU_NCPU should now be used instead of STARPU_NCPUS. STARPU_NCPUS is

+ 9 - 0
doc/chapters/perf-feedback.texi

@@ -449,6 +449,15 @@ This will create profiling data files, and a @code{.gp} file in the current
 directory, which draws the distribution of codelet time over the application
 execution, according to data input size.
 
+If you have the R statistical tool installed, you can additionally use
+
+@example
+$ starpu_codelet_histo_profile distrib.data
+@end example
+
+Which will create one pdf file per codelet and per input size, showing a
+histogram of the codelet execution time distribution.
+
 @node Theoretical lower bound on execution time API
 @section Theoretical lower bound on execution time
 

+ 1 - 0
tools/Makefile.am

@@ -98,6 +98,7 @@ noinst_PROGRAMS =	cbc2paje lp2paje
 
 dist_bin_SCRIPTS +=			\
 	starpu_workers_activity		\
+	starpu_codelet_histo_profile	\
 	starpu_codelet_profile
 
 

+ 35 - 9
tools/model_distrib.sh

@@ -2,7 +2,7 @@
 
 # StarPU --- Runtime system for heterogeneous multicore architectures.
 # 
-# Copyright (C) 2009, 2010  Université de Bordeaux 1
+# Copyright (C) 2009, 2010, 2013  Université de Bordeaux 1
 # Copyright (C) 2010  Centre National de la Recherche Scientifique
 # 
 # StarPU is free software; you can redistribute it and/or modify
@@ -16,6 +16,14 @@
 # 
 # See the GNU Lesser General Public License in COPYING.LGPL for more details.
 
+if [ "$#" -lt 2 -o "$1" = --help -o "$1" = -h ]
+then
+	echo "Offline tool to draw codelet profile histogram over a traced execution"
+	echo ""
+	echo "Usage: $0 distrib.data"
+	exit 1
+fi
+
 create_histograms()
 {
 
@@ -23,30 +31,48 @@ inputfile=$1
 
 R --no-save > /dev/null << EOF
 
-handle_hash <- function (hash)
+handle_hash <- function (codelet, arch, hash)
 {
 
-val <- table[table[,1]==hash,3]
+mytable <- table
+mytable <- mytable[mytable[,1]==codelet,]
+mytable <- mytable[mytable[,2]==arch,]
+mytable <- mytable[mytable[,4]==hash,]
+
+val <- mytable[,5]
 
 
 # there is certainly a better way to do this !
-size <- unique(table[table[,1]==hash,2])
+size <- unique(mytable[,3])
 
-pdf(paste("$inputfile", hash, size, "pdf", sep="."));
+pdf(paste("$inputfile", codelet, arch, hash, size, "pdf", sep="."));
 
 h <- hist(val[val > quantile(val,0.01) & val<quantile(val,0.99)], col="red", breaks=50, density=10)
 
+dev.off()
 
 }
 
 table <- read.table("$inputfile")
 
-hashlist <- unique(table[,1])
+codeletlist <- unique(table[,1])
 
-for (hash in hashlist)
+for (codelet in codeletlist)
 {
-	print(hash)
-	handle_hash(hash)
+	archlist <- unique(table[table[,1]==codelet,2])
+
+	for (arch in archlist)
+	{
+		hashlist <- unique(table[table[,2]==arch,4])
+
+		for (hash in hashlist)
+		{
+			print(codelet)
+			print(arch)
+			print(hash)
+			handle_hash(codelet, arch, hash)
+		}
+	}
 }
 
 EOF

+ 1 - 1
tools/starpu_codelet_profile

@@ -18,7 +18,7 @@
 
 if [ "$#" -lt 2 -o "$1" = --help -o "$1" = -h ]
 then
-	echo "Offline tool to display codelet profile over a traced execution"
+	echo "Offline tool to draw codelet profile over a traced execution"
 	echo ""
 	echo "Usage: $0 distrib.data codelet_name"
 	exit 1