Abstract

f90wrap is a tool to automatically generate Python extension modules which interface to Fortran libraries that makes use of derived types. It builds on the capabilities of the popular f2py utility by generating a simpler Fortran 90 interface to the original Fortran code which is then suitable for wrapping with f2py, together with a higher-level Pythonic wrapper that makes the existance of an additional layer transparent to the final user. f90wrap has been used to wrap a number of large software packages of relevance to the condensed matter physics community, including the QUIP molecular dynamics code and the CASTEP density functional theory code.

Highlights

  • Modern scienti c computing relies on the existence of many well-documented software libraries

  • It builds on the capabilities of the popular f2py utility by generating a simpler Fortran 90 interface to the original Fortran code which is suitable for wrapping with f2py, together with a higher-level Pythonic wrapper that makes the existance of an additional layer transparent to the nal user. f90wrap has been used to wrap a number of large software packages of relevance to the condensed matter physics community, including the quantum mechanics and interatomic potentials (QUIP) molecular dynamics code and the CASTEP density functional theory code

  • This article has motivated the case for exposing deep interface to Fortran codes to Python and analysed the bene ts, as well as reviewing the f90wrap package which provides a practical tool to realise this ambition

Read more

Summary

Introduction

Modern scienti c computing relies on the existence of many well-documented software libraries. Outputs from codes run at HPC centres are typically stored in human-readable format to a text le or, increasingly, in structured formats such as XML, JSON and HDF5 before transferring to a workstation for subsequent analysis While this traditional mode of operation has served the scienti c community well for decades, it has become clear that by adopting a more modern approach, in which the codes serve as software engines tied into a larger and heterogeneous production environment, both the ease and the rate of gaining new functionality would be much higher, meaning that the real world impact of simulation codes could be signi cantly enhanced. While the task of Fortran-to-Python interface generation addressed in this article is general to a wide range of computational modelling domains, the examples presented fall within the condensed matter physics/materials modelling domain. The challenges and solution methods discussed here are still applicable to a much wider domain of application

File-based interfaces
Deep scripting interfaces
Usage and features of f90wrap
Methodology
Additional features
Limitations
Wrapping the QUIP and GAP codes
Findings
Discussion and conclusion
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call