Open main menu

CDOT Wiki β

Changes

OpenMP Debugging in Visual Studio / Team Debug

195 bytes added, 19:28, 5 December 2017
Case B - Using the Parallel Stacks Window
Here is the output of the program, with the cilk_for loop commented out:
[[File:CilkOutput.PNG|500px300px|center|Step 1 - threadsOutput]]
From the output we can see that 4 different workers threads (child threads) occupied the 6 function calls. In order of the function calls in the code, Worker worker 0 took foo(), worker 3 took coo(), worker 2 took boo(), worker 1 took doo(), worker 0 took zoo(), and finally worker 3 took the remaining foo() function.
The Parallel Stacks window allows us to see the call stack information for all active threads at any point in our program.
Walkthrough:
Step 1)<br/>First function call:At our first breakpoint, function call at
cilk_spawn foo();
we can see in the Threads window the Main Thread, with a yellow arrow pointing at it :
[[File:Stacks-step1-threads.PNG|500px|center|Step 1 - threadsMain Thread]]
and the respective view for Parallel Stacks:
[[File:Stacks-step1.PNG|500px|center|Step 1 Stacks - stacksMain Thread]]
In the above, the blue-highlighted boxes refer to the call stack of the current thread, which is Main Thread, indicated by the yellow arrow. The program begins with 4 threads; 1 splits off into what is our Main Thread, and the other 3 split off elsewhere.<br/>
[[File:Stacks-step1b-threads-flagged.PNG|500px|center|Step 1b - Flagged Threads]]
[[File:Stacks-step1b-flagged.PNG|500px|center|Step 1b - Flagged Threads]]
 
 
From this point forward, we will just view the call stacks for the threads which we are flagging, which are the Main Thread, and the 3 worker threads.
 
Second function call:
cilk_spawn coo()
==Case C==
92
edits