Skip to content

Commit

Permalink
hybrid/docs/06-tasks: clarify best practices
Browse files Browse the repository at this point in the history
  • Loading branch information
juhanikataja committed Jun 26, 2024
1 parent 4f67e7d commit a11fa12
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions hybrid/docs/06-tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,14 +219,15 @@ int fib(int n) {
# OpenMP programming best practices
- Explicitly declare variable privacy level (`shared`/`private`/`firstprivate`)
- Avoid `shared` variables if not explicitly needed
- *Default: `shared`!*
- Maximise parallel regions
- Reduce fork-join overhead, e.g. combine multiple parallel loops into one
large parallel region
- Potential for better cache re-usage
- Parallelise outermost loops if possible
- Move PARALLEL DO construct outside of inner loops
- Reduce access to shared data
- Possibly make small arrays private
- Use more tasks than threads
- Too large number of tasks leads to performance loss
Expand Down

0 comments on commit a11fa12

Please sign in to comment.