Grid Tools: Towards a library for hardware oblivious implementation of stencil based codes
PI: Oliver Fuhrer (MeteoSwiss)
Co-PIs: Mauro Bianco, Isabelle Bey, Christoph Schär
January 1, 2014 - December 31, 2016
Project Summary
Climate change is one of the most pressing social and economic issues currently facing humankind, but also one of the most complex scientific challenges. Over the last decades, numerical models have become a central methodological element of weather and climate research. Representing key aspects of the climate system will require much higher computational resolution than available today. Ensemble simulations will help quantifying the associated uncertainties. Climate and weather codes typically comprise well over O(100000) lines of code and are developed and applied by large communities. Disruptive changes in high-performance computing architectures (or the associated programming paradigms) have always been a challenge for these codes. There are three fundamental problems:
- Firstly, the effort to adapt the code to new hardware architectures is significant and long compared to the typical release cycle of processors.
- Secondly, optimizations for one target often incur performance penalties on other hardware architectures.
- Thirdly, such codes in Europe are typically developed by domain scientists, which typically lack the expertise to optimize codes for a specific target.
The results of two previous projects within the High Performance High Productivity (HP2C) Initiative have shown that a possible way out of this deadlock situation can be achieved through a fundamental change in programming paradigm for weather and climate codes. By implementing the dynamical core of the COSMO model using a domain-specific embedded language (DSEL) named STELLA, a separation of concerns could be achieved: the domain scientist has only to implement the algorithm using the DSEL, while the computer scientist can optimized the code to a specific hardware architecture by implementing a STELLA backend. An application built on top of STELLA could thus be adapted to future and emerging hardware architectures in a relatively short time, since only a limited part of the code had to be modified by a computer scientist, which does not have to understand the details of the algorithms employed in the application.
Building on the success of these previous projects, we now propose to take the next leap forward and to develop a domain specific library applicable to stencil codes. STELLA was specifically designed for the dynamical core of the COSMO model but lacked the generality to be applicable to other applications with similar algorithmic motifs (stencils on structured grids). In this project, we seek to generalize key concepts of the library and make significant improvements in terms of its usability. To this end, we will develop the grid tools library. In order to demonstrate the wide potential applicability of the library, we target three applications from different domains (regional climate modeling, global climate modeling, seismic wave propagation).
The project is structured into three tasks: Task 1 will make continuous improvements of the STELLA library. The scope of the modifications encompasses improvements in usability, facilitating development and debugging for library users, allowing for non-regular data-accesses, and performance improvements. Task 2 comprises the design, implementation and testing of the grid tools library. After an initial design phase, a first structured grid version will be developed and tested with a set of stencils extracted from the target applications. In a third stage, the grid tools library will be extended to block-structured or unstructured grids. Task 3 will focus on the porting of suitable parts of the target applications using the grid tools library. The goal of this task is to demonstrate the wide potential of the grid tools library by applying it to a selected set of key applications from two different domains.