Abstract:
With the coming of the data-driven era, software applications are becoming increasingly more computationally demanding. High-performance computing is more important than ever. Since Moore's Law has reached its limit, parallelization is the key technique to reduce computational time. However, writing parallel programs is still notoriously difficult because it involves a great deal of expert knowledge, as well as programming and tuning efforts. Even though there are already many tools and languages addressing this challenge, it is still rare to see parallel techniques employed in the software industry. OpenMP is a programming interface standard that facilitates writing multi-threaded applications. It adopts the fork-join model, allowing programs to be parallelized incrementally. By adding directives, a sequential program can be compiled to a parallel version without extra coding effort. The good usability of OpenMP makes it widely used in many practical parallel programs; however, it has been discovered that OpenMP is not closely incorporated with object-oriented programming concepts. This thesis addresses that a good parallel programming model should be closely incorporated with software design principles, especially object-oriented programming concepts. This research identifies the gaps between object-oriented programming and OpenMP, and provides solutions to combine these two models in harmony. The ultimate aim of this research is to help programmers write parallel code in a more efficient and less error-prone way. Throughout the thesis, Pyjama is demonstrated, which is a research project developed as an extended OpenMP parallel programming model for high-level object-oriented languages. The implementation is dedicated to Java. The first important aspect contributed in this thesis is the proposal of enhanced exception handling within OpenMP, for object-oriented languages. The research identifies existing problems and proposes a robust exception handling mechanism to solve the problems. The evaluation shows that the new approach provides an elegant and robust mechanism without causing any performance degradation. The second significant contribution of this research is the development of an asynchronous model for event-driven programming. This model is regarded as compensation for the fork-join model, making Pyjama more powerful for event-driven programming patterns. New OpenMP directives are proposed to endow sequential code with an asynchronous execution nature. This idea has been tested in different event drivenn environments and shows the effectiveness of boosting the performance of event handling. In order to analyze the performance of an event-driven application, a mathematical model for parallel event-driven programming is developed. This model reveals how factors such as asynchronization scale and parallelization scale influence event-driven performance. This theoretical guidance can help programmers to tune the performance for the event-driven system and make proper decisions on choosing the number of asynchronous workers and the number of parallel threads for each event handler. Extensive experimental tests and benchmarks have been conducted and the results show that Pyjama is both a useful and productive tool for parallelizing Java code. The benchmarks show the Pyjama directives are effective in parallelizing work, and that the speedups are comparable to C/C++ OpenMP implementations. Different aspects of the evaluation demonstrate that using the new proposed virtual target programming model is effcient to boost the performance of event-driven applications.