OpenMP Programming Model Flashcards

1
Q

What are pragma directives?

A

Compiler directives that provide additional info to the compiler.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the form of all OpenMP pragma directives?

A

pragma omp directive [Clause List]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you create parallel threads in OpenMP?

A

pragma omp parallel

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are Pthreads?

A

Concurrent execution of multiple threads within a single process.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does it mean if a variable is identified as private in the OpenMP clause list?

A

The variable is local to each thread.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does it mean if a variable is identified as shared in the OpenMP clause list?

A

The variable is shared across all the threads.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does it mean if a variable is identified as first private in the OpenMP clause list?

A

The variable is initialized to corresponding values before parallel directives.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

By default, a variable declared outside of a parallel region is shared or private?

A

Shared

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

By default, an automatic variable declared within a parallel region is shared or private?

A

Private

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Is a variable declared as a reduction within a parallel section shared or private?

A

Private

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What operators can be used with the reduction clause in OpenMP?

A

+, -, *, ^, &, &&, |, and ||

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does the no wait clause do in a #pragma omp for directive?

A

Does not execute an implicit barrier at the end of each for directive.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What does the schedule clause do in a #pragma omp for directive?

A

Deals with the assignment of iterations to threads.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Can the #pragma omp for directive be applied to any for loop?

A

Values of the loop control expressions must be the same for all iterations of the loop.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What type of parallelism is specified using the #pragma omp sections directives?

A

Task Parallelism.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is nested parallelism and how does OpenMP support it?

A

Having parallel regions within other parallel sections.

OMP_NESTED

17
Q

Is nested parallelism the default behavior of OpenMP?

A

OMP_NESTED is set to false by default.

18
Q

What OpenMP directive can be used to synchronize threads?

A

pragma omp barrier

19
Q

What does the OMP_NUM_THREADS environment variable do?

A

specifies the default number of threads created in a parallel region.