OpenMP Execution Model
- Execution Structure: Can be represented as a directed acyclic graph utilizing a Fork/Join model.
- Fork: A single thread divides into multiple concurrently executing threads.
- Join: Concurrently executing threads are reduced back into a single thread.
- Execution Flow:
- Every OpenMP program starts with a single, sequential master thread.
- The master thread executes sequentially until it encounters a parallel region construct.
- The statements within this region are executed in parallel by a newly generated team of threads.
- Hardware & Communication:
- Each thread typically runs on its own processor or core (often utilizing "hyperthreading" to handle multiple threads per core).
- Threads communicate with one another during execution through shared variables.
- OpenMP is strictly a shared memory model; it cannot be Distributed.

OpenMP Limitations
- Cache Coherency Overhead: When multiple threads access and modify many shared variables, the underlying system must continuously work to ensure every thread is looking at the most up-to-date version of the data (cache coherency).
- Scalability Bottleneck: The background effort required to maintain this memory consistency across all threads creates overhead. Eventually, this overhead becomes so large that adding more processors will no longer speed up the program.
SMP (Symmetric Multiprocessing)
- Definition: A hardware architecture where multiple identical processors share a single main memory pool under one operating system.
- Relevance to OpenMP: SMP provides the physical shared-memory hardware foundation that OpenMP's software model relies on.
- Cache Coherency: When the text says the SMP "works hard," it means the hardware controllers are struggling to keep local CPU caches synchronized across all active cores.

