Florian Rathgeber1, Lawrence Mitchell1, David Ham1,2, Michael Lange3, Andrew McRae2, Fabio Luporini1, Gheorghe-teodor Bercea1, Paul Kelly1
1 Department of Computing, Imperial College London 2 Department of Mathematics, Imperial College London 3 Department of Earth Science & Engineering, Imperial College London]
Slides from my talk at the EuroSciPy, Cambridge, UK, August 29-30 2014: https://kynan.github.io/EuroSciPy2014
In an ideal world, scientific applications are computationally efficient, maintainable, composable and allow scientists to work very productively. In this talk we demonstrate that these goals are achievable for a specific application domain by choosing suitable domain-specific abstractions implemented in Python that encapsulate domain knowledge with a high degree of expressiveness.
We present a Firedrake, a high-level Python framework for the portable solution of partial differential equations on unstructured meshes with the finite element method widely used in science and engineering. Firedrake is built on top of PyOP2, a domain-specific language embedded in Python for parallel mesh-based computations. Finite element local assembly operations execute the same computational kernel for every element of the mesh and is therefore efficiently parallelisable.
Firedrake allows scientists to describe variational forms and discretisations for finite element problems symbolically in a notation very close to the maths using the Unified Form Language UFL from the FEniCS project. Variational forms are translated into computational kernels by the FEniCS Form Compiler FFC. Numerical linear algebra is delegated to PETSc, leveraged via its petsc4py interface.
PyOP2 abstracts away the performance-portable parallel execution of these kernels on a range of hardware architectures, targeting multi-core CPUs with OpenMP and GPUs and accelerators with PyCUDA and PyOpenCL and distributed parallel computations with mpi4py. Backend-specific code tailored to each specific computation is generated, just-in-time compiled and efficiently scheduled for parallel execution at runtime.
Due to the composability of the Firedrake and PyOP2 abstractions, optimised implementations for different hardware architectures can be automatically generated without any changes to a single high-level source. Performance matches or exceeds what is realistically attainable by hand-written code. Both projects are open source and developed at Imperial College London.
- PyOP2
- PyOP2: A High-Level Framework for Performance-Portable Simulations on Unstructured Meshes Florian Rathgeber, Graham R. Markall, Lawrence Mitchell, Nicholas Loriant, David A. Ham, Carlo Bertolli, Paul H.J. Kelly, WOLFHPC 2012
- Performance-Portable Finite Element Assembly Using PyOP2 and FEniCS Graham R. Markall, Florian Rathgeber, Lawrence Mitchell, Nicolas Loriant, Carlo Bertolli, David A. Ham, Paul H. J. Kelly , ISC 2013
- Firedrake
- Cross-Loop Optimization of Arithmetic Intensity for Finite Element Local Assembly Fabio Luporini, Ana Lucia Varbanescu, Florian Rathgeber, Gheorghe-Teodor Bercea, J. Ramanujam, David A. Ham, Paul H. J. Kelly, ACM Transactions on Architecture and Code Optimization, January 2015
- UFL
- FFC