Back to Search Start Over

Formula translation in Blitz++, NumPy and modern Fortran: A case study of the language choice tradeoffs.

Authors :
Arabas, Sylwester
Jarecka, Dorota
Jaruga, Anna
Fijałkowski, Maciej
Source :
Scientific Programming; 2014, Vol. 22 Issue 3, p201-222, 22p
Publication Year :
2014

Abstract

Three object-oriented implementations of a prototype solver of the advection equation are introduced. The presented programs are based on Blitz++ (C++), NumPy (Python) and Fortran's built-in array containers. The solvers constitute implementations of the Multidimensional Positive-Definite Advective Transport Algorithm (MPDATA). The introduced codes serve as examples for how the application of object-oriented programming (OOP) techniques and new language constructs from C++11 and Fortran 2008 allow to reproduce the mathematical notation used in the literature within the program code. A discussion on the tradeoffs of the programming language choice is presented. The main angles of comparison are code brevity and syntax clarity (and hence maintainability and auditability) as well as performance. All performance tests are carried out using free and open-source compilers. In the case of Python, a significant performance gain is observed when switching from the standard interpreter (CPython) to the PyPy implementation of Python. Entire source code of all three implementations is embedded in the text and is licensed under the terms of the GNU GPL license. [ABSTRACT FROM AUTHOR]

Details

Language :
English
ISSN :
10589244
Volume :
22
Issue :
3
Database :
Complementary Index
Journal :
Scientific Programming
Publication Type :
Academic Journal
Accession number :
96923300
Full Text :
https://doi.org/10.1155/2014/870146