Rust in HPC


This technical report by Laura Moran and Mark Bull from EPCC investigates how appropriate the Rust programming language is for HPC systems by using a simple computational fluid dynamics (CFD) code to compare between languages.

image

Rust is a relatively new programming language and is growing rapidly in popularity. Scientific programming is a good avenue for Rust development due to the rigorous memory-safety at the heart of the programming language. It is important to verify that Rust can perform as well as older languages, to make the adoption of this newer language worthwhile.

In this investigation a simple CFD problem and how it is solved is described. The three languages used are Rust, C, and Fortran and the programme is run for serial and parallel problems of different sizes. From this work, the report concludes that Rust is as performant as C and Fortran for the serial problems. For parallel work, Rust is slower due to its strict memory-safety policy requiring duplication of arrays to ensure no data races can occur. This cost should be considered when choosing a language for programming scientific problems on HPC systems.

Read the report.