33
edits
Changes
→OpenMP Debugging in Visual Studio
= OpenMP Debugging in Visual Studio =
Debugging in Visual Studio will be demonstrated using this code:
<syntaxhighlight>
#include <stdio.h>
#include <omp.h>
int main() {
int numThreads = omp_get_max_threads();
printf("Number of threads: %d\n", numThreads);
#pragma omp parallel
{
int threadNum = omp_get_thread_num() + 1;
printf("Hello thread #%d\n", threadNum);
}
printf("End of program");
}
</syntaxhighlight>
== Threads Window ==
[[File:ThreadsWindow.png]]
The threads window displays all the threads in your application
=== Switching Threads ===
[[File:ThreadsWindowSwitch.png]]
[[File:ThreadsWindowSwitch2.png]]
== Freezing/Thawing Threads ==
[[File:ThreadsWindowFreeze1.png]]
[[File:ThreadsWindowFreeze2.png]]
[[File:ThreadsWindowFreeze3.png]]
[[File:ThreadsWindowFreeze4.png|850px|right]]
[[File:ThreadsWindowFreeze5.png|850px|right]]
[[File:ThreadsWindowFreeze6.png|850px|right]]
[[File:ThreadsWindowFreeze7.png|850px|right]]
[[File:ThreadsWindowFreeze8.png|850px|right]]
[[File:ThreadsWindowFreeze9.png|850px|right]]
[[File:ThreadsWindowFreeze10.png|850px|right]]
[[File:ThreadsWindowFreeze11.png|850px|right]]
=== Flagging Threads ===
[[File:ThreadsWindowFlag.png]]
== Grouping Threads ==
[[File:ThreadsWindowGroup1.png]]
[[File:ThreadsWindowGroup2.png]]
== Searching Threads ==
[[File:ThreadsWindowSearch1.png]]
= Sources =
https://learn.microsoft.com/en-ca/previous-versions/visualstudio/visual-studio-2015/debugger/debug-multithreaded-applications-in-visual-studio?view=vs-2015