This repository provides an interactive tutorial on OpenMP and MPI, covering fundamental parallel computing concepts, practical exercises, and real-world examples. The content is structured for ease of use with step-by-step explanations and runnable code inside a Jupyter Notebook.
git clone https://github.com/yourusername/openmp-mpi-workshop.git
cd openmp-mpi-workshop
Ensure that you have GCC with OpenMP support and an MPI implementation installed:
# Install OpenMP support (GCC)
sudo apt install gcc
# Install MPI (MPICH or OpenMPI)
sudo apt install mpich
Start Jupyter and open the tutorial:
jupyter lab tutorial.ipynb
gcc -fopenmp examples/openmp_hello.c -o openmp_hello
./openmp_hello
mpicc examples/mpi_hello.c -o mpi_hello
mpirun -np 2 ./mpi_hello
- OpenMP Basics: Fork-Join Model, Parallel Loops, Work Sharing
- MPI Basics: Point-to-Point and Collective Communication
- Synchronization: Barriers, Critical Sections, Reduction
- Advanced Concepts: Custom Data Types, Communicators, Hybrid OpenMP+MPI
Contributions are welcome! If you find any issues or improvements, feel free to open a Pull Request.
This project is licensed under the MIT License.
Happy coding! 🚀