Rust Particle Simulator

The Rust program is a multithreaded CPU particle simulation, with separate thread pools handling particle movement, cooling and collision detection. Spatial partitioning is used to reduce the number of collision checks, while double buffering allows threads to safely read from the current particle data while writing to the next frame without requiring locks. Work is divided into chunks between threads to balance the workload and prevent multiple threads from modifying the same particles.

Because we're using Flexbox inside the content area, paragraphs space themselves out automatically.

View on GitHub

CUDA Particle Simulator

The CUDA program uses GPU parallelism to process particles through a series of kernels for movement, spatial partitioning, collision detection, merging, cooling and rendering updates. Each particle can be processed independently where possible, allowing the GPU to handle large numbers of particles simultaneously.

Like the Rust implementation, it uses spatial partitioning to reduce collision checks, but requires explicit synchronisation between GPU operations. In contrast to the Rust program, which used a limited pool of CPU threads with the workload distributed between them, the CUDA program used GPU threads to process individual particles for each parallel operation.

View on GitHub