False Sharing (OpenMP)

From HPC Wiki
OpenMP in Small Bites/False Sharing
Jump to navigation Jump to search

Tutorial
Title: OpenMP in Small Bites
Provider: HPC.NRW

Contact: tutorials@hpc.nrw
Type: Multi-part video
Topic Area: Programming Paradigms
License: CC-BY-SA
Syllabus

1. Overview
2. Worksharing
3. Data Scoping
4. False Sharing
5. Tasking
6. Tasking and Data Scoping
7. Tasking and Synchronization
8. Loops and Tasks
9. Tasking Example: Sudoku Solver
10. Task Scheduling
11. Non-Uniform Memory Access

This video explains the concept of caches in parallel computer architectures, discusses the problem of false sharing, shows how it influences the performance of OpenMP programs and how to avoid it. Further hardware-specific topics which influence the way to develop scalable OpenMP programs is discussed in the part about Non-Uniform Memory Access.

Video

( Slides as pdf)

Quiz

1. What causes the introduction of caches in parallel architectures?

Caches can decrease the performance gap between the cores and the memory.
Caches can be used to accelerate the computation in the cores for parallel programs
Since higher clock frequencies would cause to much heat on the chip, caches are the only way to accelerate the core.

2. Why is false sharing a problem in OpenMP programs?

Correctness: The parallel program will deliver non-deterministic results.
Performance: The scalabilty of a parallel program might suffer significantly.
Compiler: The compiler cannot generate optimal code.


3. What might cause a false sharing effect?

Two different memory adresses on the same cache line are accessed by different threads.
Two different memory adresses on different cache lines are accessed by the same thread.
One memory address is accessed by different threads.