The field of plasma physics heavily relies on simulations to model various phenomena, such as instabilities, turbulence, and nonlinear behaviors that would otherwise be difficult to study from a purely theoretical approach. Simulations are fundamental in accurately setting up experiments, which can be extremely costly and complex. As high-fidelity tools, gyrokinetic simulations play a crucial role in discovering new physics, interpreting experimental results, and improving the design of next-generation devices. However, their high computational costs necessitate the use of acceleration platforms to reduce execution time. This work revolves around the TRIangular MEsh based Gyrokinetic (TRIMEG) code, which performs high-accuracy particle-in-cell plasma simulations in tokamak geometries, leveraging a novel finite element approach. The rise of graphical processing units (GPUs) constitutes an occasion to satisfy such computational needs, by offloading the most expensive portion of the code to the accelerators. The chosen approach features GPU offloading with the OpenMP API, which grants portability of the code to different architectures, namely AMD and NVIDIA. The particle pushing as well as the grid-to-particle operations have been ported to GPU platforms. Compiler limitations had to be overcome, and portions of the code were restructured to be suitable for GPU acceleration. The kernels were analyzed with the available profiling tools to gather metrics about resource occupancy and memory usage. Their performance was evaluated by carrying out GPU grid size exploration, as well as scalability studies. In addition, the efficiency of hybrid MPI-OpenMP offloading parallelization was assessed. The speedup of the GPU implementation was calculated by comparing it with the pure CPU version using different rationales. The Ion Temperature Gradient (ITG) mode was simulated using the GPU-accelerated version, and its correctness was verified by comparing the physics results in terms of the energy growth rate and the two-dimensional mode structures.
Il campo della fisica del plasma necessita di simulazioni numeriche per modellare fenomeni rilevanti come instabilità e turbolenze, difficili da studiare con un approccio puramente teorico. Le simulazioni hanno un ruolo cruciale nell'impostare gli esperimenti, spesso complessi e costosi. In virtù della loro precisione, le simulazioni girocinetiche sono fondamentali per scoprire nuovi fenomeni fisici, interpretare i risultati sperimentali e migliorare il design dei reattori. Ciononostante, il loro elevato costo computazionale richiede l'utilizzo di piattaforme per accelerare il codice e ridurre il tempo di esecuzione. Questo lavoro è basato sul codice TRIangular MEsh based Gyrokinetic (TRIMEG), che effettua simulazioni del plasma ad alta accuratezza tramite il metodo particle-in-cell in geometrie tokamak. L'avvento delle graphical processing units (GPUs) costituisce un'occasione fondamentale per soddisfare i requisiti computazionali, effettuando offloading della parte più onerosa del codice sugli acceleratori. Questo lavoro implementa una soluzione accelerata su GPU con OpenMP e portabile su architetture NVIDIA a AMD. Le operazioni di evoluzione delle particelle e particella-griglia sono state adattate per l'esecuzione su GPU. Durante il processo è stato necessario gestire le limitazioni dei compilatori, che hanno richiesto una ristrutturazione di porzioni del codice. I kernel sono stati analizzati con gli strumenti di profiling disponibili, al fine di raccogliere metriche di valutazione delle prestazioni. Inoltre, le prestazioni sono state vagliate effettuando esplorazione della griglia su GPU, studi di scalabilità e valutazione dell'efficienza di un approccio ibrido MPI-OpenMP offloading. L'accelerazione (speedup) dell'implementazione GPU è stato calcolato comparandola con la versione originale utilizzando diverse strategie. L'instabilità Ion Temperature Gradient (ITG) è stata simulata utilizzando la versione accelerata su GPU e la sua correttezza è stata verificata comparando i risultati fisici con la versione originale in termini di rateo di crescita dell'energia e struttura bidimensionale dei modi.
GPU acceleration and portability of the TRIMEG code for gyrokinetic plasma simulations using OpenMP
DANERI, GIORGIO
2024/2025
Abstract
The field of plasma physics heavily relies on simulations to model various phenomena, such as instabilities, turbulence, and nonlinear behaviors that would otherwise be difficult to study from a purely theoretical approach. Simulations are fundamental in accurately setting up experiments, which can be extremely costly and complex. As high-fidelity tools, gyrokinetic simulations play a crucial role in discovering new physics, interpreting experimental results, and improving the design of next-generation devices. However, their high computational costs necessitate the use of acceleration platforms to reduce execution time. This work revolves around the TRIangular MEsh based Gyrokinetic (TRIMEG) code, which performs high-accuracy particle-in-cell plasma simulations in tokamak geometries, leveraging a novel finite element approach. The rise of graphical processing units (GPUs) constitutes an occasion to satisfy such computational needs, by offloading the most expensive portion of the code to the accelerators. The chosen approach features GPU offloading with the OpenMP API, which grants portability of the code to different architectures, namely AMD and NVIDIA. The particle pushing as well as the grid-to-particle operations have been ported to GPU platforms. Compiler limitations had to be overcome, and portions of the code were restructured to be suitable for GPU acceleration. The kernels were analyzed with the available profiling tools to gather metrics about resource occupancy and memory usage. Their performance was evaluated by carrying out GPU grid size exploration, as well as scalability studies. In addition, the efficiency of hybrid MPI-OpenMP offloading parallelization was assessed. The speedup of the GPU implementation was calculated by comparing it with the pure CPU version using different rationales. The Ion Temperature Gradient (ITG) mode was simulated using the GPU-accelerated version, and its correctness was verified by comparing the physics results in terms of the energy growth rate and the two-dimensional mode structures.| File | Dimensione | Formato | |
|---|---|---|---|
|
2025_10_Daneri.pdf
accessibile in internet per tutti
Dimensione
2.82 MB
Formato
Adobe PDF
|
2.82 MB | Adobe PDF | Visualizza/Apri |
|
2025_10_Daneri_Executive_Summary.pdf
accessibile in internet per tutti
Descrizione: Executive Summary
Dimensione
469.47 kB
Formato
Adobe PDF
|
469.47 kB | Adobe PDF | Visualizza/Apri |
I documenti in POLITesi sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.
https://hdl.handle.net/10589/242959