Changes

Jump to: navigation, search

OpenMP Debugging in Visual Studio / Team Debug

1,139 bytes added, 19:12, 5 December 2017
Case B - Using the Parallel Stacks Window
At our first breakpoint, 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 - threads]]
and the respective view for Parallel Stacks:
[[File:Stacks-step1.PNG|500px|center|Step 1 - stacks]]
 
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/>
We can hover our mouse over any row in the boxes to get more info:
[[File:Stacks-step1-hover.PNG|300px|center|Step 1 - stacks]]
Hovering above "main" in the Main "1 Thread", we can see which line in the code the current stack frame is at.
 
As we keep hitting F5, we go through each stack frame as determined by our breakpoints. Here, our foo() function was executed. We can see the sleep_for function that was executed, all within the Main thread:
[[File:Stacks-step1b.PNG|500px|center|Step 1b - stacks]]
 
At this point, another thread has begun. We can see "Worker 3" has started in the Threads window:
[[File:Stacks-step1b-threads.PNG|500px|center|Step 1b - Worker 3]]
 
And if we double click on it, the focus will shift to its call stack in the Parallel Stacks window:
[[File:Stacks-step1b-worker3.PNG|500px|center|Step 1b - Worker 3]]
==Case C==
92
edits

Navigation menu