15 Feb 2023
 | 15 Feb 2023
Status: this preprint is open for discussion.

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: open (until 12 Apr 2023)

Comment types: AC – author | RC – referee | CC – community | EC – editor | CEC – chief editor | : Report abuse

Robert R. Strauss et al.

Robert R. Strauss et al.


Total article views: 689 (including HTML, PDF, and XML)
HTML PDF XML Total BibTeX EndNote
479 204 6 689 5 0
  • HTML: 479
  • PDF: 204
  • XML: 6
  • Total: 689
  • BibTeX: 5
  • EndNote: 0
Views and downloads (calculated since 15 Feb 2023)
Cumulative views and downloads (calculated since 15 Feb 2023)

Viewed (geographical distribution)

Total article views: 643 (including HTML, PDF, and XML) Thereof 643 with geography defined and 0 with unknown origin.
Country # Views %
  • 1
Latest update: 31 Mar 2023
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.