Vitoria Lima

N-Body Simulation

Efficient N-body Simulation Using Parallel Computing

N-body simulation visualization
Figure 1: N-body simulation showing gravitational interactions between particles

Overview

This project focuses on developing an efficient and accurate N-body simulation system using high-performance computing techniques. The N-body problem is crucial in fields like astrophysics, cosmology, and aerodynamics, involving the simulation of the motion of a system of particles under the influence of gravitational forces.

Key Objectives

Methodology

Technical Implementation

Cell Lists Algorithm

The cell lists algorithm divides the simulation domain into a regular grid of cells. Each particle is assigned to a cell based on its position, and force calculations are performed only between particles in neighboring cells. This approach reduces the computational complexity from O(N²) to O(N) for sufficiently large systems.

Leapfrog Integration

The leapfrog integration scheme is used for time evolution of the particle system. This method provides good energy conservation properties and is well-suited for molecular dynamics simulations. The integration alternates between updating velocities and positions:

Parallel Computing Strategy

The parallelization strategy employs a hybrid approach:

Performance Analysis

Roofline Analysis

The roofline model was used to analyze the performance characteristics of the algorithm, identifying computational bottlenecks and memory bandwidth limitations. This analysis helped optimize the code for different hardware architectures.

Scaling Studies

Strong and weak scaling studies were performed to evaluate the algorithm's efficiency as the number of processors increases. The results demonstrate good scalability up to a certain number of processors, after which communication overhead becomes the limiting factor.

Findings

Conclusion

The project successfully develops a highly scalable and efficient N-body simulation system, advancing the computational techniques available for simulating large-scale particle interactions. The hybrid parallelization approach and optimized algorithms enable the simulation of complex gravitational systems with good performance characteristics.

Resources

Full Analysis (PDF)