儘管OpenMP API提供了比POSIX threads函式庫更方便使用的方法將程式平行化,程式設計師仍需付出心力將OpenMP directives安插到程式碼內,並設定變數的分享屬性。在本篇論文中,我們設計一個系統用來將這些工作量由程式設計師移至編譯器來負擔。由於GCC是一個開放程式碼的編譯器並且支援OpenMP,所以我們使用GCC做為系統實作以及評估的平臺。 一開始我們先了解OpenMP directives以及data sharing attribute clauses的功能以及其限制,之後再了解GCC是如何處理OpenMP directives以及data sharing attribute clauses。最後使用這些資訊以發展出一組條件用來分類變數的分享屬性,以及安插OpenMP directives的步驟。
Although the OpenMP API provides a more convenient way for parallel programming than POSIX threads library, the programmer still has the workload to insert the OpenMP directives and data-sharing attribute clauses. In this thesis, we design a system which moves the workload of OpenMP programming from the programmer to the compiler. We use GCC compiler as our implementation and evaluation platform, because GCC is an open source compiler and it supports OpenMP. We first study the functionality and restriction of the OpenMP directives and data sharing attribute clauses. After that, we study the GCC compiler source code to learn how the GCC handles these directives and clauses. Finally, we use these information to development the conditions of the data sharing attribute classification and the procedure of OpenMP directives insertion.