Language used: C++
A serial and Parallel implementation of the N-body problem. The parallel version was implemented using a combination of MPI and OpenMP. Intuition: Each processor of the MPI framework uses OpenMP to spawn multiple threads and improve its local runtime.
The following graphs represents different configuration of MPI-OpenMP implementation Vs the serial implementation.
As we can observe, for our trials, the configuration 5 MPI processors and 6 OpenMP threads outperform the other parallel configurations and the serial implementation.
- Generate random set of bodies (with velocity and mass) using data_generator.cpp
- Compile and build the N-Body Serial project using:
g++ -Wall -lstdc++ -std=c++11 -lm main.cpp n_body.cpp n_body.h -o main_serial
- Compile and build the N-Body MPI-OpenMP project using:
mpicc -lstdc++ -std=c++11 -qopenmp main.cpp n_body.cpp n_body.h -o main_parallel