Implementing the N-body program in Rust (with a little bit of EC(S) thrown in).
This is almost a direct translation from an assignment in a Parallel Systems course I took algorithm-wise. The interesting part of that assignment is that we had to use UPC—the interesting parts of this implementation are:
- it's in Rust,
- it's a little optimized, and
- it has the data layout of an EC(S) implementation.
Documentation: clone and run cargo doc
Benchmark: clone and run cargo bench
.
Processor/System | Output |
---|---|
m1 macbook pro | [35.329 ms 35.627 ms 35.939 ms] |
2.9 GHz Intel Core i9/MacOS | [72.774 ms 73.207 ms 73.692 ms] |
2.9 GHz Intel Core i9/MacOS (rust Docker) |
[75.678 ms 76.128 ms 76.629 ms] |
AMD Ryzen 5 2400g/Fedora Linux | [95.662 ms 96.389 ms 97.223 ms] |
The master branch has slightly better performance (2%) than the update
branch.
docker build --rm -f "Dockerfile" -t rust-nbody:latest .
Useful for compilation, benchmarking, etc., rather than doing everything from Dockerfile CMD
.
docker run -it --rm --user "$(id -u)":"$(id -g)" -v "$PWD":/opt/src rust-nbody:latest /bin/bash
maybe check out leapfrog finite difference approximation scheme -> ran into this question while trying to specify data flow