Emerging Technologies: Rust in HPC

10 March 2023

This technical report is a short investigation into how Rust could be used for a scientific application in a HPC system.

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 by myself and Mark Bull, 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 "Emerging Technologies: Rust in HPC".

This work was carried out as part of EuroCC@UK, the UK National Competence Center of the EuroCC network.

Image shows example output for the fluid in a box CFD simulation. The inlet is on the right hand side and the outlet is on the bottom edge.

Brightly-coloured image with arrows indicating flow direction.


Dr Laura Moran
Laura Moran