微處理器的設計已從高頻率轉為低功耗,為了滿足高效能及低功耗的需求,多核心處理器的設計已成為趨勢,而為了有效利用多核心的硬體特性,平行程式的設計開發也愈來愈受到重視。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.