Numerical Computing with Rust on CPU

Europe/Paris
Description

This free online training will allow you to acquire or refine the skills needed to write efficient numerical computations for CPU platforms using the Rust programming language. Using a combination of theoretical explations and practical work, it will take place during three afternoons:

  • Monday, November 25th - 1pm: Introduction to Rust for numerical computing, practical work on implementing and optimizing simple numerical computations
  • Tuesday, November 26th - 1pm: End of the work on simple computations, followed by an introduction to the Gray-Scott reaction-diffusion model, which we will use as an example of a more complex computation for the remainder of the course.
  • Wednesday, November 27th - 1pm: Practical work covering more advanced Rust performance optimization techniques, applied to the Gray-Scott simulation introduced on day 2.

Why Rust?

The explosive growth of Python in numerical computing illustrates that scientific software developers are increasingly unwilling to put up with C++'s poor ergonomics, even if it comes at the expense of losing C++'s benefits to large-scale software maintainability and runtime performance. But what if we could have good ergonomics, maintainability and performance at the same time?

This is the value proposition of Rust, an emerging programming language that builds on many of the core design choices of C++ (powerful type system, tight control on program execution...), but has sacrificed some backwards compatibility with C and C++ where it allowed for major improvements in developer ergonomics.

As a result, Rust makes it a lot easier than both C++ and Python to write maintainable programs that are free of type/memory/thread-safety errors, robust in the face of runtime errors, and ultimately produce correct results. All the while enabling the levels of runtime performance that C++ developers are accustomed to, given similar or easier optimization efforts.

Course contents

In this online training, you will learn how to write efficient numerical computations for CPU platforms in Rust, through a combination of theoretical explanations and practical work.

We will first get to know Rust by manually implementing a few simple computations (squaring numbers, dot product...), gradually introducing needed language features as we go. Then we'll see how the underlying hardware can be used more efficiently through a combination of SIMD processing, instruction-level parallelism, and multi-threading.

Armed with this foundational knowledge, we will then scale the problem up to a more sophisticated numerical computation, the Gray-Scott reaction-diffusion model, which will introduce along the way. This will allow us to cover some of the more advanced performance optimization techniques that apply at this scale.

Target audience

No prior knowledge of the Rust programming language or the Gray-Scott model (or computational chemistry in general) is required to follow this course. They will all be introduced during the lectures.

On the other hand, it is recommended to have at least basic knowledge of the following topics:

  • C language concepts and syntax (number types and arithmetic, string literals, stack vs heap)
  • Numerical computing (floating-point numbers, single- and multi-dimensional arrays)
  • Linear algebra (vectors and matrices, dot product and matrix multiplication)
  • Differential equations, numerical resolution via Euler and finite difference methods