
APP-FractalProject
Fractal Generator with OpenMP and MPI
This project generates a fractal images using parallel processing, then converts the raw binary output into a colorful PNG image using Python.
Output Sample
After execution, the project produces a visually stunning fractal image.
How It Works
MPI
The C program (
fractal_mpi) generates a raw grayscale image of the fractal and writes it to a binary output file.A Python script (
render_fractal.py) reads the output and maps grayscale values to color using a colormap.The result is saved as
fractal.png.Use command in
compile_mpi_command.sh to generate a binary output file.Open-MP
The C program (
fractal_openmp) generates a raw grayscale image of the fractal and writes it to a binary output file.A Python script (
render_openmp.py) reads the output and maps grayscale values to color using a colormap.The result is saved as
openmp.png.Use command in
compile_mpi_command.sh to generate a binary output file.Open-MP Julia Fractal
The C program (
fractal_openmp_julia) generates a raw grayscale image of the fractal and writes it to a binary output file.A Python script (
render_fractal.py) reads the output and maps grayscale values to color using a colormap.The result is saved as
fractal.png.Use command in
compile_openmp_julia.sh to generate a binary output file.Open-MP and MPI Combo
The C program (
fractal_mpi_openmp_combo) generates a raw grayscale image of the fractal and writes it to a binary output file.A Python script (
render_fractal.py) reads the output and maps grayscale values to color using a colormap.The result is saved as
fractal.png.Use command in
compile_combo_command.sh to generate a binary output file.Timing Results
MPI
OpenMP Julia
MPI and OpenMP
MPI on its own shows the best scaling, with larger problems that benefit from more threads the time reduction scales somewhat linearly with amount of threads. Meanwhile OpenMP's scaling is similar but still lags behind that of MPI for much larger problems. Surprisingly, the MPI and OpenMP combination shows the worst results of all, despite the fact that it should be more effective. Likely the different intercommunication types adding up to a larger overhead than either on their own.
The reason this problem does scale so well regardless of framework chosen however, is because the problem of generating fractals is perfectly parallel. Each step/pixel is reliant only upon itself. Causing the bulk of the program (ie. anything that's not setup, shutdown, and file writing) to scale linearly. Meaning that a fractal generating problem doesn't suffer from the usual problems of Amdahl's law. If we had time we would have investigated using the GPU for this problem as well, with the expectation it would easily beat out any other form with no contest due to the aforementioned properties.
Requirements
C Program
MPICC with MPI support
GCC with OpenMP support
Python Script
Python 3
NumPy
Matplotlib
To install Python dependencies:
0 likes · 14 views · Oct 3, 2025
Generated fractal images using parallel processing with OpenMP and MPI.