High-Performance Parallel Computations Using Python as High-Level Language
High-performance and parallel computations have always represented a challenge in terms of code optimization and memory usage, and have typically been tackled with languages that allow a low-level management of resources, like Fortran, C and C++. Nowadays, most of the implementation effort goes into constructing the bookkeeping logic that binds together functionalities taken from standard libraries. Because of the increasing complexity of this kind of codes, it becomes more and more necessary to keep it well organized through proper software engineering practices. Indeed, in the presence of chaotic implementations, reasoning about correctness is difficult, even when limited to specific aspects like concurrency; moreover, due to the lack in flexibility of the code, making substantial changes for experimentation becomes a grand challenge.
Since the bookkeeping logic only accounts for a tiny fraction of the total execution time, we believe that for such a task it can be afforded to introduce an overhead due to a high-level language. We consider Python as a preliminary candidate with the intent of improving code readability, flexibility and, in turn, the level of confidence with respect to correctness. In this study, the bookkeeping logic of SMP-MRRR, a C & Fortran highly optimized multi-core eigensolver, is ported to Python. We report here on the porting process and on the pros and cons of using a high-level language in a high-performance parallel library.
KeywordsProductivity Code Development High-Performance Computations Python High-Level Languages
Unable to display preview. Download preview PDF.
- 1.Masini, S., Bientinesi, P.: High-Performance Parallel Computations using Python as High-Level Language.Technical Report AICES-2010/08-01, Aachen Institute for Computational Engineering Sciences, RWTH Aachen (August 2010), http://www.aices.rwth-aachen.de:8080/aices/preprint/documents/AICES-2010-08-01.pdf
- 2.Dhillon, I.: A new O(n2) Algorithm for the Symmetric Tridiagonal Eigenvalue/Eigenvector Problem. Ph.D. thesis, University of California, Berkeley (1997)Google Scholar
- 3.Petschow, M., Bientinesi, P.: The Algorithm of Multiple Relatively Robust Representations for Multi-Core Processors. In: PARA 2010: State of the Art in Scientific and Parallel Computing, Python in HPC (submitted)Google Scholar
- 4.Nilsen, J.K., Cai, X., Høyland, B., Langtangen, H.P.: Simplifying parallelization of scientific codes by a function-centric approach in Python. Submitted to Computational Science & Discovery for publication (2010)Google Scholar
- 5.Wilbers, I., Langtangen, H.P., Ødegard, Å.: Using Cython to Speed up Numerical Python Programs. In: Skallerud, B., Andersson, H.I. (eds.) Proceedings of MekIT 2009, pp. 495–512. NTNU, Tapir (2009)Google Scholar
- 7.Langtangen, H.P., Cai, X.: On the Efficiency of Python for High-Performance Computing: A Case Study Involving Stencil Updates for Partial Differential Equations. Proceedings of the Third International Conference on High Performance Scientific Computing, Hanoi, Vietnam, pp. 337-357 (2008)Google Scholar
- 10.Cai, X., Langtangen, H.P.: Parallelizing PDE solvers using the Python programming language. In: Bruaset, A.M., Tveito, A. (eds.) Numerical Solution of Partial Differential Equations on Parallel Computers. Springer Lecture Notes in Computational Science and Engineering, vol. 51, pp. 295–325. Springer, Heidelberg (2006)CrossRefGoogle Scholar
- 12.Hinsen, K., Sadron, R.C.: High-Level Parallel Software Development with Python and BSP. Parallel Processing Letters 13 (2003)Google Scholar
- 13.Hinsen, K.: The Molecular Modeling Toolkit: a case study of a large scientific application in Python. In: Proceedings of the 6th International Python Conference, San Jose, California (1997)Google Scholar