Changes

Jump to: navigation, search

GPU621/OpenMP Debugging

645 bytes added, 10:00, 9 December 2021
User Interface
*3. Add test files on each projects
[[File:1klee214.PNG|1000px800px]]
'''Start debugging with multiple processes'''
*Select Apply, or OK to apply and close the dialog.
[[File:2klee214.PNG|1000px800px]]
*In the Attach to Process dialog box, select the process from the Available Processes list, and then select Attach.
[[File:3klee214.PNG|1000px800px]]
'''Use the Registry Editor to automatically start a process in the debugger'''
*Right-click debugger and select Modify.
[[File:4klee214.PNG|1000px800px]]
'''Debug with multiple processes'''
*Under Tools (or Debug) > Options > Debugging > General, select or clear the Break all processes when one process breaks check box.
[[File:5klee214.PNG|1000px800px]]
'''Switch between processes'''
*In the Processes window, the current process is marked by a yellow arrow. Double-click the process you want to set as the current process.
[[File:7klee214.PNG|1000px800px]]
= User Interface =
The Attach to Process dialog box shows outside processes to be attached to the visual Studio debugger.
[[File:8klee2149klee214.PNG|1000px]]
'''You can attach the following processes'''
You can choose one of the processes during debugging mode.
[[File:9klee2148klee214.PNG|1000px]]
==Threads window==
Run Debug with a breakpoint
 [[File:Screenshot_(5).png|1000px]]  Select Debug from the menu [[File:Screenshot_(6).png|1000px]]
'''How to Use:'''
 
[[File:Screenshot_(7.1).png|1000px]]
[[File:Screenshot_(9).png|1000px]]
'''Features:''' <br/>
 
1. Switch to another frame of the thread
 
[[File:Screenshot_(10).png|1000px]]
[[File:Screenshot_(11)2. Toggle to change to the '''methods view'''.png|1000px]]
[[File:Screenshot_(13).png|1000px]]
 
 
[[File:Screenshot_(15).png|1000px]]
==Parallel Tasks window==
You can flag or freeze the task by right-clicking the task.
You will be able to see the threads and processes organized by tasks.
 
'''Features'''
 
Users can watch the status of the tasks.
Determining the deadlock, thread assignment of each task.
==Parallel Watch window==
The parallel watch window allows the user to watch the thread and variables by organizing the columns by the preferred view of order/filter.
'''Setup:'''
Set a breakpoint at the designated line.Debug with F5 Select Debug -> Windows -> Parallel Watch from the top menu.You can open up to four parallel watch windows. 
'''How To Use:'''
 
Users can select variables to put on a parallel watch.
The selected variable is added to the watch and it shows value in steps for all active threads.
 
'''Features:'''
 
Freeze/unfreeze the thread if you want to pause one thread to investigate another thread.
= Walkthrough =
[[File:ParallelNumThreadsThreadWindow.jpg]]
==Case B - Using the Parallel Stacks and the Parallel Watch Window==
<syntaxhighlight lang="cpp">
}
</syntaxhighlight>
 
 
The main program calls the print function for the size of the string vector.
'''Setup:'''
 
Set breakpoints at the definition of the function, and when join() is called.
Debug using F5 or by clicking debug from the top menu bar.
 Here is the '''output ''' of the program: 
<syntaxhighlight lang="bash">
0 : Hello World
There are 9 different threads that were being created and used every time print() is called.
Using Parallel Stacks Windows, we are able to see the call stack information through a UI.
 
 
----
'''Walkthrough:'''
First call Call: <br/>
[[File:parallelstackswalkthrough1.png]]
 
<br/>
It is being called at the definition of the function "print()"
<br/><br/>
The yellow arrow means the currently executing thread.
By advancing more threads,
<br/><br/>
[[File:parallelstackswalkthrough2.png]]
<br/><br/>
more threads are created by the system.
<br/><br/>
[[File:parallelstackswalkthrough3.png]]
<br/><br/>
When triggering the method view, it shows the related threads
[[File:parallelstackswalkthrough4.png]]
<br/><br/>
[[File:parallelstackswalkthrough5.png||1000px]]
<br/><br/>
Indicates the current thread that is being processed, and also lists the other threads.
In the left bottom, shows the value of the current thread's n(number), and its string(which is "a testing" in the picture)
<br/><br/>
Forked threads are being joined after their usage.
<br/><br/>
[[File:parallelstackswalkthrough6.png]]
<br/><br/>
30
edits

Navigation menu