Changes

Jump to: navigation, search

GPU621/Striking

494 bytes added, 14:52, 8 December 2016
Progress
The debugging example below is used for five odd numbers to be sorted. This is the easiest way to figured out how the threads work together with the simple data.
<table border="0" width="800">
<tr>
<td width="360" align="top">
*How to start debugging
 
The following sequence may guides you start to debug on the visual Studio.
# put breakpoints where you want to take a look by hitting the key F9 in the line or left-click at the front of a line
# Run the program in Debug mode by hitting the green button (or key F5)
# Go to the menu Debug -> Windows to open the windows you need( see the image on your right)
# Choose the windows that you need (e.g. Memory, Threads, Parallel Stacks, Local or Auto and so on.)
# Hit the function keys to run a program:
## F10 to run codes line by line (Step Over)
## F11 to go into a subroutine (Step Into)
## F9 to put/remove breakpoints in a line
 
 
 
 
 
</td>
<td width="440">
To open windows you need for debugging on Visual Studio, You must run a program in debug mode first. Otherwise, there is no menu to open the windows.
[[File:debug_windows.png|440px|thumb|left|Menu Debug > Windows on VS 2015]]
</td>
</tr>
</table>
*Sample code results
**Data flow of parallel_qsort
<table border="0" width="800">
<tr align="left"><td>[[File:dataflow.png|250px220px|thumb|left|Quick sorting dataflow]]</td><td>Explanation will be here soon. 
Fist set of this quick sorting is that main thread worked for first half of all elements which starts *begin 9 to *end 1. The *mid value was 9 so it swapped *mid for *end. Since mid moved to end, the second half of all elements was the end to the end which only end value are to be sorted; the actual process will be skipped so no value is changed.
# Understanding a program is important; using a serial program version, follow codes line by line to understand the program. (Parallel programming usually starts from a serial version.)
# Use the simple data for the first time to keep track of data flow in a memory, and then increase data volume for the program.
# When you missed the step you want to take a look in run-time debug mode, it will be better to start from the beginning in debug mode as data situation have already changed, and threads invocation also has been passed.
# To open windows you need for debugging on Visual Studio, You must run a program in debug mode first. Otherwise, there is no menu to open the windows.
108
edits

Navigation menu