This repository hosts the implementation of a parallel Mandelbrot set generator. The code in mandelbrot-parallel.cpp
leverages multi-threading to compute the Mandelbrot set using either static or dynamic work allocation strategies. This project includes detailed performance analysis, comparing the efficiency of both work allocation methods.
Saleh Elkaza
- Implementation of Mandelbrot set generation using C++ and parallel programming techniques.
- Static and dynamic work allocation for thread management.
- Performance analysis with different thread counts on ALMA node, which has 16 cores with hyperthreading enabled.
- Atomic operations to prevent race conditions when counting pixels inside the set.
The run-test.sh
script is included to automate the running of the program with various thread counts and work allocation strategies. Results are outputted to performance_results.csv
for easy analysis.
To build the program, make sure you have a C++ compiler and support for C++20 or later. You can compile the program with a command such as:
g++-11.2.0 -std=c++20 -O2 -lpthread -o s mandelbrot-parallel.cpp
To run:
srun --nodes=<nodes number>
Please replace nodes number with any number you wish and keep in mind that your system support this number of nodes.
To run the tests and generate the performance data:
chmod +x run-test.sh
./run-test.sh
The mandelbrot-helpers.hpp
file provided by the parallel computing course contains utility functions and data structures used by the main program.