Decoupling Performance and Flexibility Within hms++: A User-Friendly Shallow Water Equations Solver with Advanced CPU Optimisations and an Extensible Design
摘要
The design of a hydrodynamic modelling tool called hms++ is detailed, with an emphasis on addressing key concerns for research software. These are identified as high performance on heterogeneous hardware, flexibility and extensibility of the model, ease of use for non-developers, and low maintenance requirements. By employing the linear algebra library ‘Eigen’, equations and solution algorithms in hms++ can be expressed as succinct, readable source code, while compiling to highly optimised operations on a variety of platforms. This serves as the base for a flexible framework for the finite volume method with multiple mesh types, and a solver for the shallow water equations (SWE). This solver is shown to be both accurate and highly scalable, with test cases involving more than a billion cells on 256 compute nodes, using hybrid MPI/OpenMP parallelisation, as well as vectorisation. Finally, a plugin mechanism is described, which loads program extensions at runtime, providing extensibility while minimising the need for modifications to the core code. Several existing plugins are presented, which fulfil functions ranging from implementing additional source terms, streaming data to other programs, or facilitating two-way couplings with other hydrological models.