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.

Publisher's note: Copernicus Publications remains neutral with regard to jurisdictional claims made in the text, published maps, institutional affiliations, or any other geographical representation in this preprint. The responsibility to include appropriate place names lies with the authors.

Journal article(s) based on this preprint

05 Oct 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)
Siddhartha Bishnu, Robert R. Strauss, and Mark R. Petersen
Geosci. Model Dev., 16, 5539–5559, https://doi.org/10.5194/gmd-16-5539-2023,https://doi.org/10.5194/gmd-16-5539-2023, 2023
Short summary
Robert R. Strauss, Siddhartha Bishnu, and Mark R. Petersen

Interactive discussion

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

Interactive discussion

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

Peer review completion

AR: Author's response | RR: Referee report | ED: Editor decision | EF: Editorial file upload
AR by Mark R. Petersen on behalf of the Authors (02 Jul 2023)  Author's response   Author's tracked changes   Manuscript 
ED: Referee Nomination & Report Request started (09 Jul 2023) by Sylwester Arabas
RR by Anonymous Referee #1 (30 Jul 2023)
ED: Publish subject to minor revisions (review by editor) (30 Jul 2023) by Sylwester Arabas
AR by Siddhartha Bishnu on behalf of the Authors (11 Aug 2023)  Author's response   Author's tracked changes   Manuscript 
ED: Publish as is (16 Aug 2023) by Sylwester Arabas
AR by Siddhartha Bishnu on behalf of the Authors (25 Aug 2023)  Author's response   Manuscript 

Journal article(s) based on this preprint

05 Oct 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)
Siddhartha Bishnu, Robert R. Strauss, and Mark R. Petersen
Geosci. Model Dev., 16, 5539–5559, https://doi.org/10.5194/gmd-16-5539-2023,https://doi.org/10.5194/gmd-16-5539-2023, 2023
Short summary
Robert R. Strauss, Siddhartha Bishnu, and Mark R. Petersen
Robert R. Strauss, Siddhartha Bishnu, and Mark R. Petersen

Viewed

Total article views: 1,129 (including HTML, PDF, and XML)
HTML PDF XML Total BibTeX EndNote
715 394 20 1,129 14 5
  • HTML: 715
  • PDF: 394
  • XML: 20
  • Total: 1,129
  • 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,081 (including HTML, PDF, and XML) Thereof 1,081 with geography defined and 0 with unknown origin.
Country # Views %
  • 1
1
 
 
 
 

Cited

Latest update: 03 Sep 2024
Download

The requested preprint has a corresponding peer-reviewed final revised paper. You are encouraged to refer to the final revised version.

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.