What should you do?

You create an OpenMP application using Microsoft Visual C++. The application includes the following code segment. (Line numbers are included for reference only.)

01 omp_set_num_threads(10);
03 #pragma omp parallel
04 {
05 //Other code
06 #pragma omp barrier
07 int amount;
08 //Other code
09 amount++;
10 }

You set a breakpoint at line 09 and then start the debugger. You need to change the value for the variable amount to 15 only for the main thread.
What should you do?

You create an OpenMP application using Microsoft Visual C++. The application includes the following code segment. (Line numbers are included for reference only.)

01 omp_set_num_threads(10);
03 #pragma omp parallel
04 {
05 //Other code
06 #pragma omp barrier
07 int amount;
08 //Other code
09 amount++;
10 }

You set a breakpoint at line 09 and then start the debugger. You need to change the value for the variable amount to 15 only for the main thread.
What should you do?

A.
Add a watch to the amount variable. When the breakpoint is hit, change the value of amount to 15.

B.
Open the Immediate window and type the expression "wmain::amount=15".

C.
Open the Autos window when the breakpoint is hit. Change the value of amount to 15.

D.
Open the Locals window when the breakpoint is hit. Switch to the main thread in the Threads window
and change the value of amount to 15.



Leave a Reply 0

Your email address will not be published. Required fields are marked *