Code generation and a domain-specific language for Riemann solvers

Modern numerical methods for hyperbolic conservation laws rely heavily on the use of approximate Riemann solvers in order to deal with discontinuities (shock waves) that arise in solutions. Indeed, the Riemann solver is usually the only part of the code that needs to be changed in order to model different physical wave phenomena like sound waves, water waves electromagnetic waves, and compressible fluids.

It is therefore highly desirable to encapsulate the Riemann solver routine behind a modular interface that separates it from the rest of the code. This naturally leads to the possibility of also hiding the details of the Riemann solver implementation, and automatically adapting them for the solution of different equations or for efficient computation on different architectures. Indeed, many Riemann solvers exhibit high arithmetic intensity and are therefore ideally suited to implementation on GPUs and manycore architectures in which memory bandwidth and latency are the primary bottlenecks.

This project aims to develop a domain-specific language for Riemann solvers, and use that language as the basis for automatic code generation in order to enable

  • Rapid prototyping of new applications by the use of a simple, intuitive interface for specifying a system of hyperbolic conservation laws
  • Fast solution computation on GPU and manycore architectures
Some initial work in this direction has been created in the form of Andy Terrel's ignition package, but the existing implementation has only very basic capabilities and is not properly incorporated into a complete conservation law solver. This project will involve fleshing out the domain-specific language, implementing a capability for generating linear and nonlinear Riemann solvers compatible with Clawpack, and creating backends that generate performant code on selected architectures. The resulting tool will offer both faster application development and better performance than existing software for hyperbolic conservation laws.


© 2011 David Ketcheson and Matteo Parsani
Site design based on a template from Andreas Viklund