Changes

Jump to: navigation, search

OpenMP Debugging in Visual Studio / Team Debug

1,019 bytes added, 16:07, 10 December 2017
Case A - Using the Thread window
To use OpenMP in visual studio, it is essential to turn on a the OpenMP option.Debug> projectName option>C/C++>language>OpenMP support:YES
[[File:setting.png|600px|center|setting]]
If the option was off, the result goes below,this.[[File:noopenResult.png|600px400px|center|noopenResult]]
If the option was on, the result is this.
[[File:openResult.png|600px400px|center|openResult]]
Abobe code consists of three part.
The first is a serial region, the second is an OpenMP parallel region, the third is an OpenMP parallel region and the number of thread is decided by the code.
TO check each region, we put markers on the lines that print the number of the thread currently using.
Once click "start debugging", the debugger stops at the first breakpoint. You can chase the steps by using "Continue" button.
'''serial region[[File:serial.png|800px|center|serial]]'''
serial On the Threads window, you can see "main thread" line and some worker threads. The yellow arrow points only main thread. and go the next region.[[File:openserial.png|800px1000px|center|openserial]]
serial '''auto OpenMP parallel region ''' You can see "Stack Frame" name on the top screen is changed to main\omp\1On the Threads window, you can see "main thread" and other new three thread which same as default usable thread number 4. after hit 4 times, the step goes to the next region.[[File:open.png|1000px|center|open]]  '''OpenMP parallel regionthread number decided (8)''' You can see "Stack Frame" name on the top screen is changed to main\omp\2On the Threads window, you can see "main thread" and other new seven thread which same as the thread number decided inside of the code. after hit 8 times, the debugging is terminated.[[File:open+.png|800px1000px|center|open+]]
==Case B - Using the Parallel Stacks and the Parallel Watch Window==
190
edits

Navigation menu