# 2016q3 Homework1 (compute-pi) contributed by <`Claude51315`> ## 目標 * [ ]學習openmp的基本使用 * [ ] 學習AVX * [ ]用R來處理和呈現資料 * [ ]了解測量時間發生的jitter * [ ]觀察各個計算pi的方式其誤差降低的速率 # lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 8 Model name: Intel(R) Core(TM) i7-4702MQ CPU @ 2.20GHz Virtualization: VT-x L1d cache: 32K L1i cache: 32K L2 cache: 256K L3 cache: 6144K # Performace Observation ### execution time  可以發現clock_gettime()會有抖動的情形發生  用R畫出回歸線可以較清楚比較每個實作方式的執行速度  對每個N做十次運算取平均,發現openmp with 4 threads的運算時間較不穩定。 ### error rate  > for i in `seq 1000 500 1000000`; N 的間隔為500  > for i in `seq 1000 400 1000000`; N 的間隔為400 由於aux_unroll是展開4次,所以當N是4的倍數時,error rate 較穩定。但仍可以觀察到aux_unroll誤差降低的速率較其他的實作方式慢。  > for i in `seq 1600 400 1600000`; 參考其他同學的筆記後(等等補連結),發現N要是16的倍數,誤差才會降低,因為一個avx暫存器可以存4次運算,再loop unroll 4次後,一次迴圈共可以算16次。
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up