190
edits
Changes
→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]]'''
==Case B - Using the Parallel Stacks and the Parallel Watch Window==