簡易檢索 / 詳目顯示

研究生: 蘇維農
Su, Wei-Nung
論文名稱: JMC : 基於 OpenMP 3.0 平行程式設計模型,實作支援 OpenMP 的 Java 語言編譯器及執行期間程式庫
JMC : Java Language Compiler and Runtime Library for Multi-Core Platform Based-On OpenMP 3.0 Programming Model
指導教授: 石維寬
Shih, Wei-Kuan
口試委員:
學位類別: 碩士
Master
系所名稱: 電機資訊學院 - 資訊工程學系
Computer Science
論文出版年: 2010
畢業學年度: 98
語文別: 中文
論文頁數: 101
中文關鍵詞: 平行程式多核心編譯器
外文關鍵詞: Parallel Programming, Multi-Core, Compiler, Java, OpenMP
相關次數: 點閱:1下載:0
分享至:
查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報
  • 微處理器的設計已從高頻率轉為低功耗,為了滿足高效能及低功耗的需求,多核心處理器的設計已成為趨勢,而為了有效利用多核心的硬體特性,平行程式的設計開發也愈來愈受到重視。OpenMP 是一套適用於共享記憶體系統、專為 C/C++/Fortran 設計的平行程式設計模型,它利用在原始碼中插入編譯器指示詞 (Compiler Directive) 的方式讓程式開發人員可以方便撰寫平行程式。Java 是一個廣泛被使用的程式語言,至今亦有作品將 OpenMP 平行程式設計模型導入 Java,例如 JOMP。但是到目前為止,這些作品都沒有支援到最新的 OpenMP 3.0 規格,特別是在 OpenMP 3.0 才納入的 Task 功能。

    本論文以 OpenMP 3.0 規格為基礎,設計一套適用共享記憶體系統,讓 Java 語言使用的平行程式開發模型 (Parallel Programming Model),名稱為 JMC。

    本論文分成四大部分,第一部分說明 JMC 提供的 Java 平行程式設計模型;第二部份針對 JMC 執行期間程式庫的實作及運行方式進行說明;第三部份針對 JMC 原始碼層級編譯器的實作及運行方式進行說明;最後一部分提供實際測試數據,並與現有的類似作品進行比較。


    The design goal of Micro-Processor has changed to low power instead of high frequency. In order to meet the high performance and low power requirements, Multi-core processor design has become a trend. Moreover, parallel programming is becoming more important in order to use multi-core features. OpenMP is a parallel programming model designed for C/C++/Fortran language target at shared-memory system. Programmer can insert OpenMP directives into source code to parallelize their sequential program. Java is a widly used programming language and platform. There are some works bring OpenMP programming model into Java language and platform, such as JOMP. But these works do not support the latest OpenMP specification, especially the Task feature in OpenMP 3.0.

    In this paper, we implement a parallel programming model for Java language and shared-memory system based on OpenMP 3.0, called JMC.

    The paper consists of four parts. The first part is introduction to JMC parallel programming model; The second part is implementation details of JMC Runtime Library; The third part is implementation details of JMC Source-Level Compiler; The fourth part is experiment and comparison of JMC and JOMP.

    1. 簡介 1 1.1. 背景 1 1.2. 動機 1 2. OpenMP 概觀 3 2.1. 簡介 3 2.2. OpenMP 平行模型 3 2.3. OpenMP 程式開發模型 4 2.4. OpenMP Directive 格式 5 3. 相關工作及作品 7 3.1. JOMP 7 3.2. JaMP 7 4. JMC 概觀 9 4.1. JMC 元件 9 4.1.1 JMC Source-Level Compiler 9 4.1.2 JMC Runtime Library 9 4.2. JMC 平行模型 9 4.3. JMC 平行程式開發模型 10 4.4. JMC OpenMP-like Directive 格式 11 5. JMC Runtime Library 13 5.1. 概觀 13 5.2. 跨平台 14 5.3. 執行環境及偵錯功能 14 5.4. Parallel Team 和 Task 16 5.4.1 Task 16 5.4.2 Parallel Thread 20 5.4.3 Parallel Team 21 5.4.4 Task 共用資料 24 5.4.5 Parallel Team 使用方式 25 5.4.6 Task 切換方式 28 5.4.7 Task 排程策略 33 5.4.8 例外處理 37 5.5. Loop 40 5.5.1 Loop Chunk 40 5.5.2 Loop Region 43 5.5.3 For-Loop Chunk Scheduler 43 5.5.4 使用 For-Loop Region 46 5.5.5 For-Loop Chunk 排程方式 49 5.5.6 Ordered Region 51 5.6. 其他功能 54 5.6.1 Single Region 54 5.6.2 Simple Lock 和 Nestable Lock 56 5.7. 與 OpenMP 程式開發模型合作 57 5.7.1 OpenMP API 函式及常數 57 5.7.2 Internal Control Variables (ICV) 57 5.7.3 OpenMP 環境變數 58 5.7.4 決定 Parallel Team 的執行緒數量 58 5.8. JMC Native Library 58 6. JMC Source-Level Compiler 60 6.1. 系統架構 60 6.1.1 JMC Source-Level Compiler 的組成元件 60 6.1.2 Pre-Processor 和 Parser 60 6.1.3 Code Filter 62 6.1.4 Java Code Generator 63 6.2. OpenMP-like Directive 轉換流程 63 6.2.1 OpenMP-like Directive 的內部表示 (IR) 64 6.2.2 連結 (Link) 64 6.2.3 展開 (Expand) 65 6.2.4 收集變數 (Collect Variables) 67 6.2.5 檢查 (Check) 67 6.2.6 建立私有變數 (Create Private-Variables) 67 6.2.7 轉換 (Translate) 68 6.2.8 建立共用變數 (Create Shared-Context) 68 6.3. 各種 OpenMP-like Directive 轉換方式 68 6.3.1 parallel Construct 68 6.3.2 task Construct 68 6.3.3 for Construct 68 6.3.4 sections Construct 68 6.3.5 master Construct 70 6.3.6 single Construct 70 6.3.7 critical Construct 71 6.3.8 taskwait Construct 72 6.3.9 barrier Construct 72 6.3.10 atomic Construct 72 6.3.11 ordered Construct 73 6.4. 額外支援的 OpenMP-like Directive 73 6.4.1 taskschedule Construct 73 6.5. Data-Sharing Attribute 的轉換方式 73 6.5.1 shared Clause 73 6.5.2 private Clause 78 6.5.3 firstprivate Clause 79 6.5.4 lastprivate Clause 81 6.5.5 reduction Clause 82 6.6. 尚未支援的 OpenMP Directive 和 Clauses 83 6.6.1 flush Construct 83 6.6.2 threadprivate Directive 84 6.6.3 copyin Clause 84 6.6.4 copyprivate Clause 84 7. 實驗 85 7.1. 實驗平台 85 7.2. Parallel Team 啟動測試 85 7.3. 平行化 For 迴圈 86 7.3.1 單層 For 迴圈 86 7.3.2 雙層 For 迴圈 88 7.3.3 平行 For 迴圈的效能負擔測試 90 7.4. Task 功能測試 91 7.5. JGF Benchmark 95 8. 結論與未來工作 99 9. 參考文獻 100

    [ 1 ] W. Lloyd Bircher, Lizy K. John. Analysis of Dynamic Power Management on Multi-Core Processors. In Proceedings of the 22nd annual international conference on Supercomputing, Island of Kos, Greece, 2008.

    [ 2 ] Intel Threading Building Blocks, http://software.intel.com/en-us/intel-tbb/

    [ 3 ] DAta-Parallel Programming Library for Education, http://www.cs.dartmouth.edu/ILI/dapple/

    [ 4 ] OpenMP.org, http://openmp.org/

    [ 5 ] The Cilk Project, http://supertech.csail.mit.edu/cilk/

    [ 6 ] TIOBE Programming Community Index, http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html

    [ 7 ] Microsoft Visual C++, http://msdn.microsoft.com/en-us/visualc/

    [ 8 ] GCC, the GNU Compiler Collection, http://gcc.gnu.org/

    [ 9 ] Intel Compilers, http://software.intel.com/en-us/intel-compilers/

    [ 10 ] J.M. Bull and M.E. Kambites. JOMP - an OpenMP-like Interface for Java. In Proc. Of the ACM 2000 Conf. on Java Grande, Pages 44-53, San Francisco, CA, USA, 2000.

    [ 11 ] M. Klemm, M. Bezold1, R. Veldema, M. Philippsen. JaMP: An Implementation of OpenMP for a Java DSM. In Concurrency and Computation: Practice and Experience,Volume 19 Issue 18, Pages 2333-2352, John Wiley & Sons, Ltd. Chichester, UK, 2007.

    [ 12 ] R. Veldema, R.A.F. Bhoedjang, H.E. Bal. Jackal, A Compiler Based Implementation of Java for Clusters of Workstations. Technical report, University of Erlangen-Nurnberg, Germany, 2001.

    [ 13 ] Abraham Silberschatz, Peter Baer Galvin, Greg Gagne. Operating System Principles. Page 125, Wiley & Sons, Ltd. Chichester, UK, 2005.

    [ 14 ] Java Native Interface: Programmer's Guide and Specification. http://java.sun.com/docs/books/jni/

    [ 15 ] Scott Oaks, Henry Wong. Java Threads. Pages 179-180, O'Reilly, 2004.

    [ 16 ] Andrew Begel, Josh MacDonald, Michael Shilman. PicoThreads: Lightweight Threads in Java. Technical report, UC Berkeley, 2000.

    [ 17 ] Java Compiler Compiler (JavaCC), https://javacc.dev.java.net/

    [ 18 ] Robert P. Wilson, Robert S. French, Christopher S. Wilson, Saman P. Amarasinghe, Jennifer M. Anderson, Steve W. K. Tjiang, Shih-Wei Liao, Chau-Wen Tseng, Mary W. Hall, Monica S. Lam, John L. Hennessy. SUIF: an infrastructure for research on parallelizing and optimizing compilers. In ACM SIGPLAN Notices, Volume 25, Issue 5, Pages 110-121, ACM, New York, NY, USA, 1991.

    [ 19 ] Chris Lattner, Vikram Adve. LLVM: A Compilation Framework for Lifelong Program Analysis & Transformation. In Proceedings of the international symposium on Code generation and optimization: feedback-directed and runtime optimization, Page 75, IEEE Computer Society, Washington, DC, USA, 2004.

    [ 20 ] James R. Bulpin, Ian A. Pratt. Multiprogramming Performance of the Pentium 4 with Hyper-Threading. In Workshop on Duplicating, Deconstructing, and Debunking, Pages 53-62, 2004.

    [ 21 ] Karl Furlinger, Michael Gerndt. Analyzing Overheads and Scalability Characteristics of OpenMP Applications. In 7th International Meeting on High Performance Computing for Computational Science (VECPAR 2006), Pages 39-51, Springer, Rio de Janeiro, Brasil, 2006.

    [ 22 ] L. A. Smith, J. M. Bull, J. Obdrzalek. A Parallel Java Grande Benchmark Suite. In Proceedings of the 2001 ACM/IEEE conference on Supercomputing (CDROM), Page 8, Denver, Colorado, USA, 2001.

    [ 23 ] Java Grande Forum, http://www.javagrande.org/

    無法下載圖示 全文公開日期 本全文未授權公開 (校內網路)
    全文公開日期 本全文未授權公開 (校外網路)

    QR CODE