Making Fortran Legacy Code More Functional: Using the BGS Geomagnetic Field Modelling System As an Example

H.-N. Vießmann, S.-B. Scholz, A. Šinkarovs, B. Bainbridge, B. Hamilton, and S. Flower, “Making fortran legacy code more functional: Using the BGS geomagnetic field modelling system as an example,” in Proceedings of the 27th symposium on the implementation and application of functional programming languages, Sep. 2015, pp. 11:1–11:13. doi: 10.1145/2897336.2897348.

[URL] [BibTeX]

Abstract

This paper presents an application case study of the British Geological Survey’s (BGS) Geomagnetic Field Modelling System code. The program consists of roughly 20000 lines of highly-tuned Fortran MPI code that has a runtime of about 12 hours for a signal execution cycle on a cluster utilising approximately 100 CPU cores. The program contains a sequential bottleneck that executes on a single node of the cluster and takes up to 50% of the overall runtime. We describe an experiment in which we rewrote the bottleneck Fortran code in SaC, to make use of auto-parallelisation provided by the SaC compiler. The paper also presents an implementation of a foreign-function interface, to link the SaC kernel with the Fortran application. Our initial performance measurements compare the SaC kernel performance with the Fortran bottleneck code; we also present results using an OpenMP Fortran implementation. Our figures show that the SaC-based implementation achieves roughly a 12.5% runtime improvement, and outperforms the OpenMP implementation.