Unlock the power of supercomputing. Learn how to break massive problems into smaller pieces and solve them simultaneously using Message Passing Interface.
An independent instance of a program running on a computer. In MPI, we often call these "tasks". Processes have their own separate memory space.
A "lightweight process". Multiple threads exist within a single process and share the same memory address space. Think of them as workers in the same room.
Breaking a problem into discrete parts that can be solved concurrently. Instructions from each part execute simultaneously on different CPUs.
One instruction at a time. The CPU must finish A before starting B.
Simultaneous execution. Multiple resources solving sub-problems at the exact same moment.
How memory is organized dictates how we write code. There are two main paradigms.
| Feature | OpenMP (Shared Memory) | MPI (Message Passing) |
|---|---|---|
| Communication | Implicit (via shared variables) | Explicit (via send/receive functions) |
| Primary Usage | Loop parallelization on a single node | Scalable applications across clusters |
| Difficulty | Easier (Incremental parallelization) | Steeper (Requires explicit data mgmt) |
| Hardware | Shared Memory Only | Both Distributed & Shared |
No matter how many processors you add, your speedup is limited by the serial part of your program.
Speedup = 1 / ( (1-P) + P/N )
Takeaway: If 10% of your code must run serially (e.g., Input/Output, startup), the maximum theoretical speedup is only 10x, even with infinite processors!
Test your understanding of the concepts.