Rust is a new open-source systems programming language created by Mozilla and a community of volunteers, designed to help developers create fast, secure applications which take full advantage of the powerful features of modern multi-core processors. It combines performance, reliability and productivity at the same time. Several big projects such as Servo (Mozilla’s brand-new browser engine) and Redox (a full Unix-like operating system) are written in this language.
One of the key features of Rust is the ownership model that guarantees the memory-safety and thread-safety. It has many other interesting features, such as a standardised build system, package manager, pattern matching, support for complex numbers, type inference, and efficient C bindings. All this potentially makes Rust a very appealing language for the software development on HPC platforms.
In the first part, the Rust will be evaluated for potential usage at CSCS. In particular, the following questions should be tackled:
- how to install and run Rust programs with "user access" rights on Piz Daint
- [/] is MPI wrapper for Rust compatible with Cray’s implementation
- how to interface Rust program with numerical libraries, such as MKL, MAGMA, ScaLAPACK, cuBlasXt, etc.
- how to write GPU-enabled application in Rust; what are the complications or simplifications comparing to the C/C++/FORTRAN GPU applications
- how to debug and profile Rust-based programs
- how rich is the functionality of Rust, e.g. the availability of special mathematical functions, support of matrices or multi-dimensional arrays, etc.
In the second part, a performance comparison between Rust and C/C++/FORTRAN will be conducted, by idiomatically implementing a parallel distributed linear algebra algorithm or a scientific mini-app code in the target languages. The performance analysis is not only limited to computational performance, but may include analysis of other factors, such as ease of implementation, number of bugs made, testability, readability, maintainability, etc.
- Are we learning yet?
const_generics
- Evaluation of performance and productivity metrics of potential programming languages in the HPC environment
- Rust and MPI
- University of Maryland
- Fast Rust in 2018
- Rust High Performance
- Parallel Rust C++
- The State of GPGPU in Rust
- How to: Run Rust code on your GPU
- Rust 2020: Scientific Rust
- Rayon
- https://www.dursi.ca/post/hpc-is-dying-and-mpi-is-killing-it.html
- Using Rust as a Complement to C for Embedded Systems Software Development
- https://publications.lib.chalmers.se/records/fulltext/219016/219016.pdf
- Rust in HPC
- https://github.com/vks/special-fun
- https://github.com/stainless-steel/special
- rust-lang/rfcs#785
- Install
spack
module load daint-mc module load EasyBuild-custom eb Spack-daint-git-develop.eb module use $EASYBUILD_INSTALLPATH/modules/all module load Spack source /users/msudwoj/easybuild/daint/haswell/software/Spack/daint-git-develop/share/spack/setup-env.sh
- Install
llvm
andrust
module swap PrgEnv-cray PrgEnv-gnu spack install llvm -clang -compiler-rt -internal_unwind -libcxx +link_dylib -lld -lldb spack install rust@develop+nvptx # for "nightly" = master branch spack install rust@1.41.0+nvptx # for stable # TODO: how to install ptx-linker automatically # TODO: how to set optimization flags for rust spack load rust cargo install ptx-linker # TODO: with patched rustc-llvm-proxy # cargo install mpirun
- Use
rust
module swap PrgEnv-cray PrgEnv-gnu source ${EBROOTSPACK}/share/spack/setup-env.sh module load cudatoolkit spack load llvm # TODO: why does spack not generate a module for `module load`? spack load rust export MPICC=cc
- https://github.com/bheisler/RustaCUDA
- https://github.com/rust-accel/accel (semi-maintained)
- https://github.com/japaric-archived/cuda (unmaintained)
- no
__shared__
- no
__const__
- not well tested
proc_macro
s similar to__global__
,__host__
,__device__
async
kernelscuda-bindgen