This lesson is in the early stages of development (Alpha version)

Introduction to Parallel Programming using OpenMP

This session introduces programmers to the basics of parallel programming. OpenMP is a standard method of sharing work amongst threads within the same computer; this has become common recently due to its ease of use and support amongst the most common compilers. OpenMP uses shared memory within the computer to communicate between threads and there are many methods available to distribute the work. OpenMP is written using compiler directives/pragmas to tell the compiler how to distribute pieces of code across the multiple threads.

Prerequisites

  • Experience of a programming language is required
  • Knowledge of Fortran or C
  • Working knowledge of Linux is essential.

Schedule

Setup Download files required for the lesson
00:00 1. Introduction What are some common terms in parallel computing?
Why use parallel computing?
00:10 2. Single vs Parallel computers What we understand as a single computer?
What we understand as a parallel computer?
What are some of the key elements that determine a computer’s performance?
00:20 3. Shared vs Distributed Memory What is shared memory?
What is distributed memory?
00:35 4. Using shared memory What is OpenMP?
How does it work?
00:55 5. My First Thread How to use OpenMP in C and Fortran?
OpenMP parallel and loop constructs
01:25 6. Basic thread control How to obtain OpenMP threads’ IDs?
What is the barrier OpenMP construct?
What is the master OpenMP construct?
01:40 7. Setting number of threads How to control the number of threads created by OpenMP?
01:55 8. Data sharing How to divide a code in sections and assign each section to one thread?
Another way of assigning only one thread to a programs’ region
02:15 9. Synchronization How to use OpenMP synchronization directives
02:30 10. Reduction operation How to use OpenMP reduction directives
02:50 11. OpenMP and Slurm Some pointers on how to run OpenMP on Slurm
03:10 12. Advanced features Some pointers on further OpenMP features
03:25 Finish

The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.