Open main menu

CDOT Wiki β

Changes

OpenMP Debugging in Visual Studio / Team Debug

320 bytes added, 16:21, 6 December 2017
Case B - Using the Parallel Stacks and the Parallel Watch Window
Now, we can only focus on the i values for Main Thread and Worker 1. As we step through each breakpoint, the Parallel Watch Window will only show rows that have to do with any of our flagged threads.
[[File:Parallelwatch-step5-nothreads.PNG|300px500px|center|Foo(i)]]
We can see that in this stack frame, which is in method cough(i), nothing shows because our two flagged threads don't have that stack frame.
Finally, when we hit the breakpoint where zoo(i) gets called, we can see Main Thread picking up the work, and the value of i upon entering the function is set to 1.
[[File:Parallelwatch-step6.PNG|300px500px|center|Foo(i)]]
The Parallel Stacks Window also shows just our flagged threads. The blue highlighted boxes are Main Thread's stack, and the right box is Worker 1' stack.
We keep stepping through the breakpoints. Next, we see Worker 1's next stack frame, which is the point where it calls vroom(i) from within doo(i).
[[File:Parallelwatch-step7.PNG|300px500px|center|Foo(i)]]
At this point, the value of i is 100. At doo(), it had been multiplied by 100.
We keep pressing F5 and see as Main Thread calls woof, meow and oink from doo and see its i value changes, and Worker 1 calls beep, then screech, making the appropriate i changes.
[[File:Parallelwatch-step8.PNG|300px500px|center|screech(i)]]  The Parallel Watch Window is great for seeing variables' values in multiple threads, or seeing specific threads and the variables they deal with. This would be good for tracking how a variable changes in a particular thread, especially in very complex calculations where it's easy to lose track of each thread's work.
==Case C==
92
edits