sysprog21
JongSyuGithub
contributed by <JonSyuGithub
>
github: https://gtihub.com/JonSyuGithub/compute-pi
OS: Ubuntu 16.04 LTS
CPU: i5-457
Memory 12GB ($ cat /proc/meminfo)
Update & Install
$ sudo apt-get update
$ sudo apt-get install build-essential
$ sudo apt-get install linux-tools-common linux-tools-generic
$ sudo apt-get install astyle colordiff gnuplot
# In this example, show just the user, system, and total time using format option:
$ { /usr/bin/time -f 'baseline %E %U %S' ./time_test_baseline ; } 2>time.txt
gnuplot:畫圖指令寫法
Makefile的for loop教學
for i in `seq 100 5000 25000`; do \
printf "%d," $$i;\
./benchmark_clock_gettime $$i; \
done > result_clock_gettime.csv
# setting parameter
$ git config --global user.email "your e-mail"
$ git config --global user.name "your name"
$ git config --global push.default matching
$ git remote set-url origin https://github.com/JonSyuGithub/compute-pi.git
# update
$ git add runtime.gp
$ git commit -m "Add runtime.pg for plot command"
$ git add runtime2.gp
$ git commit -m "Add runtime2.pg for plot2 command"
$ git add Makefile
$ git commit -m "make plot & plot2 commands in the makefile"
$ git push
$ make
$ make plot
# runtime2.gp
plot 'result_clock_gettime.csv' using 1:2 with lines title 'baseline',\
'result_clock_gettime.csv' using 1:3 with lines title 'OpenMP_2',\
'result_clock_gettime.csv' using 1:4 with lines title 'OpenMP_4',\
'result_clock_gettime.csv' using 1:5 with lines title 'AVX_SIMD',\
'result_clock_gettime.csv' using 1:6 with lines title 'AVX SIMD + Loop unrolling'
$ make
$ make plot2
# runtime2.pg
plot 'result_clock_gettime.csv' using 1:2 smooth bezier with lines title 'baseline',\
'result_clock_gettime.csv' using 1:3 smooth bezier with lines title 'OpenMP_2',\
'result_clock_gettime.csv' using 1:4 smooth bezier with lines title 'OpenMP_4',\
'result_clock_gettime.csv' using 1:5 smooth bezier with lines title 'AVX_SIMD',\
'result_clock_gettime.csv' using 1:6 smooth bezier with lines title 'AVX SIMD + Loop unrolling'
$ make
$ make plot2
參考此未同學在Makefile自行新增plot指令繪製圖 JonSyuGithub