Concurrency With OpenMP
suggest changeVersions
Introduction
This topic covers the basics of concurrency in C++ using OpenMP. OpenMP is documented in more detail in the OpenMP tag.
Parallelism or concurrency implies the execution of code at the same time.
Remarks
OpenMP pragmas do not require a special header. The compiler’s OpenMP option still links the OpenMP runtime. If you use any OpenMP API functions such as omp_get_thread_num(), you also need to include omp.h.
OpenMP pragma statements are ignored when the OpenMP option is not enabled during compilation. You may want to refer to the compiler option in your compiler’s manual.
- GCC uses
-fopenmp - Clang uses
-fopenmp - MSVC uses
/openmp
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents