소스 검색

add measure scripts

Andra Hugo 14 년 전
부모
커밋
736c0b9f5e

+ 12 - 10
tests/cholesky_2ctxs/all_sched.sh

@@ -3,16 +3,18 @@
 #export STARPU_NCPUS=9
 #export STARPU_DIR=$HOME/sched_ctx/build
 
-source sched.sh isole 0 0 3 
-source sched.sh isole 0 1 2
-source sched.sh isole 0 2 1
-source sched.sh isole 0 3 0   
+source sched.sh isole 0 0 0 
 
-source sched.sh 1gpu 1 0 2
-source sched.sh 1gpu 1 1 1
-source sched.sh 1gpu 1 2 0
+# source sched.sh isole 0 0 3 
+# source sched.sh isole 0 1 2
+# source sched.sh isole 0 2 1
+# source sched.sh isole 0 3 0   
 
-source sched.sh 2gpu 2 1 0
-source sched.sh 2gpu 2 0 1
+# source sched.sh 1gpu 1 0 2
+# source sched.sh 1gpu 1 1 1
+# source sched.sh 1gpu 1 2 0
 
-source sched.sh 3gpu 3 0 0
+# source sched.sh 2gpu 2 1 0
+# source sched.sh 2gpu 2 0 1
+
+# source sched.sh 3gpu 3 0 0

+ 92 - 0
tests/cholesky_2ctxs/comp.sh

@@ -0,0 +1,92 @@
+#!/bin/bash
+
+infilename=$1
+outfilename=$2
+withctx=$3
+compute_effic=$4
+ninstr=$5
+best_gflops_withoutctxs=$6
+
+rm -rf $outfilename
+
+while read line
+do 
+    results=($line)
+
+    gflops1=0
+    gflops2=0
+
+    t1=0
+    t2=0
+
+    if [ $withctx -eq 1 ]
+    then
+	gpu=${results[0]}
+	gpu1=${results[1]}
+	gpu2=${results[2]}
+	ncpus1=${results[3]}
+	ncpus2=${results[4]}
+	gflops1=${results[5]}
+	gflops2=${results[6]}
+	t1=${results[7]}
+	t2=${results[8]}
+
+	maxtime=$(echo "$t1/$t2"|bc -l)
+	maxtime=${maxtime/.*}
+
+ 	if [ "$maxtime" == "" ]
+	then
+	    maxtime=$t2
+	else
+	    maxtime=$t1
+	fi
+
+	gflops=$(echo "$ninstr/$maxtime"|bc -l)
+	if [ $compute_effic -eq 1 ]
+	then
+	    gflops_norm=$(echo "$gflops/$best_gflops_withoutctxs"|bc -l)
+	    
+	    echo "$gpu $gpu1 $gpu2 $ncpus1 $ncpus2 `printf '%2.2f %2.2f' $gflops $gflops_norm`" >> $outfilename$gpu1$gpu2
+	else
+	    nres=$(echo "$gpu+$gpu1+$gpu2+$ncpus1+$ncpus2"|bc -l)
+	    best_gflops_rate=$(echo "$best_gflops_withoutctxs/$nres"|bc -l)
+
+	    gflop_rate=$(echo "$gflops/$nres"|bc -l)
+	    gflop_norm_rate=$(echo "$gflop_rate/$best_gflops_rate"|bc -l)
+	    
+	    echo "$ncpus1 $ncpus2 `printf '%2.2f %2.2f %2.2f' $gflops $gflop_rate $gflop_norm_rate`" >> $outfilename  
+	fi
+    else
+
+	nres=${results[0]}
+	gflops1=${results[1]}
+	gflops2=${results[2]}
+	t1=${results[3]}
+	t2=${results[4]}
+
+
+	maxtime=$(echo "$t1/$t2"|bc -l)
+	maxtime=${maxtime/.*}
+
+ 	if [ "$maxtime" == "" ]
+	then
+	    maxtime=$t2
+	else
+	    maxtime=$t1
+	fi
+
+	gflops=$(echo "$ninstr/$maxtime"|bc -l)
+
+	if [ $compute_effic -eq 1 ]
+	then
+	    echo "$nres `printf '%2.2f' $gflops`" >> $outfilename
+	else
+	    gflop_rate=$(echo "$gflops/$nres"|bc -l)
+	    echo "$nres `printf '%2.2f %2.2f' $gflops $gflop_rate`" >> $outfilename
+	fi
+	
+    fi
+
+
+done < $infilename
+

+ 40 - 0
tests/cholesky_2ctxs/comp_all.sh

@@ -0,0 +1,40 @@
+#!/bin/bash
+
+compute_effic=$1
+#for one matrix 20000 x 20000 and one of 10000 x 10000
+ninstr=2999999987712
+no_ctx_prefix=../cholesky_no_ctxs/timings-sched
+ctx_prefix=timings-sched
+
+source comp.sh $no_ctx_prefix/cholesky_no_ctxs res_cholesky_no_ctxs 0 $compute_effic $ninstr
+
+bestval_noctx=0
+while read line
+do 
+    results=($line)
+    val=$(echo "${results[1]}"|bc -l)
+    val=${val/.*}
+
+    if [ $val -gt $bestval_noctx ]
+    then
+	bestval_noctx=$(echo "$val"|bc -l)
+    fi
+done < res_cholesky_no_ctxs
+
+echo $bestval_noctx
+
+source comp.sh $ctx_prefix/isole res_isole 1 $compute_effic $ninstr $bestval_noctx
+
+#compute efficiency in a heterogeneous system
+#for the homogeneous one we can compute gflops rate per PU
+
+if [ $compute_effic -eq 1 ]
+then
+    source comp.sh $ctx_prefix/1gpu res_1gpu 1 $compute_effic $ninstr $bestval_noctx
+    source comp.sh $ctx_prefix/2gpu res_2gpu  1 $compute_effic $ninstr $bestval_noctx
+    source comp.sh $ctx_prefix/3gpu res_3gpu 1 $compute_effic $ninstr $bestval_noctx
+
+    source gnuplot_efficiency.sh efficiency
+else
+    source gnuplot_gflopsrate.sh gflopsrate
+fi

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 54 - 0
tests/cholesky_2ctxs/gnuplot_efficiency.sh


+ 29 - 0
tests/cholesky_2ctxs/gnuplot_gflopsrate.sh

@@ -0,0 +1,29 @@
+#!/bin/bash
+
+filename=$1
+
+gnuplot > /dev/null << EOF                                                
+set terminal postscript
+set output "| ps2pdf - $filename.pdf"
+                                                                   
+set datafile missing 'x'                                                  
+                                                                          
+set pointsize 0.75                                                        
+set title "Taux du debit per core normalise"
+set grid y                                                                
+set grid x                                                                
+set xrange [20:86]
+set yrange [0.6:1.5]
+
+#set logscale x                                                           
+set xtics ("20/76" 20,"30/66" 30,"40/56" 40, "50/46" 50, "60/36" 60, "70/26" 70, "80/16" 80, "86/10" 86)
+set key invert box right
+#set size 0.1
+
+set xlabel "Nombre de cpus dans le premier contexte / Nombre de cpus dans le deuxieme contexte"
+set ylabel "Efficacite per core"     
+
+                                         
+plot "res_isole" using 1:5 title 'Gflop rate per core' with lines lt rgb "blue" lw 2
+                                                                        
+EOF

+ 0 - 68
tests/cholesky_2ctxs/gnuplot_sched.sh

@@ -1,68 +0,0 @@
-#!/bin/bash
-
-# StarPU --- Runtime system for heterogeneous multicore architectures.
-# 
-# Copyright (C) 2009, 2010  Université de Bordeaux 1
-# Copyright (C) 2010  Centre National de la Recherche Scientifique
-# 
-# StarPU is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation; either version 2.1 of the License, or (at
-# your option) any later version.
-# 
-# StarPU is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# 
-# See the GNU Lesser General Public License in COPYING.LGPL for more details.
-
-BENCH_NAME=cholesky_and_lu
-
-filename1=/home/ahugo/sched_ctx/tests/cholesky_and_lu/timings-sched/cholesky_and_lu
-filename2=/home/ahugo/trunk2/tests/cholesky_and_lu/timings-sched/cholesky_and_lu
-
-gnuplot > /dev/null << EOF
-set term png enhanced color
-set output "$BENCH_NAME_big_kernel.png"
-
-set datafile missing 'x'
-
-set pointsize 0.75
-set title "Kernel Cholesky - 60 blocks size 61440 - in presence of another kernel cholesky - 40 blocks size 4096"
-set grid y
-set grid x
-set xrange [0:100]
-#set logscale x
-#set xtics 8192,8192,65536
-#set key invert box right bottom title "Scheduling policy"
-#set size 0.65
-
-set xlabel "Number of CPUs"
-set ylabel "GFlop/s"
-
-plot "$filename1" using 3:5 title 'No context' with lines lt 3 lw 2, "$filename2" using 3:5 title '2 contexts' with lines lt 2 lw 2
-
-EOF
-
-gnuplot > /dev/null << EOF
-set term png enhanced color
-set output "$BENCH_NAME_small_kernel.png"
-
-set datafile missing 'x'
-
-set pointsize 0.75
-set title "Kernel Cholesky - 40 blocks size 4096 - in presence of another kernel cholesky - 60 blocks size 61440"
-set grid y
-set grid x
-set xrange [0:100]
-#set logscale x
-#set xtics 8192,8192,65536
-#set key invert box right bottom title "Scheduling policy"
-#set size 0.65
-
-set xlabel "Number of CPUs"
-set ylabel "GFlop/s"
-
-plot "$filename1" using 4:6 title 'No context' with lines lt 3 lw 2, "$filename2" using 4:6 title '2 contexts' with lines lt 2 lw 2
-
-EOF

+ 3 - 3
tests/cholesky_2ctxs/sched.sh

@@ -30,10 +30,10 @@ gpu=$2
 gpu1=$3
 gpu2=$4
 
-nmaxcpus=9
+nmaxcpus=96
 
-nmincpus1=1
-nmincpus2=1
+nmincpus1=20
+nmincpus2=20
 
 if [ $gpu1 -gt 0 ]
 then