Top 50+ Solved Shared Memory Programming with OpenMP MCQ Questions Answer
Q. Which directive must precede the directive: #pragma omp sections (not necessarily immediately)?
a. #pragma omp section
b. #pragma omp parallel
c. None
d. #pragma omp master
Q. When compiling an OpenMP program with gcc, what flag must be included?
a. -fopenmp
b. #pragma omp parallel
c. –o hello
d. ./openmp
Q. Within a parallel region, declared variables are by default ________ .
a. Private
b. Local
c. Loco
d. Shared
Q. A ______________ construct by itself creates a “single program multiple data”program, i.e., each thread executes the same code.
a. Parallel
b. Section
c. Single
d. Master
Q. _______________ specifies that the iteration of the loop must be executed asthey would be in serial program.
a. Nowait
b. Ordered
c. Collapse
d. for loops
Q. ___________________ initializes each private copy with the corresponding valuefrom the master thread.
a. Firstprivate
b. lastprivate
c. nowait
d. Private (OpenMP) and reduction.
Q. The __________________ of a parallel region extends the lexical extent by thecode of functions that are called (directly or indirectly) from within the parallel region.
a. Lexical extent
b. Static extent
c. Dynamic extent
d. None of the above
Q. The ______________ specifies that the iterations of the for loop should beexecuted in parallel by multiple threads.
a. Sections construct
b. for pragma
c. Single construct
d. Parallel for construct
Q. _______________ Function returns the number of threads that are currentlyactive in the parallel section region.
a. omp_get_num_procs ( )
b. omp_get_num_threads ( )
c. omp_get_thread_num ( )
d. omp_set_num_threads ( )
Q. The size of the initial chunksize _____________.
a. total_no_of_iterations / max_threads
b. total_no_of_remaining_iterations / max_threads
c. total_no_of_iterations / No_threads
d. total_no_of_remaining_iterations / No_threads
Q. A ____________ in OpenMP is just some text that modifies a directive.
a. data environment
b. clause
c. task
d. Master thread
Q. In OpenMP, the collection of threads executing the parallel block theoriginal thread and the new thread is called a ____________
a. team
b. executable code
c. implicit task
d. parallel constructs
Q. When a thread reaches a _____________ directive, it creates a team of threadsand becomes the master of the team.
a. Synchronization
b. Parallel
c. Critical
d. Single
Q. Use the _________ library function to determine if nested parallel regions areenabled.
a. Omp_target()
b. Omp_declare target()
c. Omp_target data()
d. omp_get_nested()