If you torture the data long enough, it will confess to anything. - Ronald Coase

N-body simulation

Simulation of a N-body particle system in 2D. In this porject, among another colleague, we studied the barnes-hut and naive algorithms for simulating the gravitational interaction between particles. Project for the "High Performance Computing" course at IP Paris.

We experimented with different approaches for implementing both algorithms and we compared their performance in runtime and memory usage. First we started with a simple parallel implementation using OpenMP, then we moved to a more complex message passing aproach with MPI, which allowed us to scale the simulation to a cluster of computers. Finally we implemented a GPU version of the simulation using CUDA. The final implementation was able to take advantage of heterogenous hardware, by running on multiple nodes with multiple GPUs and CPUs each.

The source code is available on Github.

This project was a great opportunity to gather experience in the following technologies and tools:

  • High Performance Computing
  • GPU Programming
  • C++ parallel programming libraries: MPI and OpenMP
  • Algorithm analysis.


Created on the 20th of October 2023. Last edition on 9/3/2024