IN003-09
Separating physics and performance: Using Python to implement a fast and maintainable FV3 dynamical core

Monday, 7 December 2020: 07:24
Virtual
Oliver Elbert1, Rhea George1, Mark Cheeseman1, Johann Dahm1, Eddie Davis1, Jeremy McGibbon2, Tobias Wicky1, Oliver Fuhrer3, Lucas Harris4, Linus Groner5 and Enrique Gonzalez Paredes5, (1)Vulcan, Climate Modeling, Seattle, WA, United States, (2)Vulcan, Inc., Climate Modeling, Seattle, WA, United States, (3)Vulcan, Climate Modeling, Seattle, United States, (4)NOAA/Geophysical Fluid Dynamics Laboratory, Princeton, NJ, United States, (5)CSCS Swiss National Supercomputing Centre, Lugano, Switzerland
Abstract:
The increasing power and efficiency of emerging supercomputers is a boon to climate science; long-term global cloud-resolving simulations are coming into reach and are a promising avenue to reduce the uncertainty of global climate projections. However, most global climate models have been optimized for performance on a specific hardware architecture, and typically cannot run efficiently on GPUs without extensive effort that increases the complexity of the code. Decoupling the expression of the numerical algorithm from hardware specific optimization improves the maintainability of a climate model and makes it easier to achieve high performance on a variety of hardware architectures. Such a separation of concerns is possible using a domain-specific language (DSL) embedded in a high-level programming language such as Python and a compiler toolchain ensuring the generation of high-performance code. The DSL approach also reduces the need for optimization in the user-facing code and allows for the use of abstractions such as function calls without a performance penalty, increasing code reusability and concision. To demonstrate the potential of this strategy we will present our work on a Python implementation of the Finite-Volume Cubed-Sphere (FV3) dynamical core, backed by the GT4Py DSL, which provides access to the Dawn compiler toolchain. We will show our ability to achieve good performance on multiple architectures and discuss our approach to porting the Fortran code to this framework, including the design decisions, testing strategy and infrastructure that enabled the effort, as well as lessons learned.