Difference between revisions of "OpenMP in Small Bites/Tasking"

From HPC Wiki
OpenMP in Small Bites/Tasking
Jump to navigation Jump to search
Line 9: Line 9:
 
<youtube width="600" height="340" right>lALAUBDszrU</youtube>
 
<youtube width="600" height="340" right>lALAUBDszrU</youtube>
  
([[Media:hpc.nrw_05_Introduction-Tasking.pdf | Slides as pdf]])
+
([[Media:Hpc.nrw_05_Introduction-Tasking.pdf | Slides as pdf]])
  
 
== Quiz ==
 
== Quiz ==

Revision as of 10:31, 1 December 2020

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 introduces another way to to express parallelism in OpenMP: Tasking. This concept enables the programmer to parallelize code regions with non-canonical loop forms or regions which do not use loops at all (including recursive algorithms). The video explains how to use OpenMP tasking, how to synchonize, how to deal with cut-off strategies and how an OpenMP runtime environment manages the tasks in queues. More examples and details about Tasking and Data Scoping as well as Tasking_and_Synchronization are given in further parts of this tutorial.

Video

( Slides as pdf)

Quiz

1. What is the default data scoping of a variable in a task scope? Hint: Assume that the variable is declared before the task region, but in the same function.

Always firstprivate.
firstprivate unless shared in the enclosing context.
shared unless firstprivate in the enclosing context.

2. Which tasks are synchronized with by a taskwait construct?

All tasks of the same thread team.
All desendant tasks.
The direct child tasks.

3. Why can it be benficial for the performance to use cut-off strategies for task-based OpenMP programs?

It can avoid overhead caused by too fine-grained tasks.
It can synchonize tasks faster.
It can accelerate task stealing be enforcing one task queue per thread.