Media hub‎ > ‎ESCAPE-2 News‎ > ‎

Definition of a Domain Specific Language for weather and climate prediction

posted 12 Apr 2019, 04:29 by Daniel Thiemert   [ updated 12 Apr 2019, 04:31 ]
DSL Tool Chain
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 (Gysiet 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 recently finalized deliverable D2.1 "High-level domain-specific language (DSL) specification" presents a first definition of a high-level DSL language that is capable of supporting most of the computational patterns present in the models that participate in the ESCAPE-2 project. The document is the outcome of an iterative process and discussions between DSL experts and key model developers. It delivers an extensive and comprehensive grammar, from a holistic perspective where the aim is to provide a unified standard language and HIR (High-level intermediate representation) definition that can deal with a broad spectrum of methods and models. The proposal is a change of paradigm and current state of the art of abstractions and DSLs, where the established tools support only a restricted set of methods or models.

The grammar defined in this document will be the basis of a DSL frontend (D2.2, September 2019) and toolchain implementation (D2.5 May 2021) that will be demonstrated in a set of dwarfs with representative computations from the different models that participate in the project (D2.4 September 2020).