fragilehm / N-body-Simulation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

N-body-Simulation

Implementation of N-Body simulation
in n-body-serial you can find serial implementation
in n-body-parallel you can find parallel implementation

Compilation

You can specify number of bodies, simulation tim and deltaTime through command-line parameters, respectively.
by default numberOfBodies = 100, simulationTime = 1.0 and dt = 0.1
Serial compilation "gcc <file_name>"
Serial running "./<application_name> 0.1 100"
Parallel compilation "mpicc <file_name>.c -o <file_name> -lm"
Parallel running "mpiexec -n 10 ./<application_name> 100 1.0 0.1" 10 - number of processes

Notes

number of bodies should be divisible evenly by number of processes,
in order for each process to work with same amount of tasks

About


Languages

Language:C 100.0%