Efficient magnetohydrodynamic simulations on graphics processing units with CUDA

Reading time: 6 minute
...

📝 Abstract

Magnetohydrodynamic (MHD) simulations based on the ideal MHD equations have become a powerful tool for modeling phenomena in a wide range of applications including laboratory, astrophysical, and space plasmas. In general, high-resolution methods for solving the ideal MHD equations are computationally expensive and Beowulf clusters or even supercomputers are often used to run the codes that implemented these methods. With the advent of the Compute Unified Device Architecture (CUDA), modern graphics processing units (GPUs) provide an alternative approach to parallel computing for scientific simulations. In this paper we present, to the author’s knowledge, the first implementation of MHD simulations entirely on GPUs with CUDA, named GPU-MHD, to accelerate the simulation process. GPU-MHD supports both single and double precision computation. A series of numerical tests have been performed to validate the correctness of our code. Accuracy evaluation by comparing single and double precision computation results is also given. Performance measurements of both single and double precision are conducted on both the NVIDIA GeForce GTX 295 (GT200 architecture) and GTX 480 (Fermi architecture) graphics cards. These measurements show that our GPU-based implementation achieves between one and two orders of magnitude depending on the used graphics card, problem size, and precision when comparing to the original serial CPU MHD implementation. In addition, we extend GPU-MHD to support the visualization of the simulation results and thus the whole MHD simulation and visualization process can be performed entirely on GPUs.

💡 Analysis

Magnetohydrodynamic (MHD) simulations based on the ideal MHD equations have become a powerful tool for modeling phenomena in a wide range of applications including laboratory, astrophysical, and space plasmas. In general, high-resolution methods for solving the ideal MHD equations are computationally expensive and Beowulf clusters or even supercomputers are often used to run the codes that implemented these methods. With the advent of the Compute Unified Device Architecture (CUDA), modern graphics processing units (GPUs) provide an alternative approach to parallel computing for scientific simulations. In this paper we present, to the author’s knowledge, the first implementation of MHD simulations entirely on GPUs with CUDA, named GPU-MHD, to accelerate the simulation process. GPU-MHD supports both single and double precision computation. A series of numerical tests have been performed to validate the correctness of our code. Accuracy evaluation by comparing single and double precision computation results is also given. Performance measurements of both single and double precision are conducted on both the NVIDIA GeForce GTX 295 (GT200 architecture) and GTX 480 (Fermi architecture) graphics cards. These measurements show that our GPU-based implementation achieves between one and two orders of magnitude depending on the used graphics card, problem size, and precision when comparing to the original serial CPU MHD implementation. In addition, we extend GPU-MHD to support the visualization of the simulation results and thus the whole MHD simulation and visualization process can be performed entirely on GPUs.

📄 Content

arXiv:0908.4362v3 [physics.comp-ph] 21 Nov 2010 Efficient magnetohydrodynamic simulations on graphics processing units with CUDA Hon-Cheng Wong a,b & Un-Hong Wong a & Xueshang Feng c & Zesheng Tang a aInstitute of Space Science, Macau University of Science and Technology, Macao, China bFaculty of Information Technology, Macau University of Science and Technology, Macao, China cSIGMA Weather Group, State Key Laboratory for Space Weather, Center for Space Science and Applied Research, Chinese Academy of Sciences, Beijing 100190, China Abstract Magnetohydrodynamic (MHD) simulations based on the ideal MHD equations have become a powerful tool for modeling phenomena in a wide range of applications including laboratory, astrophysical, and space plasmas. In general, high-resolution methods for solving the ideal MHD equations are computationally expensive and Beowulf clusters or even supercomputers are often used to run the codes that im- plemented these methods. With the advent of the Compute Unified Device Archi- tecture (CUDA), modern graphics processing units (GPUs) provide an alternative approach to parallel computing for scientific simulations. In this paper we present, to the author’s knowledge, the first implementation of MHD simulations entirely on GPUs with CUDA, named GPU-MHD, to accelerate the simulation process. GPU- MHD supports both single and double precision computation. A series of numerical tests have been performed to validate the correctness of our code. Accuracy eval- uation by comparing single and double precision computation results is also given. Performance measurements of both single and double precision are conducted on both the NVIDIA GeForce GTX 295 (GT200 architecture) and GTX 480 (Fermi architecture) graphics cards. These measurements show that our GPU-based im- plementation achieves between one and two orders of magnitude depending on the used graphics card, problem size, and precision when comparing to the original serial CPU MHD implementation. In addition, we extend GPU-MHD to support the visualization of the simulation results and thus the whole MHD simulation and visualization process can be performed entirely on GPUs. Key words: MHD simulations, GPUs, CUDA, Parallel computing Preprint submitted to Computer Physics Communications 22 October 2018 1 Introduction Magnetohydrodynamic (MHD) equations can be used in modeling phenom- ena in a wide range of applications including laboratory [5], astrophysical [49], and space plasmas [11]. For example, 3D MHD simulations have been widely adopted in space weather simulations. The historical review and current sta- tus of the existing popular 3D MHD models can be found in [8] and [9], respectively. However, MHD equations form a nonlinear system of hyperbolic conservation laws, which is so complex that high-resolution methods are nec- essary to solve them in order to capture shock waves and other discontinu- ities. These high-resolution methods are in general computationally expen- sive and parallel computational resources such as Beowulf clusters or even supercomputers are often utilized to run the codes that implemented these methods [29] [16] [22] [17] [60]. In the last few years, the rapid development of graphics processing units (GPUs) makes them more powerful in performance and more programmable in functionality. By comparing the computational power of GPUs and CPUs, GPUs exceed CPUs by orders of magnitude. The theoretical peak performance of the current consumer graphics card NVIDIA GeForce GTX 295 (with two GPUs) is 1788.48G floating-point operations per second (FLOPS) per GPU in single precision while a CPU (Core 2 Quad Q9650 — 3.0 GHz) gives a peak performance of around 96GFLOPS in single precision. The release of the Compute Unified Device Architecture (CUDA) [31] hardware and software architecture is the culmination of such development. With CUDA, one can directly exploit a GPU as a data-parallel computing device by programming with the standard C language and avoid working with a high-level shading lan- guage such as Cg [28], which requires a significant amount of graphics specific knowledge and was previously used for performing computation on GPUs. De- tailed performance studies on GPUs with CUDA can be found in [4] and [42]. CUDA is a general purpose parallel computing architecture developed by NVIDIA. It includes the CUDA Instruction Set Architecture (ISA) and the parallel compute engine. An extension to C programming language and its compiler are provided, making the parallelism and high computational power of GPUs can be used not only for rendering and shading, but also for solving many computationally intensive problems in a fraction of the time required on a CPU. CUDA also provides basic linear algebra subroutines (CUBLAS) and fast Fourier transform (CUFFT) libraries to leverage GPUs’ capabilities. These libraries release developers from rebuilding the frequently used basic op- erations such as matrix multiplication. Graphics

This content is AI-processed based on ArXiv data.

Start searching

Enter keywords to search articles

↑↓
ESC
⌘K Shortcut