Commits

Sven Hager committed 7a08825

change Y axis labels of some bm results

Comments (0)

Files changed (1)

rapydo/benchmarks/analyse_bm_results.py

 set grid
 set output "%(leafs)d_leafs_speedup.eps"
 set xlabel "Number of additions" font "bold, 18"
-set ylabel "Average speedup factor of Rapydo" font "bold, 18"
+set ylabel "Average speedup factor of Rapydo JIT" font "bold, 18"
 set key bottom right
 plot 'speedup_%(vlen1)d_vector_len_%(leafs)d_leafs.dat' with linespoints title 'Vector length       %(vlen1)d' lc rgb "#00FF00",\\
      'speedup_%(vlen2)d_vector_len_%(leafs)d_leafs.dat' with linespoints title 'Vector length     %(vlen2)d' lc rgb "#FF0000",\\
 set grid
 set output "%(leafs)d_leafs_rdm_speedup.eps"
 set xlabel "Number of operations" font "bold, 18"
-set ylabel "Average speedup factor of Rapydo" font "bold, 18"
+set ylabel "Average speedup factor of Rapydo JIT" font "bold, 18"
 set key bottom right
 plot 'speedup_%(vlen1)d_vector_len_%(leafs)d_leafs_rdm.dat' with linespoints title 'Vector length       %(vlen1)d' lc rgb "#00FF00",\\
      'speedup_%(vlen2)d_vector_len_%(leafs)d_leafs_rdm.dat' with linespoints title 'Vector length     %(vlen2)d' lc rgb "#FF0000",\\
             target_file = na_res_file % na_type
             os.rename("bm_jit_float_result.txt", "na/%s" % target_file)
 
+        # --- R
+
+        na_res_file_R = "R_%s.txt"
+        for i, na_type in enumerate(na_types):
+            bm_file = bm_file_template % na_type
+            cmd = "Rscript %s" % bm_file
+            os.system(cmd)
+            target_file = na_res_file_R % na_type
+            os.rename("bm_jit_float_result.txt", "na/%s" % target_file)
+
     if plot:
         print "\n*****************************************************************"
         print "*** PERFORMING  DATA  ANALYSIS  ON  MIXED  BENCHMARK  RESULTS ***"
         print "************************************\n"
 
         na_types = ["float", "float_no_na"]
-        na_res_file = "%s.txt"
+        na_res_file = "R_%s.txt"
 
         # read files
         na_d = {}
                         d[vlen] = (mean, error)
 
         # normalize
+        #for key, (mean, err) in na_d.iteritems():
+        #    na_d[key] = (1.0, err/mean)
+        #    no_na_mean, no_na_err = no_na_d[key]
+        #    no_na_d[key] = (no_na_mean / mean, no_na_err / mean)
+
         for key, (mean, err) in na_d.iteritems():
-            na_d[key] = (1.0, err/mean)
+            na_d[key] = (mean / key, err/key)
             no_na_mean, no_na_err = no_na_d[key]
-            no_na_d[key] = (no_na_mean / mean, no_na_err / mean)
+            no_na_d[key] = (no_na_mean / key, no_na_err / key)
 
         # write .dat file
         keys = [20000, 35000, 50000, 65000, 80000, 100000, 250000, 500000]
 set style data histogram
 set xtics #rotate by -45
 set grid ytics
-set xlabel "Vector lengths" font "bold, 18"
+set xlabel "Vector length" font "bold, 18"
 set ylabel "Relative execution time" font "bold, 18"
 set yrange [0:*]
 set datafile separator ","
 set key horizontal
-plot 'na/na.dat' using 2:3:xtic(1) ti "Float vector without NAs" linecolor rgb "#00FF00", \
-	'' using 4:5 ti "Float vector with NAs" lt 1 lc rgb "#FF0000"
+plot 'na/na.dat' using 2:3:xtic(1) ti "NA-free floating point arithmetic" linecolor rgb "#00FF00", \
+	'' using 4:5 ti "Floating point arithmetic with NA values" lt 1 lc rgb "#FF0000"
 """
     
         gnuplot_file = "na/na.gpl"
         os.system("gnuplot %s" % gnuplot_file)
         os.unlink(gnuplot_file)
         os.system("epstopdf na/bm_na_results.eps")
-        shutil.copyfile("na/bm_na_results.pdf", 
-                "/home/sven/uni/ma/tex/bilder/bm_na_results.pdf")
+        #shutil.copyfile("na/bm_na_results.pdf", 
+        #        "/home/sven/uni/ma/tex/bilder/bm_na_results.pdf")
 
     if extract:
         print "\n************************************"