AuthorsI. Wilbers, H. P. Langtangen and Å. Ødegård
EditorsB. H. Skallerud and H. I. Andersson
TitleUsing Cython to Speed Up Numerical Python Programs
AfilliationScientific Computing
Project(s)Center for Biomedical Computing (SFF)
Publication TypeProceedings, refereed
Year of Publication2009
Conference NameMekIT´09.  Fifth  national  conference  on  Computational  Mechanics
ISBN Number978-82-519-2421-4

The present study addresses a series of techniques for speeding up numerical calculations in Python programs. The techniques are evaluated in a benchmark problem involving finite difference solution of a wave equation. Our aim is to find the optimal mix of user-friendly, high-level, and safe programming in Python with more detailed and more error-prone low-level programming in compiled languages. In particular, we present and evaluate Cython, which is a new software tool that combines high- and low-level programming in an attractive way with promising performance. Cython is compared to more well-known tools such as F2PY, Weave, and Instant. With the mentioned tools, Python has a significant potential as programming platform in computational mechanics.

Citation KeySimula.SC.578