Preprints
https://doi.org/10.5194/egusphere-2023-57
https://doi.org/10.5194/egusphere-2023-57
15 Feb 2023
 | 15 Feb 2023

Comparing the Performance of Julia on CPUs versus GPUs and Julia-MPI versus Fortran-MPI: a case study with MPAS-Ocean (Version 7.1)

Robert R. Strauss, Siddhartha Bishnu, and Mark R. Petersen

Abstract. Some programming languages are easy to develop at the cost of slow execution, while others are fast at run time but much more difficult to write. Julia is a programming language that aims to be the best of both worlds – a development and production language at the same time. To test Julia’s utility in scientific high-performance computing (HPC), we built an unstructured-mesh shallow water model in Julia and compared it against an established Fortran-MPI ocean model, MPAS-Ocean, as well as a Python shallow water code. Three versions of the Julia shallow water code were created, for: single-core CPU; graphics processing unit (GPU); and Message Passing Interface (MPI) CPU clusters. Comparing identical simulations revealed that our first version of the Julia model was 13 times faster than Python using Numpy, where both used an unthreaded single-core CPU. Further Julia optimizations, including static typing and removing implicit memory allocations, provided an additional 10–20x speed-up of the single-core CPU Julia model. The GPU-accelerated Julia code attained a speed-up of 230–380x compared to the single-core CPU Julia code. Parallelized Julia-MPI performance was identical to Fortran-MPI MPAS-Ocean for low processor counts, and ranges from 2x faster to 2x slower for higher processor counts. Our experience is that Julia development is fast and convenient for prototyping, but that Julia requires further investment and expertise to be competitive with compiled codes. We provide advice on Julia code optimization for HPC systems.

Robert R. Strauss et al.

Status: closed

Comment types: AC – author | RC – referee | CC – community | EC – editor | CEC – chief editor | : Report abuse
  • RC1: 'Comment on egusphere-2023-57', Anonymous Referee #1, 25 Mar 2023
    • AC1: 'Reply on RC1', Mark R. Petersen, 02 Jul 2023
  • RC2: 'Comment on egusphere-2023-57', Anonymous Referee #2, 22 May 2023
    • AC2: 'Reply on RC2', Mark R. Petersen, 02 Jul 2023
    • AC3: 'Reply on RC2', Mark R. Petersen, 02 Jul 2023

Status: closed

Comment types: AC – author | RC – referee | CC – community | EC – editor | CEC – chief editor | : Report abuse
  • RC1: 'Comment on egusphere-2023-57', Anonymous Referee #1, 25 Mar 2023
    • AC1: 'Reply on RC1', Mark R. Petersen, 02 Jul 2023
  • RC2: 'Comment on egusphere-2023-57', Anonymous Referee #2, 22 May 2023
    • AC2: 'Reply on RC2', Mark R. Petersen, 02 Jul 2023
    • AC3: 'Reply on RC2', Mark R. Petersen, 02 Jul 2023

Robert R. Strauss et al.

Robert R. Strauss et al.

Viewed

Total article views: 1,124 (including HTML, PDF, and XML)
HTML PDF XML Total BibTeX EndNote
714 390 20 1,124 14 5
  • HTML: 714
  • PDF: 390
  • XML: 20
  • Total: 1,124
  • BibTeX: 14
  • EndNote: 5
Views and downloads (calculated since 15 Feb 2023)
Cumulative views and downloads (calculated since 15 Feb 2023)

Viewed (geographical distribution)

Total article views: 1,076 (including HTML, PDF, and XML) Thereof 1,076 with geography defined and 0 with unknown origin.
Country # Views %
  • 1
1
 
 
 
 
Latest update: 01 Oct 2023
Download
Short summary
Here we test Julia, a relatively new programming language, which is designed to be simple to write, but also fast on advanced computer architectures. We found that Julia is both convenient and fast, but there is no free lunch. Our first attempt to develop an ocean model in Julia was relatively easy, but the code was slow. After several months of further development, we created a Julia code that is as fast on supercomputers as the Fortran ocean model.