OpenMP Programming Model Flashcards
What are pragma directives?
Compiler directives that provide additional info to the compiler.
What is the form of all OpenMP pragma directives?
pragma omp directive [Clause List]
How do you create parallel threads in OpenMP?
pragma omp parallel
What are Pthreads?
Concurrent execution of multiple threads within a single process.
What does it mean if a variable is identified as private in the OpenMP clause list?
The variable is local to each thread.
What does it mean if a variable is identified as shared in the OpenMP clause list?
The variable is shared across all the threads.
What does it mean if a variable is identified as first private in the OpenMP clause list?
The variable is initialized to corresponding values before parallel directives.
By default, a variable declared outside of a parallel region is shared or private?
Shared
By default, an automatic variable declared within a parallel region is shared or private?
Private
Is a variable declared as a reduction within a parallel section shared or private?
Private
What operators can be used with the reduction clause in OpenMP?
+, -, *, ^, &, &&, |, and ||
What does the no wait clause do in a #pragma omp for directive?
Does not execute an implicit barrier at the end of each for directive.
What does the schedule clause do in a #pragma omp for directive?
Deals with the assignment of iterations to threads.
Can the #pragma omp for directive be applied to any for loop?
Values of the loop control expressions must be the same for all iterations of the loop.
What type of parallelism is specified using the #pragma omp sections directives?
Task Parallelism.