Skip to main content
U.S. Department of Energy
Office of Scientific and Technical Information

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

Journal Article · · Geoscientific Model Development (Online)

Abstract. Some programming languages are easy to develop at the cost of slow execution, while others are fast at runtime 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, the Model for Prediction Across Scales–Ocean (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–20× speed-up of the single-core CPU Julia model. The GPU-accelerated Julia code was almost identical in terms of performance to the MPI parallelized code on 64 processes, an unexpected result for such different architectures. Parallelized Julia-MPI performance was identical to Fortran-MPI MPAS-Ocean for low processor counts and ranges from 2× faster to 2× 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.

Sponsoring Organization:
USDOE Office of Science (SC), Biological and Environmental Research (BER); USDOE National Nuclear Security Administration (NNSA)
Grant/Contract Number:
89233218CNA000001; AC02-05CH11231
OSTI ID:
2007667
Alternate ID(s):
OSTI ID: 2305313
Journal Information:
Geoscientific Model Development (Online), Journal Name: Geoscientific Model Development (Online) Journal Issue: 19 Vol. 16; ISSN 1991-9603
Publisher:
Copernicus GmbHCopyright Statement
Country of Publication:
Germany
Language:
English

References (28)

Portable C++ Code that can Look and Feel Like Fortran Code with Yet Another Kernel Launcher (YAKL) journal December 2022
A GPU accelerated finite volume coastal ocean model journal August 2017
Rapid software prototyping for heterogeneous and distributed platforms journal June 2019
Numerical representation of geostrophic modes on arbitrarily structured C-grids journal December 2009
A unified approach to energy conservation and potential vorticity dynamics for arbitrarily-structured C-grids journal May 2010
MPI for Python journal September 2005
MPI for Python: Performance improvements and MPI-2 extensions journal May 2008
The regional oceanic modeling system (ROMS): a split-explicit, free-surface, topography-following-coordinate oceanic model journal January 2005
Accelerating a barotropic ocean model using a GPU journal January 2012
A multi-resolution approach to global ocean modeling journal September 2013
Evaluation of the arbitrary Lagrangian–Eulerian vertical coordinate method in the MPAS-Ocean model journal February 2015
PyCUDA and PyOpenCL: A scripting-based approach to GPU run-time code generation journal March 2012
An Evaluation of the Ocean and Sea Ice Climate of E3SM Using MPAS and Interannual CORE‐II Forcing journal May 2019
The DOE E3SM Coupled Model Version 1: Overview and Evaluation at Standard Resolution journal July 2019
The DOE E3SM Coupled Model Version 1: Description and Results at High Resolution journal December 2019
Fluid Simulations Accelerated With 16 Bits: Approaching 4x Speedup on A64FX by Squeezing ShallowWaters.jl Into Float16 journal February 2022
Julia: come for the syntax, stay for the speed journal July 2019
Statistically significant performance testing of Julia scientific programming language journal April 2019
Porting LASG/ IAP Climate System Ocean Model to Gpus Using OpenAcc journal January 2019
Comparing Julia to Performance Portable Parallel Programming Models for HPC conference November 2021
Effective Extensible Programming: Unleashing Julia on GPUs journal April 2019
Kokkos 3: Programming Model Extensions for the Exascale Era journal January 2021
Julia: A Fresh Approach to Numerical Computing journal January 2017
Numba: a LLVM-based Python JIT compiler conference January 2015
MPI.jl: Julia bindings for the Message Passing Interface journal July 2021
Oceananigans.jl: Fast and friendly geophysical fluid dynamics on GPUs journal September 2020
Scalability and some optimization of the Finite-volumE Sea ice–Ocean Model, Version 2.0 (FESOM2) journal January 2019
POM.gpu-v1.0: a GPU-based Princeton Ocean Model journal January 2015

Similar Records

Evaluating performance and portability of high-level programming models: Julia, Python/Numba, and Kokkos on exascale nodes
Conference · Mon May 01 00:00:00 EDT 2023 · OSTI ID:1994693

Creating an MPAS Ocean Shallow Water Core in Julia [Slides]
Technical Report · Sat Nov 06 00:00:00 EDT 2021 · OSTI ID:1829622

Related Subjects