Journal of Astrophysics and Astronomy

, Volume 36, Issue 1, pp 197–223 | Cite as

A Fast MHD Code for Gravitationally Stratified Media using Graphical Processing Units: SMAUG

  • M. K. Griffiths
  • V. Fedun
  • R. Erdélyi


Parallelization techniques have been exploited most successfully by the gaming/graphics industry with the adoption of graphical processing units (GPUs), possessing hundreds of processor cores. The opportunity has been recognized by the computational sciences and engineering communities, who have recently harnessed successfully the numerical performance of GPUs. For example, parallel magnetohydrodynamic (MHD) algorithms are important for numerical modelling of highly inhomogeneous solar, astrophysical and geophysical plasmas. Here, we describe the implementation of SMAUG, the Sheffield Magnetohydrodynamics Algorithm Using GPUs. SMAUG is a 1–3D MHD code capable of modelling magnetized and gravitationally stratified plasma.

The objective of this paper is to present the numerical methods and techniques used for porting the code to this novel and highly parallel compute architecture. The methods employed are justified by the performance benchmarks and validation results demonstrating that the code successfully simulates the physics for a range of test scenarios including a full 3D realistic model of wave propagation in the solar atmosphere.

Key words

Numerical simulations magnetohydrodynamics computer unified device architecture graphical processing units NVIDIA Sheffield advanced code the Sheffield magnetohydrodynamics algorithm using GPUs versatile advection code 



MKG acknowledges support from the White Rose Grid e-Science Centre and funding from the EPSRC contract EP/F057644/1. MKG acknowledges the support of NVIDIA for allowing testing of the K20 GPU through its early access program and for the donation of a K20 GPU. RE acknowledges M. Kéray for patient encouragement and is also grateful to NSF, Hungary (OTKA, Ref. No. K83133). The authors thank the Science and Technology Facilities Council (STFC), UK, for the support they received. They also acknowledge Anthony Brookfield and Corporate Information and Computing Services at The University of Sheffield, for the provision of the High Performance Computing Service.


  1. Brio, M., Wu, C. C. 1988, Journal of Computational Physics, 75, 400.Google Scholar
  2. Caunt, S. E., Korpi, M. J. 2001, AA, 369, 706.Google Scholar
  3. Chmielewski, P., Srivastava, A. K., Murawski, K., Musielak, Z. E. 2013, MNRAS, 428, 40–49.Google Scholar
  4. Chmielewski, P., Murawski, K., Musielak, Z. E., Srivastava, A. K. 2014, AJ, 793 (1), 43.Google Scholar
  5. Cook, S. 2012, CUDA Programming: A Developer’s Guide to Parallel Computing with GPUs (Applications of GPU Computing Series), Morgan Kaufmann.Google Scholar
  6. Farber, R. 2011, CUDA Application Design and Development, Morgan Kaufmann.Google Scholar
  7. Fedun, V., Erdélyi, R., Shelyag, S. 2009, SP, 258, 219.Google Scholar
  8. Fedun, V., Verth, G., Jess, D. B., Erdélyi, R. 2011c, AJL, 740, L46.Google Scholar
  9. Fedun, V., Shelyag, S., Verth, G., Mathioudakis, M., Erdélyi, R. 2011b, Annales Geophysicae, 29, 1029.Google Scholar
  10. Fedun, V., Shelyag, S., Erdélyi, R. 2011a, AJ, 727, 17.Google Scholar
  11. Govett, M. 2009, The Fortran-to-CUDA compiler.Google Scholar
  12. Han, T. D., Abdelrahman, T. S. 2011, IEEE Transactions, 22, 78.Google Scholar
  13. Harvey, M. J., De Fabritiis, G. 2011, Computer Physics Communications, 182, 1093.Google Scholar
  14. Hasan, S. S., van Ballegooijen, A. A., Kalkofen, W., Steiner, O. 2005, AJ, 631, 1270.Google Scholar
  15. Kestener, P., Fromang, S. 2012, Astronomical Society of the Pacific Conference Series, 459, 222.Google Scholar
  16. Kirk, D. 2010, Programming Massively Parallel Processors: A Hands-on Approach (Applications of GPU Computing Series), Morgan Kaufmann.Google Scholar
  17. Kirk, D., Hwu,W. 2010, Programming Massively Parallel Processors: A Hands-on Approach, Elsevier Direct.Google Scholar
  18. Lin, L., Ng, C.-S., Bhattacharjee, A. 2011, GPU Accelerated Reduced MHD Simulations of Coronal Loops, Twenty Second International Conference on Numerical Simulations of Plasmas.Google Scholar
  19. Lindholm, E., Nickolls, J., Oberman, S., Montrym, J. 2008, IEEE, 28, 39.Google Scholar
  20. McLaughlin, J. A., De Moortel, I., Hood, A. W., Brady, C. S. 2009, AA, 493, 227.Google Scholar
  21. Mumford, S., Fedun, V., Erdelyi, R. 2014, Generation of Magnetohydrodynamic Waves in Low Solar Atmospheric Flux Tubes by Photospheric Motions, ArXiv e-prints.Google Scholar
  22. Orszag, S. A., Tang, C. M. 1979, Journal of Fluid Mechanics, 90, 129.Google Scholar
  23. Pang, Bijia, li Pen, Ue, Perrone, Michael 2010, Magnetohydrodynamics on Heterogeneous Architectures: A Performance Comparison.Google Scholar
  24. Pressman, R. S. 1997, Software Engineering (A Practitioners Approach), McGraw Hill.Google Scholar
  25. Roe, P. L. 1981, Journal of Computational Physics, 43, 357.Google Scholar
  26. Schive, H.-Y., Zhang, U.-H., Chiueh, T. 2011, Directionally Unsplit Hydrodynamic Schemes with Hybrid MPI/OpenMP/GPU Parallelization in AMR, ArXiv e-prints.Google Scholar
  27. Scullion, E., Erdélyi, R., Fedun, V., Doyle, J. G. 2011, AJ, 743, 14.Google Scholar
  28. Sedov, Leonid I. 1946, Journal of Applied Mathematics and Mechanics, 10, 241.Google Scholar
  29. Selwa, M., Ofman, L., Murawski, K. 2007, AJL, 668, L83.Google Scholar
  30. Shelyag, S., Fedun, V., Erdélyi, R. 2008, AA, 486, 655.Google Scholar
  31. Sødergaard, Peter, Hansen, Jan Vittrup 1999, Numerical Computation with Shocks.Google Scholar
  32. Stein, R. F., Nordlund, A. 1998, AJ, 499, 914.Google Scholar
  33. Taylor, G. 1950, Proceedings of the Royal Society: A Mathematical Physical and Engineering Sciences, 201, 159.Google Scholar
  34. Tóth, G. 1996, AJL, 34, 245.Google Scholar
  35. Tóth, G. 2000, Journal of Computational Physics, 161, 605.Google Scholar
  36. Toth, G., Keppens, R., Botchev, M. A. 1998, AA, 332, 1159.Google Scholar
  37. Vigeesh, G., Fedun, V., Hasan, S. S., Erdélyi, R. 2011, 3D Simulations of Magnetohydrodynamic Waves in the Magnetized Solar Atmosphere, ArXiv e-prints.Google Scholar
  38. Wang, T., Ofman, L., Davila, J. M. 2013, AJL, 775, L23.Google Scholar
  39. Whitehead, N., Fit-florea, A. 2011, Precision and Performance: Floating point and IEEE 754 compliance for NVIDIA GPUs. NVIDIA white paper, 21 (10), 767.Google Scholar
  40. Wienke, S., Springer, P., Terboven, C., an Mey, D. 2012, Lecture Notes in Computer Science, 7484, 859.Google Scholar
  41. Wolfe, M. 2008, Compilers and More: A GPU and Accelerator Programming Model.Google Scholar
  42. Wong, H. C., Wong, U. H., Feng, X, Tang, Z. 2011, Computer Physics Communications, 182, 2132.Google Scholar
  43. Wong, U. H., Aoki, T., Wong, H. C. 2014a, Computer Physics Communications, 185, 1901.Google Scholar
  44. Wong, U. H., Wong, H. C., Ma, Y. 2014b, Computer Physics Communications, 185, 144.Google Scholar
  45. Zink, B. 2011, HORIZON: Accelerated general relativistic magnetohydrodynamics, ArXiv e-prints.Google Scholar

Copyright information

© Indian Academy of Sciences 2015

Authors and Affiliations

  1. 1.Corporate Information and Computing ServicesThe University of SheffieldSheffieldUK
  2. 2.Department of Automatic Control and Systems EngineeringThe University of SheffieldSheffieldUK
  3. 3.Solar Physics and Space Plasma Research Centre (SP2RC), School of Mathematics and StatisticsUniversity of SheffieldHounsfield RoadUK

Personalised recommendations