Improving Fusion Codes at the CIEMAT-BSC Advanced Computing Hub

As fusion research moves towards increasingly complex simulations, having access to powerful supercomputers is only one part of the challenge. The scientific codes used to study plasma behaviour must also be capable of taking full advantage of these machines. Many of these fusion codes have been developed over decades, originally targeting CPU-based systems, and adapting them to modern architectures with GPUs is not always straightforward.

At the Barcelona Supercomputing Center (BSC), the CIEMAT-BSC Advanced Computing Hub (ACH) works alongside fusion code developers to address these challenges. Established within the EUROfusion framework, the ACH brings together expertise in fusion physics, high-performance computing (HPC), and software engineering to improve the performance, portability, and reliability of fusion simulation codes.

Our latest paper, entitled “The CIEMAT-BSC Advanced Computing Hub for Fusion Codes: Current Scope and Lessons Learned“, published in Applied Sciences, presents some of our recent work and the experience gained from adapting fusion applications to modern HPC systems.

Since the creation of the ACH in 2021, our activities have expanded beyond traditional code optimization and GPU porting. Today, they also include evaluating numerical libraries, analyzing memory usage, identifying compiler-related issues, and measuring energy efficiency. These tasks are becoming increasingly important as supercomputers evolve and fusion simulations become more demanding.

In the paper, we focus on four fusion codes, each presenting different computational challenges:

  • BIT1: This particle-in-cell code was ported to GPUs using OpenACC, with the goal of improving performance while keeping the code accessible to developers without extensive GPU programming experience. After several optimizations, the GPU version achieved a speedup of nearly 7× compared with the original four-MPI-task CPU configuration. An important lesson was that accelerating individual routines is not enough: reducing data transfers between CPUs and GPUs is essential to improve the performance of the entire application.
  • JOREK: Our work focused on evaluating alternative numerical solvers to support more detailed three-dimensional models of the conducting structures surrounding fusion plasmas. The ELPA2 library achieved up to 3× faster execution than ScaLAPACK in selected CPU benchmarks. However, these improvements came with higher memory requirements, highlighting the importance of considering both computing time and memory consumption when selecting numerical libraries.
  • Alya/NEUTRO: The NEUTRO module was adapted to GPUs to accelerate neutron transport simulations. Besides improving execution time, we also investigated energy efficiency, an increasingly relevant aspect of HPC. In the benchmark presented, the GPU version ran approximately 20% faster and consumed 2.6 times less energy than the tested CPU configuration, showing that GPU acceleration can offer benefits beyond execution speed.
  • SOLPS-ITER: Unlike the previous cases, this work focused on improving CPU performance. By adjusting compiler options, optimizing thread placement, and introducing changes to the source code, we achieved significant improvements. Compiler and thread-affinity optimizations alone reduced execution time by up to 39% in the tested configurations. The work also involved identifying and addressing issues related to compilers, parallel execution, and software compatibility.

    SOLPS-ITER: Performance comparison with compiler options and thread affinity.

Although the four codes required different approaches, they share an important lesson: improving scientific software is not simply about making it run faster. An optimization that works well for one routine may introduce new bottlenecks elsewhere. Similarly, moving a code to a new architecture requires careful testing to ensure that the scientific results remain reliable.

As HPC systems continue to evolve, these challenges will become even more relevant. The experience presented in our paper shows how the ACHs contribute not only to improving existing fusion codes, but also to preparing them for future computing architectures. Ultimately, this work helps researchers carry out more complex and efficient simulations, supporting the development of fusion energy.

Alya/NEUTRO: Total power consumption and time of the GPU and CPU versions.

For more details on the methods, results, and lessons learned, you can read the full paper available here.

Acknowledgments: This work has been carried out within the framework of the EUROfusion Consortium, funded by the European Union via the Euratom Research and Training Program (Grant Agreement No 101052200—EUROfusion). Views and opinions expressed are, however, those of the author(s) only and do not necessarily reflect those of the European Union or the European Commission. Neither the European Union nor the European Commission can be held responsible for them. Ezequiel Goldberg and Gaurav Saxena’s AI4S fellowships within the “Generación D” initiative, Red.es, Ministerio para la Transformación Digital y de la Función Pública, for talent attraction (C005/24-ED CV1), are funded by the European Union NextGenerationEU funds, through PRTR. In addition, the work has been partly co-financed by grant PID2023-148038OB-I00 funded by MICIU/AEI/10.13039/501100011033/.

Leave a Comment