ESiWACE Deliverable D2.4 - Report on DSL development in NEMO and IFS-FVM

Weather and climate models have very large code bases, which makes porting them to heterogeneous hardware with accelerators such as GPUs difficult. DSLs separate the scientific formulation of a model from its hardware-specific optimisation and thereby allow a single source code to run efficiently on CPUs and GPUs. This deliverable concludes the work on two domain-specific languages (DSLs) efforts that have been pursued in Task 2.2: PSyclone, a source-to-source code generation and transformation tool applied to the Fortran code of NEMO, and GT4Py (GridTools for Python), a Python framework applied to the IFS-FVM dynamical core. It summarises the progress achieved since the first report on this task (ESiWACE3 D2.3, 2024) and documents performance comparisons. The work has been carried out by the Euro-Mediterranean Center on Climate Change (CMCC) and the European Centre for Medium-Range Weather Forecasts (ECMWF), in collaboration with the Swiss National Supercomputing Centre (CSCS), ETH Zurich, MeteoSwiss and the Science and Technology Facilities Council (STFC) in the UK. For NEMO, the PSyclone DSL has been used to automatically generate OpenACC GPU-offloading directives for both the MED24 Mediterranean Sea configuration and the global high-resolution GLOB16 configuration (NEMO v5.0). The approach was tested on CMCC’s Juno cluster, with its portability also confirmed on the EuroHPC JU JUPITER system. Since PSyclone’s generic transformations alone do not fully address certain performance limitations — such as repeated array allocation and deallocation, data-residency management, and compiler-specific restrictions that may limit performance or prevent GPU offloading altogether — CMCC developed a configuration-specific transformation workflow based on the PSyclone API. Four different modifications were applied, each independently validated on the cluster in terms of both performance and bit-reproducibility: (i) moving routine-local arrays from per-call allocation to persistent GPU-resident storage; (ii) introducing structured OpenACC data regions at the routine level; (iii) a source-code fix enabling PSyclone to offload the TKE turbulence-closure routine, previously excluded; and (iv) a source-code fix enabling PSyclone to offload the barotropic sub-cycle driver, previously excluded. Taken together, these four modifications reduced the runtime of the NEMO MED24 configuration by 21.3%- measured on a representative benchmark on a single node of CMCC’s Juno cluster (2 NVIDIA A100 GPUs, 20 model time steps) - compared with the unoptimized GPU code generated by PSyclone. This result demonstrates that targeted, configuration-specific tuning applied on top of PSyclone’s generic transformations can deliver substantial performance improvements in GPU offloading; Section 3 shows the improvement holds consistently from 1 to 4 GPUs, and Section 4 confirms it is portable to JUPITER. For IFS-FVM, the dynamical core has been rewritten entirely in Python using GT4Py. The rewritten model is called PMAP (Portable Model for multi-scale Atmospheric Prediction). A global configuration of PMAP operates on the horizontally unstructured octahedral grid of the operational IFS and uses the new gt4py.next version of the DSL. Within ESiWACE3 we have contributed substantially to gt4py.next itself, most notably to the redesign of its intermediate representation (from ITIR to GTIR), to new frontend features, and to toolchain optimisations. The global PMAP now runs distributed on multi-GPU systems using the GHEX halo-exchange library, reproduces the Fortran FVM reference, and shows good weak scaling from 4 to 512 NVIDIA GH200 GPUs on the Alps system at CSCS. Together with the regional PMAP configuration, portability has been demonstrated across Europe’s largest GPU systems, including LUMI (AMD GPUs), JUPITER and Alps (NVIDIA GPUs).

Authors

Institutions

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-11-30
DOI
https://doi.org/10.5281/zenodo.24690670
Primary Topic
Parallel Computing and Optimization Techniques
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
article

ESiWACE Deliverable D2.4 - Report on DSL development in NEMO and IFS-FVM

Francesca Mele, Sara Faghih-Naini, Peter D. Düben, Italo Epicoco et al.
Zenodo (CERN European Organization for Nuclear Research)
Parallel Computing and Optimization Techniques
article

ESiWACE Deliverable D2.4 - Report on DSL development in NEMO and IFS-FVM

Francesca Mele, Sara Faghih-Naini, Peter D. Düben, Italo Epicoco, Christian Kühnlein
article en

Abstract

Weather and climate models have very large code bases, which makes porting them to heterogeneous hardware with accelerators such as GPUs difficult. DSLs separate the scientific formulation of a model from its hardware-specific optimisation and thereby allow a single source code to run efficiently on CPUs and GPUs. This deliverable concludes the work on two domain-specific languages (DSLs) efforts that have been pursued in Task 2.2: PSyclone, a source-to-source code generation and transformation tool applied to the Fortran code of NEMO, and GT4Py (GridTools for Python), a Python framework applied to the IFS-FVM dynamical core. It summarises the progress achieved since the first report on this task (ESiWACE3 D2.3, 2024) and documents performance comparisons. The work has been carried out by the Euro-Mediterranean Center on Climate Change (CMCC) and the European Centre for Medium-Range Weather Forecasts (ECMWF), in collaboration with the Swiss National Supercomputing Centre (CSCS), ETH Zurich, MeteoSwiss and the Science and Technology Facilities Council (STFC) in the UK. For NEMO, the PSyclone DSL has been used to automatically generate OpenACC GPU-offloading directives for both the MED24 Mediterranean Sea configuration and the global high-resolution GLOB16 configuration (NEMO v5.0). The approach was tested on CMCC’s Juno cluster, with its portability also confirmed on the EuroHPC JU JUPITER system. Since PSyclone’s generic transformations alone do not fully address certain performance limitations — such as repeated array allocation and deallocation, data-residency management, and compiler-specific restrictions that may limit performance or prevent GPU offloading altogether — CMCC developed a configuration-specific transformation workflow based on the PSyclone API. Four different modifications were applied, each independently validated on the cluster in terms of both performance and bit-reproducibility: (i) moving routine-local arrays from per-call allocation to persistent GPU-resident storage; (ii) introducing structured OpenACC data regions at the routine level; (iii) a source-code fix enabling PSyclone to offload the TKE turbulence-closure routine, previously excluded; and (iv) a source-code fix enabling PSyclone to offload the barotropic sub-cycle driver, previously excluded. Taken together, these four modifications reduced the runtime of the NEMO MED24 configuration by 21.3%- measured on a representative benchmark on a single node of CMCC’s Juno cluster (2 NVIDIA A100 GPUs, 20 model time steps) - compared with the unoptimized GPU code generated by PSyclone. This result demonstrates that targeted, configuration-specific tuning applied on top of PSyclone’s generic transformations can deliver substantial performance improvements in GPU offloading; Section 3 shows the improvement holds consistently from 1 to 4 GPUs, and Section 4 confirms it is portable to JUPITER. For IFS-FVM, the dynamical core has been rewritten entirely in Python using GT4Py. The rewritten model is called PMAP (Portable Model for multi-scale Atmospheric Prediction). A global configuration of PMAP operates on the horizontally unstructured octahedral grid of the operational IFS and uses the new gt4py.next version of the DSL. Within ESiWACE3 we have contributed substantially to gt4py.next itself, most notably to the redesign of its intermediate representation (from ITIR to GTIR), to new frontend features, and to toolchain optimisations. The global PMAP now runs distributed on multi-GPU systems using the GHEX halo-exchange library, reproduces the Fortran FVM reference, and shows good weak scaling from 4 to 512 NVIDIA GH200 GPUs on the Alps system at CSCS. Together with the regional PMAP configuration, portability has been demonstrated across Europe’s largest GPU systems, including LUMI (AMD GPUs), JUPITER and Alps (NVIDIA GPUs).

Zenodo (CERN European Organization for Nuclear Research)
University of Salento (IT), European Centre for Medium-Range Weather Forecasts (GB), CMCC Foundation - Euro-Mediterranean Center on Climate Change (IT)
Parallel Computing and Optimization Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon