簡易檢索 / 詳目顯示

研究生: 林壽佑
Shou-Yu Lin
論文名稱: 應用繪圖處理器於離散元素法計算之初探
A Preliminary Study of Using Graphic Processors on Discrete Element Method Computation
指導教授: 謝佑明
Yo-Ming Hsieh
口試委員: 張大鵬
Ta-Peng Chang
陳鴻銘
Hung-Ming Chen
學位類別: 碩士
Master
系所名稱: 工程學院 - 營建工程系
Department of Civil and Construction Engineering
論文出版年: 2008
畢業學年度: 96
語文別: 中文
論文頁數: 115
中文關鍵詞: 離散元素法繪圖處理器GPGPUCUDA設計模式平行運算
外文關鍵詞: discrete-element code, graphics-processing unit
相關次數: 點閱:330下載:12
分享至:
查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報

  本研究專為離散元素法(Discrete Element Method)建立一套離散元素法之模擬架構,並且應用繪圖處理器(Graphic processors)於離散元素法的計算上。
  在計算方面,因離散元素法的計算時間除了受元素的數量影響之外,其時間步程數(Time step)的數量也是影響離散元素法計算時間的一項重要因素,也因此離散元素法在計算上將可能花費大量的時間。在本研究中,一方面除了需要挑選適當的碰撞搜尋演算法來減少搜尋離散元素的時間之外,亦可以選擇利用平行運算的方式,降低程式的執行運算時間。有鑑於此,本研究將初步探討並應用GPGPU(General-Purpose computing on graphics processing units)技術於離散元素法的計算之中。
  本研究 1) 利用物件導向程式設計的概念並融合物件導向設計模式(Design Pattern)的方式,建立一套離散元素法的模擬架構;2) 結合離散元素法的物件導向架構與CUDA(Compute Unified Device Architecture)架構所發展出來的GPGPU程式,並將對於 1) 運算效能、2) 不同碰撞偵測結果,以及3) 不同浮點數精確度進行探討,且將在最後的結論一併探討本研究中,GPU的總體執行效能因何不如CPU的總體執行效能。


  Discrete-element method (DEM) is a simulation method that has many potential applications in civil-engineering such as rock-fall, sand behaviors, etc. However, DEM currently has little practical applications due to its computational requirements. Realistic DEM simulations often involves thousands of discrete objects and requires many time increments. Therefore, in order to reduce overall computation time for DEM simulations, a object-oriented code written in C++ is developed in this work to incorporate graphics processing units (GPU) in discrete-element simulations. GPUs are specialized processors for graphics-processing, but has been adopted for general-purpose computing in recent years for their superior floating-point calculation capabilities than general-purpose central processing units.
  In this study, in order to ensure the developed code can be extended and maintained easily, design patters in object-oriented programming are utilized to develop a DEM software framework. The developed software framework is then implemented using C++ programming language, and then performance-profiled to identify the bottleneck in a DEM simulation. The identified bottleneck code is then modified to incorporate GPU computation using CUDA. Finally, by using the developed code, the 1) performance, 2) results between different contact-detection methods or using different processors, and 3) single-precision versus double-precision were evaluated. Finally, some recommendations on using GPU for DEM simulations were discussed.

論文摘要 I ABSTRACT III 致謝 V 目錄 VII 圖目錄 XI 表目錄 XV 第一章 序論 1 1.1 研究背景與目的 1 1.2 研究方法 2 1.3 論文架構 2 第二章 文獻回顧 5 2.1 離散元素法之簡介 5 2.1.1 碰撞搜尋演算法 7 2.2 GPGPU之簡介 8 2.2.1 GPGPU之歷史 8 2.2.2 GPGPU 的原理 9 2.2.3 GPGPU之發展 11 2.2.4 GPGPU應用案例 12 2.3 GPGPU設計程式之環境 14 2.3.1 CUDA 14 2.3.2 Cg Shading Language 15 2.3.3 GLSL 15 2.3.4 HLSL 16 2.3.5 BrookGPU 16 2.3.6 Sh 17 2.4 GPGPU的優勢 18 2.5 設計模式簡介 19 第三章 研究方法 21 3.1 研究流程 21 3.2 前處理 22 3.2.1 XML 23 3.2.2 XML Parser 25 3.3 碰撞搜尋演算法 28 3.4 設計模式 32 3.5 效能剖析 34 3.6 NVIDIA CUDA 34 3.6.1 GeForce 8800 Ultra之硬體架構 34 3.6.2 Stream Multiprocessor之硬體模型 36 3.6.3 Thread Block 37 3.6.4 記憶體模型 39 3.6.5 效能建議 40 3.6.6 CUDA範例 42 第四章 程式實作與系統分析 45 4.1 程式架構 45 4.1.1 前處理架構 47 4.1.1.1 XML 文件檔案格式 47 4.1.1.2 XML Parser解析程式 49 4.1.2 主模擬控制程式 51 4.1.3 離散元素生產程式 52 4.1.4 碰撞搜尋演算法程式 53 4.1.5 碰撞偵測程式 54 4.1.6 衝擊運動程式 56 4.1.7 碰撞模式類別 57 4.2 程式之執行流程 58 4.3 GPGPU程式 63 4.3.1 記憶體處理程式 64 4.3.2 核心計算程式 66 第五章 程式之效能分析及誤差探討 69 5.1 分析案例 69 5.2 驗證 74 5.2.1 Naive vs. DESS 75 5.2.2 DESS vs. DESSgpu 79 5.3 效能分析 84 5.3.1 CPU與GPU計算之效能比較 85 5.3.1.1 GPGPU程式效能改進之比較 85 5.3.1.2 Block內Thread數量之核心效能差異 88 5.3.1.3 總體計算之效能比較 90 5.3.1.4 通訊傳輸時間比較 92 5.4 計算結果之誤差探討 94 5.5 小結 106 第六章 結論與建議 109 6.1 結論 109 6.2 建議 110 參考文獻 113

1. Cundall PA(1971). “A Computer Model for Simulating Progressive, Large
Scale Movement in Blocky Rock System,” Proceedings of the ISRM Symposium on Rock Fracture, Nancy, France, pp. 129-136.
2. Wikipedia(2008). “Discrete Element Method”,
http://en.wikipedia.org/wiki/Discrete_element_method .
3. Zuo SC, Xu Y, Yang QW, Feng YT(2006). ” Discrete element
simulation of the behavior of bulk granular material during truck braking”,
Engineering Computation, pp. 4-15.
4. Cleary(2000). “DEM simulation of industrial particle flows: case studies of
dragline excavators, mixing in tumblers and centrifugal mills”, Powder Technology, pp. 83-104.
5. Rajamani R, Mishra B, Venugopal R, Datta A(2000). ”Discrete element
analysis of tumbling mills”, Powder Technology, pp. 105-112.
6. Morris J, Rubin M(2004). “Simulations of underground structures subjected to
dynamic loading using the distinct element method”, Engineering Computations, pp. 384-408.
7. Mcdowell G, Harireche O(2002). “Discrete element modeling of yielding and
normal compression of sand”, Geotechnique 52 No. 4, pp 299-304.
8. Warren M, Salmon J(1993). “A parallel Hashed Oct-Tree N-Body
Algorithm”, Technical Paper Submitted to Proceedings of Supercomputing ’93,
pp. 1-12.
9. Munjiza A(2004). “The Combined Finite-Discrete Element Method”, Queen
Mary, University of London, London, UK..
10. Williams J, Perkins E, Cook B(2004). “A contact algorithm for
partitioning N arbitrary sized objects”, Engineering Computations, pp. 235-248.
11. Williams J, Perkins E(2001). “A fast contact detection algorithm
insensitive to object sizes”, Engineering Computations, pp. 48-61.
12. Harris, Coombe, Scheuermann, Lastra (2003). “Histody of GPGPU”,
http://www.gpgpu.org/data/history.shtml .
13. NVIDIA(2003). “C for Graphics, The Cg Tutorial”, NVIDIA.
14. 陳武勇(2007), “使用繪圖處理器於B-spline 有限元素分析”, 國立成功大學
機械工程學系, 高雄.
15. NVIDIA(2007). “CUDA Programming Guide v1.0”, NVIDIA.
16. 維基百科(2008), “Tesla”, http://zh.wikipedia.org/wiki/NVIDIA_Tesla .
17. NVIDIA(2007). “Tesla”, http://www.nvidia.com/object/tesla_gpu_processor.html .
18. Wikipedia(2008). “Tesla”, http://en.wikipedia.org/wiki/NVIDIA_Tesla .
19. 維基百科(2008), “AMD Fusion”, http://zh.wikipedia.org/wiki/AMD_Fusion .
20. IT世界網訊(2008), “Intel Calpella”,
http://www.it.com.cn/f/news/078/30/470469.htm .
21. Owens J, Luebke D, Govindaraju N, Harris M, Kruger J,
Lefohn A, Purcell T(2005). “A Survey of General-Purpose
Computation on Graphics Hardware”, State of the Art Reports, pp. 21-51.
22. Owens J, Luebke D, Govindaraju N, Harris M, Kruger J,
Lefohn A, Purcell T(2007). “A Survey of General-Purpose
Computation on Graphics Hardware”, State of the Art Reports, pp. 21-51.
23. Harada T, Koshizuka S, Kawaguchi Y, (2007). “Smoothed
Particle Hydrodynamics on GPUs”, Graphics International, pp. 1-8.
24. Harada T, Tanaka M, Koshizuka S, Kawaguchi Y, (2007).“グラフぃクスハ—ド
ウェアを用いた個別要素法の高速化”, Transactions of JSCES, pp. 1-9 .
25. 維基百科(2008), “GLSL”, http://zh.wikipedia.org/wiki/GLSL .
26. 維基百科(2008), “HLSL”, http://zh.wikipedia.org/w/index.php?title=HLSL .
27. Li C(2004). “HLSL Introduction, NEATWARE”,
http://www.neatware.com/lbstudio/web/hlsl.html .
28. BrookGPU(2003). “BrookGPU”, Stanford University Graphics Lab .
29. McCool(2003), “Sh”, http://libsh.org/ .
30. Alexander C, Ishikawa S, Silverstein M, Jacobson M, Fiksdahl-king I, Angel S
(1977) A Pattern Language. Oxford University Press, USA.
31. Gamma E, Johnson R, Helm R, Vlissides J(2001), “Design Patterns”, Pearson.
32. Gossip(2007)
http://caterpillar.onlyfun.net/Gossip/DesignPattern/DesignPattern.htm
33. 林弘倫(2007), “Web Services 於防災工程之應用與探討(以基隆市為例)”,
國立台灣科技大學營建工程系, 台北.
34. 51cto.com(2005), “JAVA與XML聯合編程之SAX篇”,
http://www.51cto.com/art/200510/9130.htm
35. Kirk D(1992). Graphics Gems III. Harcourt, USA.
36. NVIDIA(2007). “CUDA Programming Guide v1.1”, NVIDIA.
37. NVIDIA(2007). “CUDA Programming Guide v2.0”, NVIDIA.
38. Yang CT, Hsieh SH(2005). “An object-oriented framework for versatile
discrete objects simulation using design patterns”, Computational Mechanics, pp.
85-99.
39. 陳泰安(2001), “球形顆粒系統之碰撞分析及演算法”, 國立中央大學土木
工程學系.

QR CODE