Bläddra i källkod

Do no generate intermediate files when generating the "distribution" profile
with R.

Cédric Augonnet 16 år sedan
förälder
incheckning
27d7b4b275
2 ändrade filer med 33 tillägg och 17 borttagningar
  1. 1 1
      src/core/perfmodel/perfmodel_history.c
  2. 32 16
      tools/model_distrib.sh

+ 1 - 1
src/core/perfmodel/perfmodel_history.c

@@ -568,7 +568,7 @@ void update_perfmodel_history(job_t j, enum starpu_perf_archtype arch, unsigned
 
 		STARPU_ASSERT(j->footprint_is_computed);
 
-		fprintf(debug_file, "%x\t%d\t%lf\t%lf\t%d\t\t", j->footprint, job_get_data_size(j), measured, j->predicted, cpuid);
+		fprintf(debug_file, "0x%x\t%d\t%lf\t%lf\t%d\t\t", j->footprint, job_get_data_size(j), measured, j->predicted, cpuid);
 		unsigned i;
 			
 		struct starpu_task *task = j->task;

+ 32 - 16
tools/model_distrib.sh

@@ -16,28 +16,44 @@
 # See the GNU Lesser General Public License in COPYING.LGPL for more details.
 #
 
-# we want to handle requests like *.debug
-for inputfile in "$@"
-do
-echo "Handle file $inputfile"
-hashlist=`cut -f 1 $inputfile | sort | uniq | xargs` 
+create_histograms()
+{
 
-# extract subfiles from the history file
-for h in $hashlist
-do
-	echo "Handling tasks with hash = $h"
-	grep "^$h" $inputfile| cut -f 2- > $inputfile.$h
+inputfile=$1
 
 R --no-save > /dev/null << EOF
 
-table <- read.table("$inputfile.$h")
+handle_hash <- function (hash)
+{
+
+val <- table[table[,1]==hash,3]
+
+
+# there is certainly a better way to do this !
+size <- unique(table[table[,1]==hash,2])
+
+pdf(paste("$inputfile", hash, size, "pdf", sep="."));
+
+h <- hist(val[val > quantile(val,0.01) & val<quantile(val,0.99)], col="red", breaks=50, density=10)
 
-x <- table[,1]
-hist(x[x > quantile(x,0.01) & x<quantile(x,0.99)], col="red", breaks=50, density=10)
+
+}
+
+table <- read.table("$inputfile")
+
+hashlist <- unique(table[,1])
+
+for (hash in hashlist)
+{
+	print(hash)
+	handle_hash(hash)
+}
 
 EOF
-mv Rplots.pdf $inputfile.$h.pdf
-done
 
+}
+
+for inputfile in $@
+do
+	create_histograms $inputfile 
 done
-echo "finished !"