Abstract
The proliferation of parallel processing in shared-memory applications has encouraged developing assistant frameworks such as OpenMP. OpenMP has become increasingly prevalent due to the simplicity it offers to elegantly and incrementally introduce parallelism. However, it still lacks some high-level language features that are essential in object-oriented programming. One such mechanism is that of exception handling. In languages such as Java, the concept of exception handling has been an integral aspect to the language since the first release. For OpenMP to be truly embraced within this object-oriented community, essential object-oriented concepts such as exception handling need to be given some attention. The official OpenMP standard has little specification on error recovery, as the challenges of supporting exception-based error recovery in OpenMP extends to both the semantic specifications and related runtime support. This paper proposes a systematic mechanism for exception handling with the co-use of OpenMP directives, which is based on a Java implementation of OpenMP. The concept of exception handling with OpenMP directives has been formalized and categorized. Hand in hand with this exception handling proposal, a flexible approach to thread cancellation is also proposed (as an extension on OpenMP directives) that supports this exception handling within parallel execution. The runtime support and its implementation are discussed. The evaluation shows that while there is no prominent overhead introduced, the new approach provides a more elegant coding style which increases the parallel development efficiency and software robustness.
Similar content being viewed by others
References
Bull, M.: Measuring synchronisation and scheduling overheads in OpenMP. In: Proceedings of First European Workshop on OpenMP. vol. 8, p. 49 (1999)
Duran, A., Ferrer, R., Costa, J.J., Gonzàlez, M., Martorell, X., Ayguadé, E., Labarta, J.: A proposal for error handling in OpenMP. Int. J. Parallel Prog. 35(4), 393–416 (2007)
Gatlin, K.S.: OpenMP 3.0 feature: error detection capability, May 2005. http://www.nic.uoregon.edu/iwomp2005/Talks/gatlin-panel.pdf
Giacaman, N., Sinnen, O.: Parallel task for parallelising object-oriented desktop applications. Int. J. Parallel Prog. 41(5), 621–681 (2013)
Giacaman, N., Sinnen, O., Akeila, L.: Object-oriented parallelisation: improved and extended parallel iterator. In: 14th IEEE International Conference on Parallel and Distributed Systems, ICPADS’08, pp. 113–120. IEEE (2008)
Herlihy, M.P., Wing, J.M.: Linearizability: a correctness condition for concurrent objects. ACM Trans. Program. Lang. Syst. 12(3), 463–492 (1990)
Keen, A.W., Olsson, R.A.: Exception handling during asynchronous method invocation. In: Euro-Par 2002 Parallel Processing, volume 2400 of Lecture Notes in Computer Science, pp. 656–660. Springer, Berlin (2002)
Knafla, B., Leopold, C.: Parallelizing a real-time steering simulation for computer games with OpenMP. In: Bischof, C., Bücker, M., Gibbon, P., Joubert, G.R., Lippert, T., Mohr, B., Peters F. (eds.) Parallel Computing: Architectures, Algorithms, and Applications. IOS Press, Amsterdam, Netherlands (2008)
Münchhalfen, J.F., Hilbrich, T., Protze, J., Terboven, C., Müller, M.S.: Classification of common errors in OpenMP applications. In: DeRose, L., de Supinski, B.R., Olivier, S.L., Chapman, B.M., Müller, M.S. (eds.) Using and Improving OpenMP for Devices, Tasks, and More, pp. 58–72. Springer, Berlin (2014)
OpenMP Architecture Review Board: OpenMP application program interface 4.0, July 2013
Saillard, E., Carribault, P., Barthou, D.: Static validation of barriers and worksharing constructs in OpenMP applications. In: DeRose, L., de Supinski, B.R., Olivier, S.L., Chapman, B.M., Müller, M.S. (eds.) Using and Improving OpenMP for Devices, Tasks, and More, pp. 73–86. Springer, Berlin (2014)
Salva, S., Delamare, C., Bastoul, C.: Web service call parallelization using OpenMP. In: A Practical Programming Model for the Multi-Core Era, volume 4935 of Lecture Notes in Computer Science, pp. 185–194. Springer, Berlin (2008)
Stroustrup, B.: The Design and Evolution of C++. Pearson Education India, Delhi (1994)
Vikas, Giacaman, N., Sinnen, O.: Pyjama: OpenMP-like implementation for Java, with GUI extensions. In: Proceedings of the 2013 International Workshop on Programming Models and Applications for Multicores and Manycores, PMAM ’13, pp. 43–52, New York, NY, USA. ACM (2013)
Vikas, Travis, S., Giacaman, N., Sinnen, O.: Using OpenMP under Android. In: OpenMP in the Era of Low Power Devices and Accelerators, volume 8122 of Lecture Notes in Computer Science, pp. 15–29. Springer, Berlin (2013)
Wang, Y., Nicolau, A., Cammarota, R., Veidenbaum, A.V.: A fault tolerant self-scheduling scheme for parallel loops on shared memory systems. In: 2012 19th International Conference on High Performance Computing (HiPC), pp. 1–10, Dec 2012
Wong, M., Klemm, M., Duran, A., Mattson, T, Haab, G., de Supinski, B.R., Churbanov, A.: Towards an error model for OpenMP. In: Beyond Loop Level Parallelism in OpenMP: Accelerators. Tasking and More, volume 6132 of Lecture Notes in Computer Science, pp. 70–82. Springer, Berlin (2010)
Zhang, L., Krintz, C., Nagpurkar, P.: Supporting exception handling for futures in Java. In: Proceedings of the 5th International Symposium on Principles and Practice of Programming in Java, PPPJ ’07, pp. 175–184, New York, NY, USA. ACM (2007)
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Fan, X., Mehrabi, M., Sinnen, O. et al. Supporting Enhanced Exception Handling with OpenMP in Object-Oriented Languages. Int J Parallel Prog 45, 1366–1389 (2017). https://doi.org/10.1007/s10766-016-0474-x
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10766-016-0474-x