# OpenMP Info

The Markdown files in this folder contain directives, environment variables, and compiler flags to use when offloading computation to the GPU. The structure is as follows:

| File                | Contents                                                           |
|---------------------|--------------------------------------------------------------------|
| [parallel_directives](parallel_directives.md) | Directives used to specify parallelism.                            |
| [memory_directives](memory_directives.md)   | Directives used to control memory flow.                            |
| [clauses](clauses.md)             | Clauses used to specify variable usage or interpret behavior.      |
| [performance_options](performance_options.md) | Compiler flags and environment variables for tweaking performance. |
| [debug_options](debug_options.md)       | Compiler flags and environment variables for debugging.            |

The specifications folder contains PDFs with the entire specification and reference card of OpenMP.

## Step-by-step guide to parallising

With the directives, environment variables, and compiler flags in the other files, you can start offloading to the GPU with these steps:

1) Offload code to GPU with **omp target**
    - Does not express any parallelism
2) Setup fork/join parallelism with **teams**
3) Partition loops amoung workgroups with **distribute**
4) Partition a portion of a loop amoung threads with **simd**
5) Add data regions with **data map**
6) Optimize results with *clauses*
7) Tweak performance with *flags* and *environment variables*
