One of the aims of WP2 of ESCAPE-2 is to define, develop and apply a domain-specific language (DSL) toolchain applicable to a comprehensive list of algorithmic motifs (dwarfs) in weather and climate prediction. Domain specific languages are powerful tools that provide programming environments that allow to write numerical scientific algorithms in a concise and high level language.
The weather and climate domain is characterized by very specific algorithmic motifs derived from the discretization of the numerical methods employed in the mathematical models, the specific aspect ratio of horizontal to vertical grids in regional and global models, and the use of sub-gridscale parametrization characterized by different algorithmic patterns.
This motivates the development of a description suitable for these specific domain characteristics, using a highly concise and readable language. Details such as explicit loops, ordering of the loop nest, data layout or optimizations such as tiling are hardware specific optimizations that are abstracted away from such a high-level language. Among other things, the DSL language is abstracting away all the details of an efficient parallel implementation and the hardware dependent programming models and optimizations. There are several examples of DSLs being developed and applied to production weather and climate models, like COSMO GridTools (Gysi et al, 2015), the PSyclone for the LFRic model (Adams et al) or the CLAW DSL for column based parameterizations (Clement et al).
In contrast to the existing approaches, that are normally specifically developed for a particular model, the ESCAPE-2 DSL aims at developing a modular toolchain, that supports a wide range of models, numerical methods and grids, by adopting a modular design where domain specific frontends or optimizers can be easily incorporated into the toolchain. Additionally, most of the existing approaches provide a prescriptive language, where the user still has to provide information crucial for parallelization of the algorithm and to obtain good performance. Instead the goal of this document is to provide a high-level descriptive language where the algorithms are described in a sequential manner. The parallelization and optimization implementations are derived by the set of optimizers incorporated in the toolchain.
The objectives of this deliverable are:
- Identify the most common computational patterns used by weather and climate models of the ESCAPE-2 project.
- Define a first definition of a DSL language specification, as a set of language elements that can be used to express the algorithmic motifs of the models in a high-level descriptive manner, removing all the boiler plate and hardware dependent implementations.
- The language elements will also serve as a first definition of the interface layer, HIR, (D2.3) between a DSL frontend and the DSL toolchain. Therefore, the language elements should contain the appropriate functionality and level of abstraction to support the expressiveness and usability of the DSL frontend on the one side and the analysis and optimizations of the toolchain on the other side.