esmyrnio / openmp-course

OpenMP Course at AUTh examples

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OpenMP Examples

Prof. N. Stergioulas

Aristotle University of Thessaloniki

Example programs

The following example programs introduce the main concepts of OpenMP step by step.

  1. hello-world-parallel.c (the most basic hello world executed in parallel)

  2. hello-world-parallel-id.c (similar to 1. but the id of each thread and the total number of threads are also printed)

  3. hello-world-parallel-id-func.c (same result as 2. but a function is called to print inside the parallel region)

  4. hello-world-parallel-id-scope.c (same result as 2. but data scope is used in the parallel region)

  5. table-add1-manual.c (add a number to each element of a table, using manual parallelization)

  6. table-add1.c (same result as 5. but with automatic work scheduling)

  7. table-add1-combined.c (same result as 6. but with combined parallel region and for construct)

  8. table-add1-wrong.c (similar to 6. and 7. but giving wrong answer - find the error in the code!)

  9. table-implicit-notpar.c (parallel execution gives wrong answer - find out why!)

  10. table-sum.c (computing the sum of all elements in a table)

  11. table-sum-wrong.c (similar to 10. but gives wrong answer - find the error in the code!)

Exercises

2020 Homework on 2D wave equation

2019 Homework on Poisson solvers

poisson-SOR.c Example: ./poisson-SOR -N 400 -M 400 -a 1e-6 -o 1.9

Tutorials

  1. Tutorial by N. Trifonidis (part 1)
  2. Tutorial by N. Trifonidis (part 2)
  3. A brief introduction by A. Kiessling
  4. Tutorial by S.C. Huang
  5. Tutorial by Texas A&M
  6. Tutorial by T. Mattson and L. Meadows
  7. Online tutorial by B. Barney
  8. Online tutorial by Y. Yliluoma
  9. Online list of potential mistakes
  10. Video tutorial by C. Terboven (part 1)
  11. Video tutorial by C. Terboven (part 2)
  12. Video channel by PPCES

License

Content provided under a Creative Commons Attribution license, CC BY-NC-SA 4.0; code under MIT License. (c)2018 Nikolaos Stergioulas

About

OpenMP Course at AUTh examples


Languages

Language:C 100.0%