Parallel implementation of the Smoothed Particle Hydrodynamics algorithm developed for the High Performance Computing programming project (Academic Year 2022/2023).
Parallel version of Müller's "Particle-Based Fluid Simulation for Interactive Applications".
It offers:
Run all the commands in the src directory.
make all
: builds all the versions (default)make serial
: builds the non-GUI serial versionmake serial
: builds the GUI serial versionmake omp
: builds the omp versionmake mpi
: builds the mpi versionmake clean
: clean up executables (NOT stats files)
Max input size
: 20000.
Default params
: Particles: 500, Steps: 50.
- Serial:
./sph ${INPUT_SIZE} ${NUM_STEPS}
(e.g../sph 500
to run with 500 particles and 50 steps) - GUI:
./sph.gui ${INPUT_SIZE}
(e.g../sph.gui 500
to run with 500 particles) - OpenMP:
OMP_NUM_THREADS=${NUM_THREADS} omp-sph ${NUM_PARTICLES} ${NUM_STEPS}
(e.g.OMP_NUM_THREADS=4 omp-sph 500
to run with 4 threads, 500 particles and 50 steps) - MPI:
mpirun -n ${NUM_CORES} mpi-sph ${NUM_PARTICLES} ${NUM_STEPS}
(e.g.mpirun -n 4 mpi-sph 500
to run with 4 cores, 500 particles and 50 steps)
Stats files are added into the stats directory
make stats
: builds all and run the stats scripts (see scripts directory)make clean-stats
: clean up stats files
Scripts:
Each script executes the program several times increasing the number of threads/cores from 1 to the number available on your machine. Each execution is repeated 5 times. The cycle is done two times:
- The input size remains constant and the number of threads/cores increases. Execution times are useful to compute speedup and strong scaling efficiency;
- The amount of work done by each thread/core remain constant. Execution times are useful to compute weak scaling efficiency.
The docs directory contains the benchmarks of the two parallel versions using the following hardware:
- Intel(R) Xeon(R) CPU E5-2603 v4 @ 1.70GHz (no Hyper-Threading);
- RAM 64Gb.