Top 50+ Solved Shared Memory Programming with OpenMP MCQ Questions Answer

From 1 to 15 of 22

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

  • a. #pragma omp section

Q. When compiling an OpenMP program with gcc, what flag must be included?

a. -fopenmp

b. #pragma omp parallel

c. –o hello

d. ./openmp

  • a. -fopenmp

Q. Within a parallel region, declared variables are by default ________ .

a. Private

b. Local

c. Loco

d. Shared

  • d. Shared

Q. ___________________ initializes each private copy with the corresponding valuefrom the master thread.

a. Firstprivate

b. lastprivate

c. nowait

d. Private (OpenMP) and reduction.

  • a. Firstprivate

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

  • b. for pragma

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 ( )

  • b. omp_get_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

  • a. total_no_of_iterations / max_threads

Q. A ____________ in OpenMP is just some text that modifies a directive.

a. data environment

b. clause

c. task

d. Master thread

  • b. clause

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()

  • d. omp_get_nested()
Subscribe Now

Get All Updates & News