High-Performance Parallel Computations Using Python as High-Level Language

  • Stefano Masini
  • Paolo Bientinesi
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6586)


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.


Productivity Code Development High-Performance Computations Python High-Level Languages 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 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),
  2. 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. 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. 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. 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
  6. 6.
    Langtangen, H.P.: Python Scripting for Computational Science, 3rd edn. Springer Publishing Company, Heidelberg (2009) (incorporated)zbMATHGoogle Scholar
  7. 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
  8. 8.
    Hinsen, K.: Parallel Scripting with Python. Computing in Science and Engineering 9(6), 82–89 (2007)CrossRefGoogle Scholar
  9. 9.
    Hinsen, K., Langtangen, H.P., Skavhaug, O., Ødegard, Å.: Using BSP and Python to simplify parallel programming. Future Generation Computer Systems 22(1-2), 123–157 (2006)CrossRefGoogle Scholar
  10. 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
  11. 11.
    Cai, X., Langtangen, H.P., Moe, H.: On the performance of the Python programming language for serial and parallel scientific computations. Scientific Programming 13(1), 31–56 (2005)CrossRefGoogle Scholar
  12. 12.
    Hinsen, K., Sadron, R.C.: High-Level Parallel Software Development with Python and BSP. Parallel Processing Letters 13 (2003)Google Scholar
  13. 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

Copyright information

© Springer-Verlag Berlin Heidelberg 2011

Authors and Affiliations

  • Stefano Masini
    • 1
  • Paolo Bientinesi
    • 1
  1. 1.RWTH Aachen, AICESAachenGermany

Personalised recommendations