Almost all modern computers now have a shared-memory architecture with multiple CPUs connected to the same physical memory, for example multicore laptops or large multi-processor compute servers. This course covers OpenMP, the industry standard for shared-memory programming, which enables serial programs to be parallelised easily using compiler directives. Users of desktop machines can use OpenMP on its own to improve program performance by running on multiple cores; users of parallel supercomputers can use OpenMP in conjunction with MPI to better exploit the shared-memory capabilities of the compute nodes. This course contains an introduction to the fundamental concepts of the shared variables model, followed by the syntax and semantics of OpenMP and how it can be used to parallelise real programs.
The course covers the following topics:
- Basic concepts of shared memory: threads, tasks, shared/private data, synchronisation.
- Concepts of OpenMP: parallel regions, shared/private variables, parallel loops, reductions
- OpenMP parallel regions and associated clauses
- OpenMP worksharing directives, scheduling of parallel loops
- OpenMP synchronisation: barriers, critical sections, atomics, locks.
- OpenMP tasks
- Additional features of OpenMP: nesting, orphaning, threadprivate globals, OpenMP 4.0/4.5 feature
- OpenMP tricks, tips and gotchas.
- OpenMP implementations
- Memory models.
This self-service course includes a series of Lecture videos (with transcript and slides downloadable) which you can work through at your own pace and in your own time.
Hands-on practical programming exercises are included, with the option of working in either Fortran or C.
Access to ARCHER2 provided for participants to build and run the exercises.
On completion of this course, participants will be able to:
- Understand the key concepts of shared memory programming
- Have a knowledge of the syntax and semantics of the OpenMP API.
- Be able to write a correct OpenMP program in C/C++ or Fortran.
- Have an appreciation of some of the advanced features of OpenMP
This course is suitable for programmers with a working knowledge of Fortran, C or C++, and some familiarity with HPC systems, both at a practical and conceptual level.
Participants must bring a laptop with a Mac, Linux, or Windows operating system (not a tablet, Chromebook, etc.) that they have administrative privileges on.
They are also required to abide by the ARCHER2 Training Code of Conduct.