# Gnuplot script # output configuration set term pdfcairo color fontscale 0.8 size 28cm,20cm set termoption noenhanced # to tolerate underscores in filenames set output "mutex.pdf" set autoscale x set autoscale y set logscale x 2 ############################################################################### # E X P E R I M E N T 1 # ############################################################################### input = 'experiment_1.thr' set xlabel "Ratio of rates \"critical section / non-critical section\"" ############################################################################### set title "Without caches: Global critical section throughput varying ratio of rates CS / NCS" set ylabel "Global throughput" plot for [i=0:*] input index i using 2:($3+$4) title columnheader(1) w lp lw 3 # ----------------------------------------------------------------------------- set title "Without caches: Critical section throughput of process 0 varying ratio of rates CS / NCS" set ylabel "Critical section throughput of process 0" plot for [i=0:*] input index i using 2:3 title columnheader(1) w lp lw 3 # ----------------------------------------------------------------------------- set title "Without caches: Critical section throughput of process 1 varying ratio of rates CS / NCS" set ylabel "Critical section throughput of process 1" plot for [i=0:*] input index i using 2:4 title columnheader(1) w lp lw 3 ############################################################################### # E X P E R I M E N T 2 # ############################################################################### set title "With caches: Throughputs (NCS on average five times longer than CS)" set style histogram rowstacked set style data histograms set boxwidth 0.75 relative set style fill solid 1.00 border -1 set xtic rotate by -50 scale 0 unset logscale set ylabel "Throughput" set xlabel "Protocol" plot "experiment_2.thr" using 3 title "P0", '' using 4:xtic(1) title "P1" ############################################################################### # E X P E R I M E N T 3 # ############################################################################### input = 'experiment_3.thr' status = system ("wc -l experiment_3.thr") if (status == 1) { # file input contains no data (the file has only the initial header line) exit } set xtic rotate by 0 scale 0 set logscale x 2 set xlabel "Ratio of non-critical section rates (process 0 / process 1)" ############################################################################### set title "Without caches: Global throughput varying ratio of rates NCS0 / NCS1" set ylabel "Global critical section throughput" plot for [i=0:*] input index i using 1:($2+$3) title columnheader(1) w lp lw 3 # ----------------------------------------------------------------------------- set title "Without caches: Critical section throughput of process 0 varying ratio of rates NCS0 / NCS1" set ylabel "Throughput of process 0" plot for [i=0:*] input index i using 1:2 title columnheader(1) w lp lw 3 # ----------------------------------------------------------------------------- set title "Without caches: Critical section throughput of process 1 varying ratio of rates NCS0 / NCS1" set ylabel "Throughput of process 1" plot for [i=0:*] input index i using 1:3 title columnheader(1) w lp lw 3