contributed by <LitSnow
>
set xlabel 'N'
set ylabel 'Time(sec)'
set style fill solid
set title 'Compute_pi Time by clock_gettime() '
set term png enhanced font 'Verdana,10'
set output 'runtime.png'
set term pngcairo size 1280,960
set datafile separator ","
plot "result_clock_gettime.csv" using 1:2 title 'baseline' with lines lt rgb 'red' , \
"result_clock_gettime.csv" using 1:3 title 'openmp_2' with lines lt rgb 'blue' , \
"result_clock_gettime.csv" using 1:4 title 'openmp_4' with lines lt rgb 'green' ,\
"result_clock_gettime.csv" using 1:5 title 'AVX' with lines lt rgb 'orange' ,\
"result_clock_gettime.csv" using 1:6 title 'AVX + loop untolling' with lines lt rgb 'brown'
第8行:要plot "*csv" 必須加上set datafile separator ","
這行,不然會有一些莫名其妙的錯誤訊息
例如:
all points y value undefined
x range is invalid
起始數字
取樣區間
終止數字
gencsv: default
for i in `seq 100 5000 1000000`; do \
printf "%d," $$i;\:
./benchmark_clock_gettime $$i; \
done > result_clock_gettime.csv
plot: result_clock_gettime.csv
gnuplot runtime.gp
在終端機輸入 make plot
就會執行gnuplot繪圖