https://wiki.cdot.senecacollege.ca/w/api.php?action=feedcontributions&user=Klee214&feedformat=atomCDOT Wiki - User contributions [en]2024-03-28T19:25:47ZUser contributionsMediaWiki 1.30.0https://wiki.cdot.senecacollege.ca/w/index.php?title=GPU621/OpenMP_Debugging&diff=157101GPU621/OpenMP Debugging2021-12-09T14:00:36Z<p>Klee214: /* User Interface */</p>
<hr />
<div>=Group Members=<br />
# [mailto:klee214i@myseneca.ca?subject=GPU621 Kimin Lee]<br />
# [mailto:jluna4@myseneca.ca?subject=GPU621 Jashua Luna]<br />
# [mailto:ipark10@myseneca.ca?subject=GPU621 Irene Park]<br />
<br />
=Process and thread=<br />
<br />
==Process==<br />
<br />
A process is the instance of a computer program that is being executed by one or many threads.<br />
<br />
==Thread==<br />
<br />
A thread is a sequence of instructions to which the operating system grants processor time. Every process that is running in the operating system consists of at least one thread. Processes that have more than one thread are called multithreaded.<br />
<br />
==Multiple Processes Debug==<br />
<br />
Visual Studio can debug a solution that has several processes. You can start and switch between processes, break, continue, and step through source, stop debugging, and end or detach from individual processes.<br />
<br />
'''Create two projects'''<br />
<br />
To test it, the best way with Visual Studio is creating two projects. <br />
<br />
*1. Create a new project of Visual Studio<br />
*2. Add a new project within the Solution<br />
*3. Add test files on each projects<br />
<br />
[[File:1klee214.PNG|800px]]<br />
<br />
'''Start debugging with multiple processes'''<br />
<br />
If you have more than one project in a project solution, you can choose which projects the debugger starts.<br />
<br />
Follow this:<br />
<br />
*Select the solution in Solution Explorer and then select the Properties icon in the toolbar, or right-click the solution and select Properties.<br />
*On the Properties page, select Common Properties > Startup Project.<br />
*Select Current selection, Single startup project and a project file, or Multiple startup projects.<br />
*If you select Multiple startup projects, you can change the startup order and action to take for each project: Start, Start without debugging, or None.<br />
*Select Apply, or OK to apply and close the dialog.<br />
<br />
[[File:2klee214.PNG|800px]]<br />
<br />
<br />
'''Attach to a process'''<br />
<br />
The debugger can also attach to apps running in processes outside of Visual Studio, including on remote devices.<br />
After we attach to an app, we can use the Visual Studio debugger.<br />
<br />
Follow this:<br />
<br />
*With the app running, select Debug > Attach to Process.<br />
*In the Attach to Process dialog box, select the process from the Available Processes list, and then select Attach.<br />
<br />
[[File:3klee214.PNG|800px]]<br />
<br />
'''Use the Registry Editor to automatically start a process in the debugger'''<br />
<br />
We might need to debug the startup code for an app that is launched by another process. You can have the debugger launch and automatically attach to the app.<br />
<br />
Follow this:<br />
<br />
*Start the Windows Registry Editor by running regedit.exe.<br />
*In Registry Editor, navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options.<br />
*Select the folder of the app that you want to start in the debugger.<br />
*If the app isn't listed as a child folder, right-click Image File Execution Options, select New > Key, and type the app name. Or, right-click the new *key in the tree, select Rename, and then enter the app name.<br />
*Right-click the new key in the tree and select New > String Value.<br />
*Change the name of the new value from New Value #1 to debugger.<br />
*Right-click debugger and select Modify.<br />
<br />
[[File:4klee214.PNG|800px]]<br />
<br />
'''Debug with multiple processes'''<br />
<br />
When debugging an app with several processes, the breaking, stepping, and continuing debugger commands affect all processes by default.<br />
You can change this option.<br />
<br />
Follow this:<br />
<br />
*Under Tools (or Debug) > Options > Debugging > General, select or clear the Break all processes when one process breaks check box.<br />
<br />
[[File:5klee214.PNG|800px]]<br />
<br />
'''Switch between processes'''<br />
<br />
Only one process should be active in the debugger at any given time. We can set the active or current process in the Debug Location toolbar, or in the Processes window. To switch between processes, both processes must be in break mode.<br />
<br />
To set the current process from the Debug Location toolbar:<br />
<br />
*To open the Debug Location toolbar, select View > Toolbars > Debug Location.<br />
*During debugging, on the Debug Location toolbar, select the process you want to set as the current process from the Process dropdown.<br />
<br />
To set the current process from the Processes window:<br />
<br />
*To open the Processes window, while debugging, select Debug > Windows > Processes.<br />
*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.<br />
<br />
[[File:7klee214.PNG|800px]]<br />
<br />
= User Interface =<br />
For processes, the primary tools are the Attach to Process dialog box, the Processes window, and the Debug Location toolbar.<br />
<br />
For threads, the primary tools for debugging threads are the Threads window, thread markers in source windows, Parallel Stacks window, Parallel Watch window, and the Debug Location toolbar.<br />
<br />
==Attach to Process dialog box==<br />
The Attach to Process dialog box shows outside processes to be attached to the visual Studio debugger.<br />
<br />
[[File:9klee214.PNG|1000px]]<br />
<br />
'''You can attach the following processes'''<br />
<br />
*Process name (.exe)<br />
*Process ID number<br />
*Menubar Title<br />
*Type (Managed v4.0; Managed v2.0, v1.1, v1.0; x86; x64; IA64)<br />
*User Name (account name)<br />
*Session number<br />
<br />
'''Action you can perform'''<br />
<br />
*Select a process to attach to<br />
*Select a remote computer<br />
*Change transport type for connecting to remote computers<br />
<br />
==Processes window==<br />
The Process Window shows processes attached to the Visual Studio debugger.<br />
You can choose one of the processes during debugging mode.<br />
<br />
[[File:8klee214.PNG|1000px]]<br />
<br />
==Threads window==<br />
Threads window is a utility built into Visual Studio. It allows for easy management/monitoring of a program's threads, while debugging. <br />
<br />
[[File:ThreadWindowExample.jpeg]]<br />
<br />
<br />
<br />
'''Setup:'''<br />
In the program in question, add breakpoints on lines where you would like to inspect thread activity. To add a breakpoint, right-click the line and add a breakpoint from the menu. <br />
<br />
When you run the code from Visual Studio, execution will stop when the program reaches your breakpoint(s). From here, go to Debug > Windows > Threads. Alternatively, you can press CTRL + ALT + H.<br />
<br />
[[File:ThreadWindowSetup.jpeg]]<br />
<br />
<br />
'''How to Use:'''<br />
Usage of the Thread Window is intuitive and ultimately up to the user. It has several columns (some hidden by default) which display several fields of data. <br />
<br />
<br />
'''Columns:'''<br />
<br />
'''Flag''' Denotes which threads a user would like to pay special attention to.<br />
<br />
'''Current Thread''' An arrow in this column indicates the current thread.<br />
<br />
'''ID''' Displays a thread's identification number.<br />
<br />
'''Managed ID''' Displays managed identification numbers.<br />
<br />
'''Category''' Shows a thread's category. Categories are: User Interface Threads, Remote Call Procedure Handlers, or Worker Threads.<br />
<br />
'''Name''' Identifies each thread by name.<br />
<br />
'''Location''' Shows where a thread runs.<br />
<br />
'''Priority''' Shows the precedence assigned to a thread by the system (hidden by default).<br />
<br />
'''Affinity Mask''' Shows the affinity mask for a thread. Affinity mask determines which processors a thread can run on. This column is hidden by default.<br />
<br />
'''Suspended Count''' This determines if a thread can run. This column is hidden by default.<br />
<br />
'''Process Name''' Displays the name of the process to which a thread belongs. This column is hidden by default.<br />
<br />
'''Process ID''' Displays the ID of the process to which a thread belongs. This column is hidden by default.<br />
<br />
'''Transport Qualifier''' Identifies the machine to which the debugger is connected.<br />
<br />
==Source window==<br />
Visual Studio's Source Window displays a project's source code.<br />
<br />
<br />
<br />
'''Setup:'''<br />
<br />
This is the default window when working in visual studio. If it is closed for a particular file, it can be re-opened by double clicking any linked items (like functions imported from it), or by double clicking the filename in the project pane.<br />
<br />
Alternatively, should you start your program in debug mode (f5) and your program for some reason pauses (at a breakpoint or otherwise), a source window for the script where the program paused is opened.<br />
<br />
<br />
'''How to Use:'''<br />
Source Window has many options for debugging. From the debug menu, many diagnostic tools can be accessed. Furthermore, the context menu in this window has many features which can help in debugging. See this image for more details.<br />
<br />
In the this window's gutter, breakpoints appear as red dots. They can be added or removed by clicking in the gutter.<br />
<br />
[[File:SourceWindow.jpeg]]<br />
<br />
==Debug Location toolbar== <br />
<br />
You can set the active or current process in the Debug Location toolbar.<br />
<br />
[[File:10klee214.PNG|1000px]]<br />
<br />
Debug Location toolbar has the following options:<br />
<br />
*Current process<br />
*Suspend the application<br />
*Resume the application<br />
*Suspend and shut down the application<br />
*Current thread<br />
*Toggle current thread flag state<br />
*Show only flagged threads<br />
*Show only current process<br />
*Current stack frame<br />
<br />
With this options you can perform the following actions:<br />
<br />
*Switch to another process<br />
*Suspend, resume, or shut down the application<br />
*Switch to another thread in current process<br />
*Switch to another stack frame in current thread<br />
*Flag or unflag current threads<br />
*Show only flagged threads<br />
*Show only the current process<br />
<br />
==Parallel Stacks window==<br />
<br />
'''Setup:'''<br />
Run Debug with a breakpoint<br />
<br />
Select Debug from the menu<br />
<br />
<br />
'''How to Use:'''<br />
<br />
<br />
<br />
[[File:Screenshot_(8).png|1000px]]<br />
<br />
<br />
<br />
<br />
'''Features:''' <br/><br />
<br />
1. Switch to another frame of the thread<br />
<br />
<br />
[[File:Screenshot_(10).png|1000px]]<br />
<br />
<br />
2. Toggle to change to the '''methods view'''. <br />
<br />
<br />
[[File:Screenshot_(12).png|1000px]]<br />
<br />
<br />
[[File:Screenshot_(13).png|1000px]]<br />
<br />
==Parallel Tasks window==<br />
'''Setup:'''<br />
<br />
Open '''Call Stack''' from the Debug -> Windows<br />
<br />
[[File:Parallelstack1.png]]<br />
<br />
<br />
<br/><br />
<br />
Open '''Threads''' from Debug -> Windows<br />
<br />
[[File:Parallelstack2.png]]<br />
<br />
'''How to Use:'''<br />
<br />
For each task, you are able to see '''id''', and by selecting each '''id''' you will be able to see all the methods the task is currently passing. <br />
By clicking '''Continue''', you will proceed to the next breakpoint.<br />
You can flag or freeze the task by right-clicking the task.<br />
You will be able to see the threads and processes organized by tasks.<br />
<br />
'''Features'''<br />
<br />
Users can watch the status of the tasks.<br />
Determining the deadlock, thread assignment of each task.<br />
<br />
==Parallel Watch window==<br />
<br />
The parallel watch window allows the user to watch the thread and variables by organizing the columns by the preferred view of order/filter.<br />
<br />
<br />
'''Setup:'''<br />
<br />
Set a breakpoint at the designated line.<br />
Debug with F5 <br />
Select Debug -> Windows -> Parallel Watch from the top menu.<br />
You can open up to four parallel watch windows.<br />
<br />
<br />
'''How To Use:'''<br />
<br />
Users can select variables to put on a parallel watch. <br />
The selected variable is added to the watch and it shows value in steps for all active threads.<br />
<br />
<br />
'''Features:'''<br />
<br />
Freeze/unfreeze the thread if you want to pause one thread to investigate another thread.<br />
<br />
= Walkthrough =<br />
<br />
==Case A - Using the Thread window==<br />
The following example of how to use Visual Studio's thread window was performed on Microsoft Visual Studio 2019 with Intel OneAPI Libraries and Intel Visual C++ Compiler.<br />
<br />
This is the code used in the example.<br />
<br />
<syntaxhighlight lang="cpp"><br />
// Thread Window Example<br />
<br />
#include <iostream><br />
#include <omp.h><br />
<br />
using namespace std;<br />
<br />
void main() {<br />
int max_threads = omp_get_max_threads();<br />
cout << "the maximum amount of threads available is: " << max_threads << endl;<br />
<br />
{<br />
cout << endl << "~~~~~ Inside Serial Block ~~~~~" << endl;<br />
<br />
cout << "the amount of threads available in this block is: " << omp_get_num_threads() << endl;<br />
cout << "current thread is: " << omp_get_thread_num() << endl;<br />
}<br />
<br />
<br />
#pragma omp parallel <br />
{<br />
#pragma omp single<br />
{<br />
cout << endl << "~~~~~~ Inside Parallel Block (num_threads unspecified) ~~~~~~" << endl;<br />
cout << "the amount of threads available in this block is: " << omp_get_num_threads() << endl;<br />
}<br />
<br />
<br />
cout << "current thread is: " << omp_get_thread_num() << endl;<br />
}<br />
<br />
#pragma omp parallel num_threads(max_threads/2)<br />
{ <br />
#pragma omp single<br />
{<br />
cout << endl << "~~~~~~ Inside Parallel Block (num_threads specified as " << max_threads / 2 << ") ~~~~~~" << endl;<br />
cout << "the amount of threads available in this block is: " << omp_get_num_threads() << endl;<br />
}<br />
<br />
cout << "current thread is: " << omp_get_thread_num() << endl;<br />
}<br />
}<br />
</syntaxhighlight><br />
<br />
<br />
The first step is to enable openmp in project settngs. Project > Properties > C/C++ > Language >Open MP Support > Yes(/openmp)<br />
<br />
When this code is compiled with /openmp, and run. It should output something like this: <br />
<br />
[[File:SampleOutput.jpeg]]<br />
<br />
<br />
'''serial region'''<br />
When inspecting threads in the Serial Region, only the main process thread is active. This is denoted by the yellow arrow which highlights the active thread at the breakpoint.<br />
<br />
[[File:SerialThreadWindow.jpg]]<br />
<br />
<br />
'''auto OpenMP parallel region '''<br />
As expected in the parallel region (with number of threads unspecified), all threads are available to the program. At the moment when the first thread reaches the breakpoint, most other threads are idle. <br />
<br />
[[File:ParallelThreadWindow.jpg]]<br />
<br />
<br />
<br />
'''OpenMP parallel region thread number decided (8)'''<br />
With the number of threads specified, only that many threads are available in the region. This is clearly seen in ThreadWindow. <br />
<br />
[[File:ParallelNumThreadsThreadWindow.jpg]]<br />
<br />
==Case B - Using the Parallel Stacks Window==<br />
<br />
<syntaxhighlight lang="cpp"><br />
#include <iostream><br />
#include <thread><br />
#include <vector><br />
#include<omp.h><br />
#include <chrono><br />
#include <string><br />
<br />
using namespace std;<br />
void print(int n, const std::string& str) {<br />
std::string msg = std::to_string(n) + " : " + str;<br />
std::cout << msg << std::endl;<br />
}<br />
<br />
int main() {<br />
std::vector<std::string> s = {<br />
"Hello World",<br />
"Hello",<br />
"This",<br />
"is",<br />
"a testing",<br />
"code",<br />
"for",<br />
"multithread",<br />
"debugging"<br />
};<br />
std::vector<std::thread> threads;<br />
<br />
for (int i = 0; i < s.size(); i++) {<br />
threads.push_back(std::thread(print, i, s[i]));<br />
}<br />
<br />
for (auto& th : threads) {<br />
th.join();<br />
}<br />
return 0;<br />
}<br />
</syntaxhighlight><br />
<br />
<br />
<br />
The main program calls the print function for the size of the string vector.<br />
Threads are open when it is called and join back on line 33.<br />
<br />
<br />
'''Setup:''' <br />
<br />
Set breakpoints at the definition of the function, and when join() is called.<br />
Debug using F5 or by clicking debug from the top menu bar.<br />
<br />
<br />
Here is the '''output''' of the program:<br />
<br />
<syntaxhighlight lang="bash"><br />
0 : Hello World<br />
3 : is<br />
6 : for<br />
2 : This<br />
5 : code<br />
7 : multithread<br />
8 : debugging<br />
1 : Hello<br />
4 : a testing<br />
</syntaxhighlight><br />
<br />
There are 9 different threads that were being created and used every time print() is called.<br />
Using Parallel Stacks Windows, we are able to see the call stack information through a UI.<br />
<br />
<br />
----<br />
<br />
'''Walkthrough:'''<br />
<br />
First Call:<br />
<br />
<br/><br />
<br />
[[File:parallelstackswalkthrough1.png]]<br />
<br />
<br/><br />
<br />
It is being called at the definition of the function "print()"<br />
<br/><br />
<br/><br />
<br />
The yellow arrow means the currently executing thread.<br />
<br />
By advancing more threads,<br />
<br/><br/><br />
[[File:parallelstackswalkthrough2.png]]<br />
<br />
<br/><br/><br />
<br />
more threads are created by the system.<br />
<br/><br/><br />
[[File:parallelstackswalkthrough3.png]]<br />
<br />
<br />
<br/><br/><br />
When triggering the method view, it shows the related threads<br />
<br />
[[File:parallelstackswalkthrough4.png]]<br />
<br />
<br/><br/><br />
[[File:parallelstackswalkthrough5.png||1000px]]<br />
<br/><br/><br />
Indicates the current thread that is being processed, and also lists the other threads. <br />
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 />
<br/><br/><br />
Forked threads are being joined after their usage.<br />
<br/><br/><br />
<br />
[[File:parallelstackswalkthrough6.png]]<br />
<br/><br/><br />
<br />
<br />
<br />
<br />
https://en.wikipedia.org/wiki/Help:Cheatsheet</div>Klee214https://wiki.cdot.senecacollege.ca/w/index.php?title=GPU621/OpenMP_Debugging&diff=157098GPU621/OpenMP Debugging2021-12-09T13:47:42Z<p>Klee214: /* Process and thread */</p>
<hr />
<div>=Group Members=<br />
# [mailto:klee214i@myseneca.ca?subject=GPU621 Kimin Lee]<br />
# [mailto:jluna4@myseneca.ca?subject=GPU621 Jashua Luna]<br />
# [mailto:ipark10@myseneca.ca?subject=GPU621 Irene Park]<br />
<br />
=Process and thread=<br />
<br />
==Process==<br />
<br />
A process is the instance of a computer program that is being executed by one or many threads.<br />
<br />
==Thread==<br />
<br />
A thread is a sequence of instructions to which the operating system grants processor time. Every process that is running in the operating system consists of at least one thread. Processes that have more than one thread are called multithreaded.<br />
<br />
==Multiple Processes Debug==<br />
<br />
Visual Studio can debug a solution that has several processes. You can start and switch between processes, break, continue, and step through source, stop debugging, and end or detach from individual processes.<br />
<br />
'''Create two projects'''<br />
<br />
To test it, the best way with Visual Studio is creating two projects. <br />
<br />
*1. Create a new project of Visual Studio<br />
*2. Add a new project within the Solution<br />
*3. Add test files on each projects<br />
<br />
[[File:1klee214.PNG|800px]]<br />
<br />
'''Start debugging with multiple processes'''<br />
<br />
If you have more than one project in a project solution, you can choose which projects the debugger starts.<br />
<br />
Follow this:<br />
<br />
*Select the solution in Solution Explorer and then select the Properties icon in the toolbar, or right-click the solution and select Properties.<br />
*On the Properties page, select Common Properties > Startup Project.<br />
*Select Current selection, Single startup project and a project file, or Multiple startup projects.<br />
*If you select Multiple startup projects, you can change the startup order and action to take for each project: Start, Start without debugging, or None.<br />
*Select Apply, or OK to apply and close the dialog.<br />
<br />
[[File:2klee214.PNG|800px]]<br />
<br />
<br />
'''Attach to a process'''<br />
<br />
The debugger can also attach to apps running in processes outside of Visual Studio, including on remote devices.<br />
After we attach to an app, we can use the Visual Studio debugger.<br />
<br />
Follow this:<br />
<br />
*With the app running, select Debug > Attach to Process.<br />
*In the Attach to Process dialog box, select the process from the Available Processes list, and then select Attach.<br />
<br />
[[File:3klee214.PNG|800px]]<br />
<br />
'''Use the Registry Editor to automatically start a process in the debugger'''<br />
<br />
We might need to debug the startup code for an app that is launched by another process. You can have the debugger launch and automatically attach to the app.<br />
<br />
Follow this:<br />
<br />
*Start the Windows Registry Editor by running regedit.exe.<br />
*In Registry Editor, navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options.<br />
*Select the folder of the app that you want to start in the debugger.<br />
*If the app isn't listed as a child folder, right-click Image File Execution Options, select New > Key, and type the app name. Or, right-click the new *key in the tree, select Rename, and then enter the app name.<br />
*Right-click the new key in the tree and select New > String Value.<br />
*Change the name of the new value from New Value #1 to debugger.<br />
*Right-click debugger and select Modify.<br />
<br />
[[File:4klee214.PNG|800px]]<br />
<br />
'''Debug with multiple processes'''<br />
<br />
When debugging an app with several processes, the breaking, stepping, and continuing debugger commands affect all processes by default.<br />
You can change this option.<br />
<br />
Follow this:<br />
<br />
*Under Tools (or Debug) > Options > Debugging > General, select or clear the Break all processes when one process breaks check box.<br />
<br />
[[File:5klee214.PNG|800px]]<br />
<br />
'''Switch between processes'''<br />
<br />
Only one process should be active in the debugger at any given time. We can set the active or current process in the Debug Location toolbar, or in the Processes window. To switch between processes, both processes must be in break mode.<br />
<br />
To set the current process from the Debug Location toolbar:<br />
<br />
*To open the Debug Location toolbar, select View > Toolbars > Debug Location.<br />
*During debugging, on the Debug Location toolbar, select the process you want to set as the current process from the Process dropdown.<br />
<br />
To set the current process from the Processes window:<br />
<br />
*To open the Processes window, while debugging, select Debug > Windows > Processes.<br />
*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.<br />
<br />
[[File:7klee214.PNG|800px]]<br />
<br />
= User Interface =<br />
For processes, the primary tools are the Attach to Process dialog box, the Processes window, and the Debug Location toolbar.<br />
<br />
For threads, the primary tools for debugging threads are the Threads window, thread markers in source windows, Parallel Stacks window, Parallel Watch window, and the Debug Location toolbar.<br />
<br />
==Attach to Process dialog box==<br />
The Attach to Process dialog box shows outside processes to be attached to the visual Studio debugger.<br />
<br />
[[File:8klee214.PNG|1000px]]<br />
<br />
'''You can attach the following processes'''<br />
<br />
*Process name (.exe)<br />
*Process ID number<br />
*Menubar Title<br />
*Type (Managed v4.0; Managed v2.0, v1.1, v1.0; x86; x64; IA64)<br />
*User Name (account name)<br />
*Session number<br />
<br />
'''Action you can perform'''<br />
<br />
*Select a process to attach to<br />
*Select a remote computer<br />
*Change transport type for connecting to remote computers<br />
<br />
==Processes window==<br />
The Process Window shows processes attached to the Visual Studio debugger.<br />
You can choose one of the processes during debugging mode.<br />
<br />
[[File:9klee214.PNG|1000px]]<br />
<br />
==Threads window==<br />
Threads window is a utility built into Visual Studio. It allows for easy management/monitoring of a program's threads, while debugging. <br />
<br />
[[File:ThreadWindowExample.jpeg]]<br />
<br />
<br />
<br />
'''Setup:'''<br />
In the program in question, add breakpoints on lines where you would like to inspect thread activity. To add a breakpoint, right-click the line and add a breakpoint from the menu. <br />
<br />
When you run the code from Visual Studio, execution will stop when the program reaches your breakpoint(s). From here, go to Debug > Windows > Threads. Alternatively, you can press CTRL + ALT + H.<br />
<br />
[[File:ThreadWindowSetup.jpeg]]<br />
<br />
<br />
'''How to Use:'''<br />
Usage of the Thread Window is intuitive and ultimately up to the user. It has several columns (some hidden by default) which display several fields of data. <br />
<br />
<br />
'''Columns:'''<br />
<br />
'''Flag''' Denotes which threads a user would like to pay special attention to.<br />
<br />
'''Current Thread''' An arrow in this column indicates the current thread.<br />
<br />
'''ID''' Displays a thread's identification number.<br />
<br />
'''Managed ID''' Displays managed identification numbers.<br />
<br />
'''Category''' Shows a thread's category. Categories are: User Interface Threads, Remote Call Procedure Handlers, or Worker Threads.<br />
<br />
'''Name''' Identifies each thread by name.<br />
<br />
'''Location''' Shows where a thread runs.<br />
<br />
'''Priority''' Shows the precedence assigned to a thread by the system (hidden by default).<br />
<br />
'''Affinity Mask''' Shows the affinity mask for a thread. Affinity mask determines which processors a thread can run on. This column is hidden by default.<br />
<br />
'''Suspended Count''' This determines if a thread can run. This column is hidden by default.<br />
<br />
'''Process Name''' Displays the name of the process to which a thread belongs. This column is hidden by default.<br />
<br />
'''Process ID''' Displays the ID of the process to which a thread belongs. This column is hidden by default.<br />
<br />
'''Transport Qualifier''' Identifies the machine to which the debugger is connected.<br />
<br />
==Source window==<br />
Visual Studio's Source Window displays a project's source code.<br />
<br />
<br />
<br />
'''Setup:'''<br />
<br />
This is the default window when working in visual studio. If it is closed for a particular file, it can be re-opened by double clicking any linked items (like functions imported from it), or by double clicking the filename in the project pane.<br />
<br />
Alternatively, should you start your program in debug mode (f5) and your program for some reason pauses (at a breakpoint or otherwise), a source window for the script where the program paused is opened.<br />
<br />
<br />
'''How to Use:'''<br />
Source Window has many options for debugging. From the debug menu, many diagnostic tools can be accessed. Furthermore, the context menu in this window has many features which can help in debugging. See this image for more details.<br />
<br />
In the this window's gutter, breakpoints appear as red dots. They can be added or removed by clicking in the gutter.<br />
<br />
[[File:SourceWindow.jpeg]]<br />
<br />
==Debug Location toolbar== <br />
<br />
You can set the active or current process in the Debug Location toolbar.<br />
<br />
[[File:10klee214.PNG|1000px]]<br />
<br />
Debug Location toolbar has the following options:<br />
<br />
*Current process<br />
*Suspend the application<br />
*Resume the application<br />
*Suspend and shut down the application<br />
*Current thread<br />
*Toggle current thread flag state<br />
*Show only flagged threads<br />
*Show only current process<br />
*Current stack frame<br />
<br />
With this options you can perform the following actions:<br />
<br />
*Switch to another process<br />
*Suspend, resume, or shut down the application<br />
*Switch to another thread in current process<br />
*Switch to another stack frame in current thread<br />
*Flag or unflag current threads<br />
*Show only flagged threads<br />
*Show only the current process<br />
<br />
==Parallel Stacks window==<br />
<br />
'''Setup:'''<br />
Run Debug with a breakpoint<br />
<br />
Select Debug from the menu<br />
<br />
<br />
'''How to Use:'''<br />
<br />
<br />
<br />
[[File:Screenshot_(8).png|1000px]]<br />
<br />
<br />
<br />
<br />
'''Features:''' <br/><br />
<br />
1. Switch to another frame of the thread<br />
<br />
<br />
[[File:Screenshot_(10).png|1000px]]<br />
<br />
<br />
2. Toggle to change to the '''methods view'''. <br />
<br />
<br />
[[File:Screenshot_(12).png|1000px]]<br />
<br />
<br />
[[File:Screenshot_(13).png|1000px]]<br />
<br />
==Parallel Tasks window==<br />
'''Setup:'''<br />
<br />
Open '''Call Stack''' from the Debug -> Windows<br />
<br />
[[File:Parallelstack1.png]]<br />
<br />
<br />
<br/><br />
<br />
Open '''Threads''' from Debug -> Windows<br />
<br />
[[File:Parallelstack2.png]]<br />
<br />
'''How to Use:'''<br />
<br />
For each task, you are able to see '''id''', and by selecting each '''id''' you will be able to see all the methods the task is currently passing. <br />
By clicking '''Continue''', you will proceed to the next breakpoint.<br />
You can flag or freeze the task by right-clicking the task.<br />
You will be able to see the threads and processes organized by tasks.<br />
<br />
'''Features'''<br />
<br />
Users can watch the status of the tasks.<br />
Determining the deadlock, thread assignment of each task.<br />
<br />
==Parallel Watch window==<br />
<br />
The parallel watch window allows the user to watch the thread and variables by organizing the columns by the preferred view of order/filter.<br />
<br />
<br />
'''Setup:'''<br />
<br />
Set a breakpoint at the designated line.<br />
Debug with F5 <br />
Select Debug -> Windows -> Parallel Watch from the top menu.<br />
You can open up to four parallel watch windows.<br />
<br />
<br />
'''How To Use:'''<br />
<br />
Users can select variables to put on a parallel watch. <br />
The selected variable is added to the watch and it shows value in steps for all active threads.<br />
<br />
<br />
'''Features:'''<br />
<br />
Freeze/unfreeze the thread if you want to pause one thread to investigate another thread.<br />
<br />
= Walkthrough =<br />
<br />
==Case A - Using the Thread window==<br />
The following example of how to use Visual Studio's thread window was performed on Microsoft Visual Studio 2019 with Intel OneAPI Libraries and Intel Visual C++ Compiler.<br />
<br />
This is the code used in the example.<br />
<br />
<syntaxhighlight lang="cpp"><br />
// Thread Window Example<br />
<br />
#include <iostream><br />
#include <omp.h><br />
<br />
using namespace std;<br />
<br />
void main() {<br />
int max_threads = omp_get_max_threads();<br />
cout << "the maximum amount of threads available is: " << max_threads << endl;<br />
<br />
{<br />
cout << endl << "~~~~~ Inside Serial Block ~~~~~" << endl;<br />
<br />
cout << "the amount of threads available in this block is: " << omp_get_num_threads() << endl;<br />
cout << "current thread is: " << omp_get_thread_num() << endl;<br />
}<br />
<br />
<br />
#pragma omp parallel <br />
{<br />
#pragma omp single<br />
{<br />
cout << endl << "~~~~~~ Inside Parallel Block (num_threads unspecified) ~~~~~~" << endl;<br />
cout << "the amount of threads available in this block is: " << omp_get_num_threads() << endl;<br />
}<br />
<br />
<br />
cout << "current thread is: " << omp_get_thread_num() << endl;<br />
}<br />
<br />
#pragma omp parallel num_threads(max_threads/2)<br />
{ <br />
#pragma omp single<br />
{<br />
cout << endl << "~~~~~~ Inside Parallel Block (num_threads specified as " << max_threads / 2 << ") ~~~~~~" << endl;<br />
cout << "the amount of threads available in this block is: " << omp_get_num_threads() << endl;<br />
}<br />
<br />
cout << "current thread is: " << omp_get_thread_num() << endl;<br />
}<br />
}<br />
</syntaxhighlight><br />
<br />
<br />
The first step is to enable openmp in project settngs. Project > Properties > C/C++ > Language >Open MP Support > Yes(/openmp)<br />
<br />
When this code is compiled with /openmp, and run. It should output something like this: <br />
<br />
[[File:SampleOutput.jpeg]]<br />
<br />
<br />
'''serial region'''<br />
When inspecting threads in the Serial Region, only the main process thread is active. This is denoted by the yellow arrow which highlights the active thread at the breakpoint.<br />
<br />
[[File:SerialThreadWindow.jpg]]<br />
<br />
<br />
'''auto OpenMP parallel region '''<br />
As expected in the parallel region (with number of threads unspecified), all threads are available to the program. At the moment when the first thread reaches the breakpoint, most other threads are idle. <br />
<br />
[[File:ParallelThreadWindow.jpg]]<br />
<br />
<br />
<br />
'''OpenMP parallel region thread number decided (8)'''<br />
With the number of threads specified, only that many threads are available in the region. This is clearly seen in ThreadWindow. <br />
<br />
[[File:ParallelNumThreadsThreadWindow.jpg]]<br />
<br />
==Case B - Using the Parallel Stacks Window==<br />
<br />
<syntaxhighlight lang="cpp"><br />
#include <iostream><br />
#include <thread><br />
#include <vector><br />
#include<omp.h><br />
#include <chrono><br />
#include <string><br />
<br />
using namespace std;<br />
void print(int n, const std::string& str) {<br />
std::string msg = std::to_string(n) + " : " + str;<br />
std::cout << msg << std::endl;<br />
}<br />
<br />
int main() {<br />
std::vector<std::string> s = {<br />
"Hello World",<br />
"Hello",<br />
"This",<br />
"is",<br />
"a testing",<br />
"code",<br />
"for",<br />
"multithread",<br />
"debugging"<br />
};<br />
std::vector<std::thread> threads;<br />
<br />
for (int i = 0; i < s.size(); i++) {<br />
threads.push_back(std::thread(print, i, s[i]));<br />
}<br />
<br />
for (auto& th : threads) {<br />
th.join();<br />
}<br />
return 0;<br />
}<br />
</syntaxhighlight><br />
<br />
<br />
<br />
The main program calls the print function for the size of the string vector.<br />
Threads are open when it is called and join back on line 33.<br />
<br />
<br />
'''Setup:''' <br />
<br />
Set breakpoints at the definition of the function, and when join() is called.<br />
Debug using F5 or by clicking debug from the top menu bar.<br />
<br />
<br />
Here is the '''output''' of the program:<br />
<br />
<syntaxhighlight lang="bash"><br />
0 : Hello World<br />
3 : is<br />
6 : for<br />
2 : This<br />
5 : code<br />
7 : multithread<br />
8 : debugging<br />
1 : Hello<br />
4 : a testing<br />
</syntaxhighlight><br />
<br />
There are 9 different threads that were being created and used every time print() is called.<br />
Using Parallel Stacks Windows, we are able to see the call stack information through a UI.<br />
<br />
<br />
----<br />
<br />
'''Walkthrough:'''<br />
<br />
First Call:<br />
<br />
<br/><br />
<br />
[[File:parallelstackswalkthrough1.png]]<br />
<br />
<br/><br />
<br />
It is being called at the definition of the function "print()"<br />
<br/><br />
<br/><br />
<br />
The yellow arrow means the currently executing thread.<br />
<br />
By advancing more threads,<br />
<br/><br/><br />
[[File:parallelstackswalkthrough2.png]]<br />
<br />
<br/><br/><br />
<br />
more threads are created by the system.<br />
<br/><br/><br />
[[File:parallelstackswalkthrough3.png]]<br />
<br />
<br />
<br/><br/><br />
When triggering the method view, it shows the related threads<br />
<br />
[[File:parallelstackswalkthrough4.png]]<br />
<br />
<br/><br/><br />
[[File:parallelstackswalkthrough5.png||1000px]]<br />
<br/><br/><br />
Indicates the current thread that is being processed, and also lists the other threads. <br />
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 />
<br/><br/><br />
Forked threads are being joined after their usage.<br />
<br/><br/><br />
<br />
[[File:parallelstackswalkthrough6.png]]<br />
<br/><br/><br />
<br />
<br />
<br />
<br />
https://en.wikipedia.org/wiki/Help:Cheatsheet</div>Klee214https://wiki.cdot.senecacollege.ca/w/index.php?title=GPU621/OpenMP_Debugging&diff=157097GPU621/OpenMP Debugging2021-12-09T13:45:38Z<p>Klee214: /* Process and thread */</p>
<hr />
<div>=Group Members=<br />
# [mailto:klee214i@myseneca.ca?subject=GPU621 Kimin Lee]<br />
# [mailto:jluna4@myseneca.ca?subject=GPU621 Jashua Luna]<br />
# [mailto:ipark10@myseneca.ca?subject=GPU621 Irene Park]<br />
<br />
=Process and thread=<br />
<br />
==Process==<br />
<br />
A process is the instance of a computer program that is being executed by one or many threads.<br />
<br />
==Thread==<br />
<br />
A thread is a sequence of instructions to which the operating system grants processor time. Every process that is running in the operating system consists of at least one thread. Processes that have more than one thread are called multithreaded.<br />
<br />
==Multiple Processes Debug==<br />
<br />
Visual Studio can debug a solution that has several processes. You can start and switch between processes, break, continue, and step through source, stop debugging, and end or detach from individual processes.<br />
<br />
'''Create two projects'''<br />
<br />
To test it, the best way with Visual Studio is creating two projects. <br />
<br />
*1. Create a new project of Visual Studio<br />
*2. Add a new project within the Solution<br />
*3. Add test files on each projects<br />
<br />
[[File:1klee214.PNG|600px]]<br />
<br />
'''Start debugging with multiple processes'''<br />
<br />
If you have more than one project in a project solution, you can choose which projects the debugger starts.<br />
<br />
Follow this:<br />
<br />
*Select the solution in Solution Explorer and then select the Properties icon in the toolbar, or right-click the solution and select Properties.<br />
*On the Properties page, select Common Properties > Startup Project.<br />
*Select Current selection, Single startup project and a project file, or Multiple startup projects.<br />
*If you select Multiple startup projects, you can change the startup order and action to take for each project: Start, Start without debugging, or None.<br />
*Select Apply, or OK to apply and close the dialog.<br />
<br />
[[File:2klee214.PNG|600px]]<br />
<br />
<br />
'''Attach to a process'''<br />
<br />
The debugger can also attach to apps running in processes outside of Visual Studio, including on remote devices.<br />
After we attach to an app, we can use the Visual Studio debugger.<br />
<br />
Follow this:<br />
<br />
*With the app running, select Debug > Attach to Process.<br />
*In the Attach to Process dialog box, select the process from the Available Processes list, and then select Attach.<br />
<br />
[[File:3klee214.PNG|600px]]<br />
<br />
'''Use the Registry Editor to automatically start a process in the debugger'''<br />
<br />
We might need to debug the startup code for an app that is launched by another process. You can have the debugger launch and automatically attach to the app.<br />
<br />
Follow this:<br />
<br />
*Start the Windows Registry Editor by running regedit.exe.<br />
*In Registry Editor, navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options.<br />
*Select the folder of the app that you want to start in the debugger.<br />
*If the app isn't listed as a child folder, right-click Image File Execution Options, select New > Key, and type the app name. Or, right-click the new *key in the tree, select Rename, and then enter the app name.<br />
*Right-click the new key in the tree and select New > String Value.<br />
*Change the name of the new value from New Value #1 to debugger.<br />
*Right-click debugger and select Modify.<br />
<br />
[[File:4klee214.PNG|600px]]<br />
<br />
'''Debug with multiple processes'''<br />
<br />
When debugging an app with several processes, the breaking, stepping, and continuing debugger commands affect all processes by default.<br />
You can change this option.<br />
<br />
Follow this:<br />
<br />
*Under Tools (or Debug) > Options > Debugging > General, select or clear the Break all processes when one process breaks check box.<br />
<br />
[[File:5klee214.PNG|600px]]<br />
<br />
'''Switch between processes'''<br />
<br />
Only one process should be active in the debugger at any given time. We can set the active or current process in the Debug Location toolbar, or in the Processes window. To switch between processes, both processes must be in break mode.<br />
<br />
To set the current process from the Debug Location toolbar:<br />
<br />
*To open the Debug Location toolbar, select View > Toolbars > Debug Location.<br />
*During debugging, on the Debug Location toolbar, select the process you want to set as the current process from the Process dropdown.<br />
<br />
To set the current process from the Processes window:<br />
<br />
*To open the Processes window, while debugging, select Debug > Windows > Processes.<br />
*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.<br />
<br />
[[File:7klee214.PNG|600px]]<br />
<br />
= User Interface =<br />
For processes, the primary tools are the Attach to Process dialog box, the Processes window, and the Debug Location toolbar.<br />
<br />
For threads, the primary tools for debugging threads are the Threads window, thread markers in source windows, Parallel Stacks window, Parallel Watch window, and the Debug Location toolbar.<br />
<br />
==Attach to Process dialog box==<br />
The Attach to Process dialog box shows outside processes to be attached to the visual Studio debugger.<br />
<br />
[[File:8klee214.PNG|1000px]]<br />
<br />
'''You can attach the following processes'''<br />
<br />
*Process name (.exe)<br />
*Process ID number<br />
*Menubar Title<br />
*Type (Managed v4.0; Managed v2.0, v1.1, v1.0; x86; x64; IA64)<br />
*User Name (account name)<br />
*Session number<br />
<br />
'''Action you can perform'''<br />
<br />
*Select a process to attach to<br />
*Select a remote computer<br />
*Change transport type for connecting to remote computers<br />
<br />
==Processes window==<br />
The Process Window shows processes attached to the Visual Studio debugger.<br />
You can choose one of the processes during debugging mode.<br />
<br />
[[File:9klee214.PNG|1000px]]<br />
<br />
==Threads window==<br />
Threads window is a utility built into Visual Studio. It allows for easy management/monitoring of a program's threads, while debugging. <br />
<br />
[[File:ThreadWindowExample.jpeg]]<br />
<br />
<br />
<br />
'''Setup:'''<br />
In the program in question, add breakpoints on lines where you would like to inspect thread activity. To add a breakpoint, right-click the line and add a breakpoint from the menu. <br />
<br />
When you run the code from Visual Studio, execution will stop when the program reaches your breakpoint(s). From here, go to Debug > Windows > Threads. Alternatively, you can press CTRL + ALT + H.<br />
<br />
[[File:ThreadWindowSetup.jpeg]]<br />
<br />
<br />
'''How to Use:'''<br />
Usage of the Thread Window is intuitive and ultimately up to the user. It has several columns (some hidden by default) which display several fields of data. <br />
<br />
<br />
'''Columns:'''<br />
<br />
'''Flag''' Denotes which threads a user would like to pay special attention to.<br />
<br />
'''Current Thread''' An arrow in this column indicates the current thread.<br />
<br />
'''ID''' Displays a thread's identification number.<br />
<br />
'''Managed ID''' Displays managed identification numbers.<br />
<br />
'''Category''' Shows a thread's category. Categories are: User Interface Threads, Remote Call Procedure Handlers, or Worker Threads.<br />
<br />
'''Name''' Identifies each thread by name.<br />
<br />
'''Location''' Shows where a thread runs.<br />
<br />
'''Priority''' Shows the precedence assigned to a thread by the system (hidden by default).<br />
<br />
'''Affinity Mask''' Shows the affinity mask for a thread. Affinity mask determines which processors a thread can run on. This column is hidden by default.<br />
<br />
'''Suspended Count''' This determines if a thread can run. This column is hidden by default.<br />
<br />
'''Process Name''' Displays the name of the process to which a thread belongs. This column is hidden by default.<br />
<br />
'''Process ID''' Displays the ID of the process to which a thread belongs. This column is hidden by default.<br />
<br />
'''Transport Qualifier''' Identifies the machine to which the debugger is connected.<br />
<br />
==Source window==<br />
Visual Studio's Source Window displays a project's source code.<br />
<br />
<br />
<br />
'''Setup:'''<br />
<br />
This is the default window when working in visual studio. If it is closed for a particular file, it can be re-opened by double clicking any linked items (like functions imported from it), or by double clicking the filename in the project pane.<br />
<br />
Alternatively, should you start your program in debug mode (f5) and your program for some reason pauses (at a breakpoint or otherwise), a source window for the script where the program paused is opened.<br />
<br />
<br />
'''How to Use:'''<br />
Source Window has many options for debugging. From the debug menu, many diagnostic tools can be accessed. Furthermore, the context menu in this window has many features which can help in debugging. See this image for more details.<br />
<br />
In the this window's gutter, breakpoints appear as red dots. They can be added or removed by clicking in the gutter.<br />
<br />
[[File:SourceWindow.jpeg]]<br />
<br />
==Debug Location toolbar== <br />
<br />
You can set the active or current process in the Debug Location toolbar.<br />
<br />
[[File:10klee214.PNG|1000px]]<br />
<br />
Debug Location toolbar has the following options:<br />
<br />
*Current process<br />
*Suspend the application<br />
*Resume the application<br />
*Suspend and shut down the application<br />
*Current thread<br />
*Toggle current thread flag state<br />
*Show only flagged threads<br />
*Show only current process<br />
*Current stack frame<br />
<br />
With this options you can perform the following actions:<br />
<br />
*Switch to another process<br />
*Suspend, resume, or shut down the application<br />
*Switch to another thread in current process<br />
*Switch to another stack frame in current thread<br />
*Flag or unflag current threads<br />
*Show only flagged threads<br />
*Show only the current process<br />
<br />
==Parallel Stacks window==<br />
<br />
'''Setup:'''<br />
Run Debug with a breakpoint<br />
<br />
Select Debug from the menu<br />
<br />
<br />
'''How to Use:'''<br />
<br />
<br />
<br />
[[File:Screenshot_(8).png|1000px]]<br />
<br />
<br />
<br />
<br />
'''Features:''' <br/><br />
<br />
1. Switch to another frame of the thread<br />
<br />
<br />
[[File:Screenshot_(10).png|1000px]]<br />
<br />
<br />
2. Toggle to change to the '''methods view'''. <br />
<br />
<br />
[[File:Screenshot_(12).png|1000px]]<br />
<br />
<br />
[[File:Screenshot_(13).png|1000px]]<br />
<br />
==Parallel Tasks window==<br />
'''Setup:'''<br />
<br />
Open '''Call Stack''' from the Debug -> Windows<br />
<br />
[[File:Parallelstack1.png]]<br />
<br />
<br />
<br/><br />
<br />
Open '''Threads''' from Debug -> Windows<br />
<br />
[[File:Parallelstack2.png]]<br />
<br />
'''How to Use:'''<br />
<br />
For each task, you are able to see '''id''', and by selecting each '''id''' you will be able to see all the methods the task is currently passing. <br />
By clicking '''Continue''', you will proceed to the next breakpoint.<br />
You can flag or freeze the task by right-clicking the task.<br />
You will be able to see the threads and processes organized by tasks.<br />
<br />
'''Features'''<br />
<br />
Users can watch the status of the tasks.<br />
Determining the deadlock, thread assignment of each task.<br />
<br />
==Parallel Watch window==<br />
<br />
The parallel watch window allows the user to watch the thread and variables by organizing the columns by the preferred view of order/filter.<br />
<br />
<br />
'''Setup:'''<br />
<br />
Set a breakpoint at the designated line.<br />
Debug with F5 <br />
Select Debug -> Windows -> Parallel Watch from the top menu.<br />
You can open up to four parallel watch windows.<br />
<br />
<br />
'''How To Use:'''<br />
<br />
Users can select variables to put on a parallel watch. <br />
The selected variable is added to the watch and it shows value in steps for all active threads.<br />
<br />
<br />
'''Features:'''<br />
<br />
Freeze/unfreeze the thread if you want to pause one thread to investigate another thread.<br />
<br />
= Walkthrough =<br />
<br />
==Case A - Using the Thread window==<br />
The following example of how to use Visual Studio's thread window was performed on Microsoft Visual Studio 2019 with Intel OneAPI Libraries and Intel Visual C++ Compiler.<br />
<br />
This is the code used in the example.<br />
<br />
<syntaxhighlight lang="cpp"><br />
// Thread Window Example<br />
<br />
#include <iostream><br />
#include <omp.h><br />
<br />
using namespace std;<br />
<br />
void main() {<br />
int max_threads = omp_get_max_threads();<br />
cout << "the maximum amount of threads available is: " << max_threads << endl;<br />
<br />
{<br />
cout << endl << "~~~~~ Inside Serial Block ~~~~~" << endl;<br />
<br />
cout << "the amount of threads available in this block is: " << omp_get_num_threads() << endl;<br />
cout << "current thread is: " << omp_get_thread_num() << endl;<br />
}<br />
<br />
<br />
#pragma omp parallel <br />
{<br />
#pragma omp single<br />
{<br />
cout << endl << "~~~~~~ Inside Parallel Block (num_threads unspecified) ~~~~~~" << endl;<br />
cout << "the amount of threads available in this block is: " << omp_get_num_threads() << endl;<br />
}<br />
<br />
<br />
cout << "current thread is: " << omp_get_thread_num() << endl;<br />
}<br />
<br />
#pragma omp parallel num_threads(max_threads/2)<br />
{ <br />
#pragma omp single<br />
{<br />
cout << endl << "~~~~~~ Inside Parallel Block (num_threads specified as " << max_threads / 2 << ") ~~~~~~" << endl;<br />
cout << "the amount of threads available in this block is: " << omp_get_num_threads() << endl;<br />
}<br />
<br />
cout << "current thread is: " << omp_get_thread_num() << endl;<br />
}<br />
}<br />
</syntaxhighlight><br />
<br />
<br />
The first step is to enable openmp in project settngs. Project > Properties > C/C++ > Language >Open MP Support > Yes(/openmp)<br />
<br />
When this code is compiled with /openmp, and run. It should output something like this: <br />
<br />
[[File:SampleOutput.jpeg]]<br />
<br />
<br />
'''serial region'''<br />
When inspecting threads in the Serial Region, only the main process thread is active. This is denoted by the yellow arrow which highlights the active thread at the breakpoint.<br />
<br />
[[File:SerialThreadWindow.jpg]]<br />
<br />
<br />
'''auto OpenMP parallel region '''<br />
As expected in the parallel region (with number of threads unspecified), all threads are available to the program. At the moment when the first thread reaches the breakpoint, most other threads are idle. <br />
<br />
[[File:ParallelThreadWindow.jpg]]<br />
<br />
<br />
<br />
'''OpenMP parallel region thread number decided (8)'''<br />
With the number of threads specified, only that many threads are available in the region. This is clearly seen in ThreadWindow. <br />
<br />
[[File:ParallelNumThreadsThreadWindow.jpg]]<br />
<br />
==Case B - Using the Parallel Stacks Window==<br />
<br />
<syntaxhighlight lang="cpp"><br />
#include <iostream><br />
#include <thread><br />
#include <vector><br />
#include<omp.h><br />
#include <chrono><br />
#include <string><br />
<br />
using namespace std;<br />
void print(int n, const std::string& str) {<br />
std::string msg = std::to_string(n) + " : " + str;<br />
std::cout << msg << std::endl;<br />
}<br />
<br />
int main() {<br />
std::vector<std::string> s = {<br />
"Hello World",<br />
"Hello",<br />
"This",<br />
"is",<br />
"a testing",<br />
"code",<br />
"for",<br />
"multithread",<br />
"debugging"<br />
};<br />
std::vector<std::thread> threads;<br />
<br />
for (int i = 0; i < s.size(); i++) {<br />
threads.push_back(std::thread(print, i, s[i]));<br />
}<br />
<br />
for (auto& th : threads) {<br />
th.join();<br />
}<br />
return 0;<br />
}<br />
</syntaxhighlight><br />
<br />
<br />
<br />
The main program calls the print function for the size of the string vector.<br />
Threads are open when it is called and join back on line 33.<br />
<br />
<br />
'''Setup:''' <br />
<br />
Set breakpoints at the definition of the function, and when join() is called.<br />
Debug using F5 or by clicking debug from the top menu bar.<br />
<br />
<br />
Here is the '''output''' of the program:<br />
<br />
<syntaxhighlight lang="bash"><br />
0 : Hello World<br />
3 : is<br />
6 : for<br />
2 : This<br />
5 : code<br />
7 : multithread<br />
8 : debugging<br />
1 : Hello<br />
4 : a testing<br />
</syntaxhighlight><br />
<br />
There are 9 different threads that were being created and used every time print() is called.<br />
Using Parallel Stacks Windows, we are able to see the call stack information through a UI.<br />
<br />
<br />
----<br />
<br />
'''Walkthrough:'''<br />
<br />
First Call:<br />
<br />
<br/><br />
<br />
[[File:parallelstackswalkthrough1.png]]<br />
<br />
<br/><br />
<br />
It is being called at the definition of the function "print()"<br />
<br/><br />
<br/><br />
<br />
The yellow arrow means the currently executing thread.<br />
<br />
By advancing more threads,<br />
<br/><br/><br />
[[File:parallelstackswalkthrough2.png]]<br />
<br />
<br/><br/><br />
<br />
more threads are created by the system.<br />
<br/><br/><br />
[[File:parallelstackswalkthrough3.png]]<br />
<br />
<br />
<br/><br/><br />
When triggering the method view, it shows the related threads<br />
<br />
[[File:parallelstackswalkthrough4.png]]<br />
<br />
<br/><br/><br />
[[File:parallelstackswalkthrough5.png||1000px]]<br />
<br/><br/><br />
Indicates the current thread that is being processed, and also lists the other threads. <br />
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 />
<br/><br/><br />
Forked threads are being joined after their usage.<br />
<br/><br/><br />
<br />
[[File:parallelstackswalkthrough6.png]]<br />
<br/><br/><br />
<br />
<br />
<br />
<br />
https://en.wikipedia.org/wiki/Help:Cheatsheet</div>Klee214https://wiki.cdot.senecacollege.ca/w/index.php?title=GPU621/OpenMP_Debugging&diff=156696GPU621/OpenMP Debugging2021-12-06T03:39:58Z<p>Klee214: /* User Interface */</p>
<hr />
<div>=Group Members=<br />
# [mailto:klee214i@myseneca.ca?subject=GPU621 Kimin Lee]<br />
# [mailto:jluna4@myseneca.ca?subject=GPU621 Jashua Luna]<br />
# [mailto:ipark10@myseneca.ca?subject=GPU621 Irene Park]<br />
<br />
=Process and thread=<br />
<br />
==Process==<br />
<br />
A process is the instance of a computer program that is being executed by one or many threads.<br />
<br />
==Thread==<br />
<br />
A thread is a sequence of instructions to which the operating system grants processor time. Every process that is running in the operating system consists of at least one thread. Processes that have more than one thread are called multithreaded.<br />
<br />
==Multiple Processes Debug==<br />
<br />
Visual Studio can debug a solution that has several processes. You can start and switch between processes, break, continue, and step through source, stop debugging, and end or detach from individual processes.<br />
<br />
'''Create two projects'''<br />
<br />
To test it, the best way with Visual Studio is creating two projects. <br />
<br />
*1. Create a new project of Visual Studio<br />
*2. Add a new project within the Solution<br />
*3. Add test files on each projects<br />
<br />
[[File:1klee214.PNG|1000px]]<br />
<br />
'''Start debugging with multiple processes'''<br />
<br />
If you have more than one project in a project solution, you can choose which projects the debugger starts.<br />
<br />
Follow this:<br />
<br />
*Select the solution in Solution Explorer and then select the Properties icon in the toolbar, or right-click the solution and select Properties.<br />
*On the Properties page, select Common Properties > Startup Project.<br />
*Select Current selection, Single startup project and a project file, or Multiple startup projects.<br />
*If you select Multiple startup projects, you can change the startup order and action to take for each project: Start, Start without debugging, or None.<br />
*Select Apply, or OK to apply and close the dialog.<br />
<br />
[[File:2klee214.PNG|1000px]]<br />
<br />
<br />
'''Attach to a process'''<br />
<br />
The debugger can also attach to apps running in processes outside of Visual Studio, including on remote devices.<br />
After we attach to an app, we can use the Visual Studio debugger.<br />
<br />
Follow this:<br />
<br />
*With the app running, select Debug > Attach to Process.<br />
*In the Attach to Process dialog box, select the process from the Available Processes list, and then select Attach.<br />
<br />
[[File:3klee214.PNG|1000px]]<br />
<br />
'''Use the Registry Editor to automatically start a process in the debugger'''<br />
<br />
We might need to debug the startup code for an app that is launched by another process. You can have the debugger launch and automatically attach to the app.<br />
<br />
Follow this:<br />
<br />
*Start the Windows Registry Editor by running regedit.exe.<br />
*In Registry Editor, navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options.<br />
*Select the folder of the app that you want to start in the debugger.<br />
*If the app isn't listed as a child folder, right-click Image File Execution Options, select New > Key, and type the app name. Or, right-click the new *key in the tree, select Rename, and then enter the app name.<br />
*Right-click the new key in the tree and select New > String Value.<br />
*Change the name of the new value from New Value #1 to debugger.<br />
*Right-click debugger and select Modify.<br />
<br />
[[File:4klee214.PNG|1000px]]<br />
<br />
'''Debug with multiple processes'''<br />
<br />
When debugging an app with several processes, the breaking, stepping, and continuing debugger commands affect all processes by default.<br />
You can change this option.<br />
<br />
Follow this:<br />
<br />
*Under Tools (or Debug) > Options > Debugging > General, select or clear the Break all processes when one process breaks check box.<br />
<br />
[[File:5klee214.PNG|1000px]]<br />
<br />
'''Switch between processes'''<br />
<br />
Only one process should be active in the debugger at any given time. We can set the active or current process in the Debug Location toolbar, or in the Processes window. To switch between processes, both processes must be in break mode.<br />
<br />
To set the current process from the Debug Location toolbar:<br />
<br />
*To open the Debug Location toolbar, select View > Toolbars > Debug Location.<br />
*During debugging, on the Debug Location toolbar, select the process you want to set as the current process from the Process dropdown.<br />
<br />
To set the current process from the Processes window:<br />
<br />
*To open the Processes window, while debugging, select Debug > Windows > Processes.<br />
*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.<br />
<br />
[[File:7klee214.PNG|1000px]]<br />
<br />
= User Interface =<br />
For processes, the primary tools are the Attach to Process dialog box, the Processes window, and the Debug Location toolbar.<br />
<br />
For threads, the primary tools for debugging threads are the Threads window, thread markers in source windows, Parallel Stacks window, Parallel Watch window, and the Debug Location toolbar.<br />
<br />
==Attach to Process dialog box==<br />
The Attach to Process dialog box shows outside processes to be attached to the visual Studio debugger.<br />
<br />
[[File:8klee214.PNG|1000px]]<br />
<br />
'''You can attach the following processes'''<br />
<br />
*Process name (.exe)<br />
*Process ID number<br />
*Menubar Title<br />
*Type (Managed v4.0; Managed v2.0, v1.1, v1.0; x86; x64; IA64)<br />
*User Name (account name)<br />
*Session number<br />
<br />
'''Action you can perform'''<br />
<br />
*Select a process to attach to<br />
*Select a remote computer<br />
*Change transport type for connecting to remote computers<br />
<br />
==Processes window==<br />
The Process Window shows processes attached to the Visual Studio debugger.<br />
You can choose one of the processes during debugging mode.<br />
<br />
[[File:9klee214.PNG|1000px]]<br />
<br />
==Threads window==<br />
<br />
<br />
<br />
<br />
'''Setup:'''<br />
<br />
<br />
<br />
'''How to Use:'''<br />
<br />
<br />
<br />
'''Columns:'''<br />
<br />
<br />
==Source window==<br />
<br />
<br />
<br />
'''Setup:'''<br />
<br />
<br />
<br />
'''How to Use:'''<br />
<br />
<br />
==Debug Location toolbar== <br />
<br />
You can set the active or current process in the Debug Location toolbar.<br />
<br />
[[File:10klee214.PNG|1000px]]<br />
<br />
Debug Location toolbar has the following options:<br />
<br />
*Current process<br />
*Suspend the application<br />
*Resume the application<br />
*Suspend and shut down the application<br />
*Current thread<br />
*Toggle current thread flag state<br />
*Show only flagged threads<br />
*Show only current process<br />
*Current stack frame<br />
<br />
With this options you can perform the following actions:<br />
<br />
*Switch to another process<br />
*Suspend, resume, or shut down the application<br />
*Switch to another thread in current process<br />
*Switch to another stack frame in current thread<br />
*Flag or unflag current threads<br />
*Show only flagged threads<br />
*Show only the current process<br />
<br />
==Parallel Stacks window==<br />
<br />
'''Setup:'''<br />
<br />
<br />
'''How to Use:'''<br />
<br />
<br />
<br />
'''Features:''' <br/><br />
<br />
<br />
==Parallel Tasks window==<br />
<br />
==Parallel Watch window==<br />
<br />
<br />
<br />
'''Setup:'''<br />
<br />
<br />
'''How To Use:'''<br />
<br />
'''Features:'''<br />
<br />
= Walkthrough =<br />
<br />
==Case A - Using the Thread window==<br />
<br />
<br />
<br />
'''serial region'''<br />
<br />
<br />
<br />
'''auto OpenMP parallel region '''<br />
<br />
<br />
<br />
<br />
'''OpenMP parallel region thread number decided (8)'''<br />
<br />
==Case B - Using the Parallel Stacks and the Parallel Watch Window==<br />
<br />
<br />
<br />
'''Setup:''' <br />
<br />
<br />
<br />
<br />
'''Walkthrough:'''<br />
<br />
<br />
<br />
'''Setup:''' <br />
<br />
<br />
<br />
'''Walkthrough:'''<br />
<br />
<br />
https://en.wikipedia.org/wiki/Help:Cheatsheet</div>Klee214https://wiki.cdot.senecacollege.ca/w/index.php?title=GPU621/OpenMP_Debugging&diff=156695GPU621/OpenMP Debugging2021-12-06T03:39:19Z<p>Klee214: /* User Interface */</p>
<hr />
<div>=Group Members=<br />
# [mailto:klee214i@myseneca.ca?subject=GPU621 Kimin Lee]<br />
# [mailto:jluna4@myseneca.ca?subject=GPU621 Jashua Luna]<br />
# [mailto:ipark10@myseneca.ca?subject=GPU621 Irene Park]<br />
<br />
=Process and thread=<br />
<br />
==Process==<br />
<br />
A process is the instance of a computer program that is being executed by one or many threads.<br />
<br />
==Thread==<br />
<br />
A thread is a sequence of instructions to which the operating system grants processor time. Every process that is running in the operating system consists of at least one thread. Processes that have more than one thread are called multithreaded.<br />
<br />
==Multiple Processes Debug==<br />
<br />
Visual Studio can debug a solution that has several processes. You can start and switch between processes, break, continue, and step through source, stop debugging, and end or detach from individual processes.<br />
<br />
'''Create two projects'''<br />
<br />
To test it, the best way with Visual Studio is creating two projects. <br />
<br />
*1. Create a new project of Visual Studio<br />
*2. Add a new project within the Solution<br />
*3. Add test files on each projects<br />
<br />
[[File:1klee214.PNG|1000px]]<br />
<br />
'''Start debugging with multiple processes'''<br />
<br />
If you have more than one project in a project solution, you can choose which projects the debugger starts.<br />
<br />
Follow this:<br />
<br />
*Select the solution in Solution Explorer and then select the Properties icon in the toolbar, or right-click the solution and select Properties.<br />
*On the Properties page, select Common Properties > Startup Project.<br />
*Select Current selection, Single startup project and a project file, or Multiple startup projects.<br />
*If you select Multiple startup projects, you can change the startup order and action to take for each project: Start, Start without debugging, or None.<br />
*Select Apply, or OK to apply and close the dialog.<br />
<br />
[[File:2klee214.PNG|1000px]]<br />
<br />
<br />
'''Attach to a process'''<br />
<br />
The debugger can also attach to apps running in processes outside of Visual Studio, including on remote devices.<br />
After we attach to an app, we can use the Visual Studio debugger.<br />
<br />
Follow this:<br />
<br />
*With the app running, select Debug > Attach to Process.<br />
*In the Attach to Process dialog box, select the process from the Available Processes list, and then select Attach.<br />
<br />
[[File:3klee214.PNG|1000px]]<br />
<br />
'''Use the Registry Editor to automatically start a process in the debugger'''<br />
<br />
We might need to debug the startup code for an app that is launched by another process. You can have the debugger launch and automatically attach to the app.<br />
<br />
Follow this:<br />
<br />
*Start the Windows Registry Editor by running regedit.exe.<br />
*In Registry Editor, navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options.<br />
*Select the folder of the app that you want to start in the debugger.<br />
*If the app isn't listed as a child folder, right-click Image File Execution Options, select New > Key, and type the app name. Or, right-click the new *key in the tree, select Rename, and then enter the app name.<br />
*Right-click the new key in the tree and select New > String Value.<br />
*Change the name of the new value from New Value #1 to debugger.<br />
*Right-click debugger and select Modify.<br />
<br />
[[File:4klee214.PNG|1000px]]<br />
<br />
'''Debug with multiple processes'''<br />
<br />
When debugging an app with several processes, the breaking, stepping, and continuing debugger commands affect all processes by default.<br />
You can change this option.<br />
<br />
Follow this:<br />
<br />
*Under Tools (or Debug) > Options > Debugging > General, select or clear the Break all processes when one process breaks check box.<br />
<br />
[[File:5klee214.PNG|1000px]]<br />
<br />
'''Switch between processes'''<br />
<br />
Only one process should be active in the debugger at any given time. We can set the active or current process in the Debug Location toolbar, or in the Processes window. To switch between processes, both processes must be in break mode.<br />
<br />
To set the current process from the Debug Location toolbar:<br />
<br />
*To open the Debug Location toolbar, select View > Toolbars > Debug Location.<br />
*During debugging, on the Debug Location toolbar, select the process you want to set as the current process from the Process dropdown.<br />
<br />
To set the current process from the Processes window:<br />
<br />
*To open the Processes window, while debugging, select Debug > Windows > Processes.<br />
*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.<br />
<br />
[[File:7klee214.PNG|1000px]]<br />
<br />
= User Interface =<br />
For processes, the primary tools are the Attach to Process dialog box, the Processes window, and the Debug Location toolbar.<br />
<br />
For threads, the primary tools for debugging threads are the Threads window, thread markers in source windows, Parallel Stacks window, Parallel Watch window, and the Debug Location toolbar.<br />
<br />
==Attach to Process dialog box==<br />
The Attach to Process dialog box shows outside processes to be attached to the visual Studio debugger.<br />
<br />
[[File:8klee214.PNG]]<br />
<br />
'''You can attach the following processes'''<br />
<br />
*Process name (.exe)<br />
*Process ID number<br />
*Menubar Title<br />
*Type (Managed v4.0; Managed v2.0, v1.1, v1.0; x86; x64; IA64)<br />
*User Name (account name)<br />
*Session number<br />
<br />
'''Action you can perform'''<br />
<br />
*Select a process to attach to<br />
*Select a remote computer<br />
*Change transport type for connecting to remote computers<br />
<br />
==Processes window==<br />
The Process Window shows processes attached to the Visual Studio debugger.<br />
You can choose one of the processes during debugging mode.<br />
<br />
[[File:9klee214.PNG]]<br />
<br />
==Threads window==<br />
<br />
<br />
<br />
<br />
'''Setup:'''<br />
<br />
<br />
<br />
'''How to Use:'''<br />
<br />
<br />
<br />
'''Columns:'''<br />
<br />
<br />
==Source window==<br />
<br />
<br />
<br />
'''Setup:'''<br />
<br />
<br />
<br />
'''How to Use:'''<br />
<br />
<br />
==Debug Location toolbar== <br />
<br />
You can set the active or current process in the Debug Location toolbar.<br />
<br />
[[File:10klee214.PNG]]<br />
<br />
Debug Location toolbar has the following options:<br />
<br />
*Current process<br />
*Suspend the application<br />
*Resume the application<br />
*Suspend and shut down the application<br />
*Current thread<br />
*Toggle current thread flag state<br />
*Show only flagged threads<br />
*Show only current process<br />
*Current stack frame<br />
<br />
With this options you can perform the following actions:<br />
<br />
*Switch to another process<br />
*Suspend, resume, or shut down the application<br />
*Switch to another thread in current process<br />
*Switch to another stack frame in current thread<br />
*Flag or unflag current threads<br />
*Show only flagged threads<br />
*Show only the current process<br />
<br />
==Parallel Stacks window==<br />
<br />
'''Setup:'''<br />
<br />
<br />
'''How to Use:'''<br />
<br />
<br />
<br />
'''Features:''' <br/><br />
<br />
<br />
==Parallel Tasks window==<br />
<br />
==Parallel Watch window==<br />
<br />
<br />
<br />
'''Setup:'''<br />
<br />
<br />
'''How To Use:'''<br />
<br />
'''Features:'''<br />
<br />
= Walkthrough =<br />
<br />
==Case A - Using the Thread window==<br />
<br />
<br />
<br />
'''serial region'''<br />
<br />
<br />
<br />
'''auto OpenMP parallel region '''<br />
<br />
<br />
<br />
<br />
'''OpenMP parallel region thread number decided (8)'''<br />
<br />
==Case B - Using the Parallel Stacks and the Parallel Watch Window==<br />
<br />
<br />
<br />
'''Setup:''' <br />
<br />
<br />
<br />
<br />
'''Walkthrough:'''<br />
<br />
<br />
<br />
'''Setup:''' <br />
<br />
<br />
<br />
'''Walkthrough:'''<br />
<br />
<br />
https://en.wikipedia.org/wiki/Help:Cheatsheet</div>Klee214https://wiki.cdot.senecacollege.ca/w/index.php?title=GPU621/OpenMP_Debugging&diff=156694GPU621/OpenMP Debugging2021-12-06T03:38:36Z<p>Klee214: /* Process and thread */</p>
<hr />
<div>=Group Members=<br />
# [mailto:klee214i@myseneca.ca?subject=GPU621 Kimin Lee]<br />
# [mailto:jluna4@myseneca.ca?subject=GPU621 Jashua Luna]<br />
# [mailto:ipark10@myseneca.ca?subject=GPU621 Irene Park]<br />
<br />
=Process and thread=<br />
<br />
==Process==<br />
<br />
A process is the instance of a computer program that is being executed by one or many threads.<br />
<br />
==Thread==<br />
<br />
A thread is a sequence of instructions to which the operating system grants processor time. Every process that is running in the operating system consists of at least one thread. Processes that have more than one thread are called multithreaded.<br />
<br />
==Multiple Processes Debug==<br />
<br />
Visual Studio can debug a solution that has several processes. You can start and switch between processes, break, continue, and step through source, stop debugging, and end or detach from individual processes.<br />
<br />
'''Create two projects'''<br />
<br />
To test it, the best way with Visual Studio is creating two projects. <br />
<br />
*1. Create a new project of Visual Studio<br />
*2. Add a new project within the Solution<br />
*3. Add test files on each projects<br />
<br />
[[File:1klee214.PNG|1000px]]<br />
<br />
'''Start debugging with multiple processes'''<br />
<br />
If you have more than one project in a project solution, you can choose which projects the debugger starts.<br />
<br />
Follow this:<br />
<br />
*Select the solution in Solution Explorer and then select the Properties icon in the toolbar, or right-click the solution and select Properties.<br />
*On the Properties page, select Common Properties > Startup Project.<br />
*Select Current selection, Single startup project and a project file, or Multiple startup projects.<br />
*If you select Multiple startup projects, you can change the startup order and action to take for each project: Start, Start without debugging, or None.<br />
*Select Apply, or OK to apply and close the dialog.<br />
<br />
[[File:2klee214.PNG|1000px]]<br />
<br />
<br />
'''Attach to a process'''<br />
<br />
The debugger can also attach to apps running in processes outside of Visual Studio, including on remote devices.<br />
After we attach to an app, we can use the Visual Studio debugger.<br />
<br />
Follow this:<br />
<br />
*With the app running, select Debug > Attach to Process.<br />
*In the Attach to Process dialog box, select the process from the Available Processes list, and then select Attach.<br />
<br />
[[File:3klee214.PNG|1000px]]<br />
<br />
'''Use the Registry Editor to automatically start a process in the debugger'''<br />
<br />
We might need to debug the startup code for an app that is launched by another process. You can have the debugger launch and automatically attach to the app.<br />
<br />
Follow this:<br />
<br />
*Start the Windows Registry Editor by running regedit.exe.<br />
*In Registry Editor, navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options.<br />
*Select the folder of the app that you want to start in the debugger.<br />
*If the app isn't listed as a child folder, right-click Image File Execution Options, select New > Key, and type the app name. Or, right-click the new *key in the tree, select Rename, and then enter the app name.<br />
*Right-click the new key in the tree and select New > String Value.<br />
*Change the name of the new value from New Value #1 to debugger.<br />
*Right-click debugger and select Modify.<br />
<br />
[[File:4klee214.PNG|1000px]]<br />
<br />
'''Debug with multiple processes'''<br />
<br />
When debugging an app with several processes, the breaking, stepping, and continuing debugger commands affect all processes by default.<br />
You can change this option.<br />
<br />
Follow this:<br />
<br />
*Under Tools (or Debug) > Options > Debugging > General, select or clear the Break all processes when one process breaks check box.<br />
<br />
[[File:5klee214.PNG|1000px]]<br />
<br />
'''Switch between processes'''<br />
<br />
Only one process should be active in the debugger at any given time. We can set the active or current process in the Debug Location toolbar, or in the Processes window. To switch between processes, both processes must be in break mode.<br />
<br />
To set the current process from the Debug Location toolbar:<br />
<br />
*To open the Debug Location toolbar, select View > Toolbars > Debug Location.<br />
*During debugging, on the Debug Location toolbar, select the process you want to set as the current process from the Process dropdown.<br />
<br />
To set the current process from the Processes window:<br />
<br />
*To open the Processes window, while debugging, select Debug > Windows > Processes.<br />
*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.<br />
<br />
[[File:7klee214.PNG|1000px]]<br />
<br />
= User Interface =<br />
For processes, the primary tools are the Attach to Process dialog box, the Processes window, and the Debug Location toolbar.<br />
<br />
For threads, the primary tools for debugging threads are the Threads window, thread markers in source windows, Parallel Stacks window, Parallel Watch window, and the Debug Location toolbar.<br />
<br />
==Attach to Process dialog box==<br />
The Attach to Process dialog box shows outside processes to be attached to the visual Studio debugger.<br />
<br />
[[File:Example.jpg]]<br />
<br />
'''You can attach the following processes'''<br />
<br />
*Process name (.exe)<br />
*Process ID number<br />
*Menubar Title<br />
*Type (Managed v4.0; Managed v2.0, v1.1, v1.0; x86; x64; IA64)<br />
*User Name (account name)<br />
*Session number<br />
<br />
'''Action you can perform'''<br />
<br />
*Select a process to attach to<br />
*Select a remote computer<br />
*Change transport type for connecting to remote computers<br />
<br />
==Processes window==<br />
The Process Window shows processes attached to the Visual Studio debugger.<br />
You can choose one of the processes during debugging mode.<br />
<br />
[[File:Example.jpg]]<br />
<br />
==Threads window==<br />
<br />
<br />
<br />
<br />
'''Setup:'''<br />
<br />
<br />
<br />
'''How to Use:'''<br />
<br />
<br />
<br />
'''Columns:'''<br />
<br />
<br />
==Source window==<br />
<br />
<br />
<br />
'''Setup:'''<br />
<br />
<br />
<br />
'''How to Use:'''<br />
<br />
<br />
==Debug Location toolbar== <br />
<br />
You can set the active or current process in the Debug Location toolbar.<br />
<br />
[[File:Example.jpg]]<br />
<br />
Debug Location toolbar has the following options:<br />
<br />
*Current process<br />
*Suspend the application<br />
*Resume the application<br />
*Suspend and shut down the application<br />
*Current thread<br />
*Toggle current thread flag state<br />
*Show only flagged threads<br />
*Show only current process<br />
*Current stack frame<br />
<br />
With this options you can perform the following actions:<br />
<br />
*Switch to another process<br />
*Suspend, resume, or shut down the application<br />
*Switch to another thread in current process<br />
*Switch to another stack frame in current thread<br />
*Flag or unflag current threads<br />
*Show only flagged threads<br />
*Show only the current process<br />
<br />
==Parallel Stacks window==<br />
<br />
'''Setup:'''<br />
<br />
<br />
'''How to Use:'''<br />
<br />
<br />
<br />
'''Features:''' <br/><br />
<br />
<br />
==Parallel Tasks window==<br />
<br />
==Parallel Watch window==<br />
<br />
<br />
<br />
'''Setup:'''<br />
<br />
<br />
'''How To Use:'''<br />
<br />
'''Features:'''<br />
<br />
= Walkthrough =<br />
<br />
==Case A - Using the Thread window==<br />
<br />
<br />
<br />
'''serial region'''<br />
<br />
<br />
<br />
'''auto OpenMP parallel region '''<br />
<br />
<br />
<br />
<br />
'''OpenMP parallel region thread number decided (8)'''<br />
<br />
==Case B - Using the Parallel Stacks and the Parallel Watch Window==<br />
<br />
<br />
<br />
'''Setup:''' <br />
<br />
<br />
<br />
<br />
'''Walkthrough:'''<br />
<br />
<br />
<br />
'''Setup:''' <br />
<br />
<br />
<br />
'''Walkthrough:'''<br />
<br />
<br />
https://en.wikipedia.org/wiki/Help:Cheatsheet</div>Klee214https://wiki.cdot.senecacollege.ca/w/index.php?title=GPU621/OpenMP_Debugging&diff=156693GPU621/OpenMP Debugging2021-12-06T03:37:22Z<p>Klee214: /* Process and thread */</p>
<hr />
<div>=Group Members=<br />
# [mailto:klee214i@myseneca.ca?subject=GPU621 Kimin Lee]<br />
# [mailto:jluna4@myseneca.ca?subject=GPU621 Jashua Luna]<br />
# [mailto:ipark10@myseneca.ca?subject=GPU621 Irene Park]<br />
<br />
=Process and thread=<br />
<br />
==Process==<br />
<br />
A process is the instance of a computer program that is being executed by one or many threads.<br />
<br />
==Thread==<br />
<br />
A thread is a sequence of instructions to which the operating system grants processor time. Every process that is running in the operating system consists of at least one thread. Processes that have more than one thread are called multithreaded.<br />
<br />
==Multiple Processes Debug==<br />
<br />
Visual Studio can debug a solution that has several processes. You can start and switch between processes, break, continue, and step through source, stop debugging, and end or detach from individual processes.<br />
<br />
'''Create two projects'''<br />
<br />
To test it, the best way with Visual Studio is creating two projects. <br />
<br />
*1. Create a new project of Visual Studio<br />
*2. Add a new project within the Solution<br />
*3. Add test files on each projects<br />
<br />
[[File:1klee214.PNG|1000px]]<br />
<br />
'''Start debugging with multiple processes'''<br />
<br />
If you have more than one project in a project solution, you can choose which projects the debugger starts.<br />
<br />
Follow this:<br />
<br />
*Select the solution in Solution Explorer and then select the Properties icon in the toolbar, or right-click the solution and select Properties.<br />
*On the Properties page, select Common Properties > Startup Project.<br />
*Select Current selection, Single startup project and a project file, or Multiple startup projects.<br />
*If you select Multiple startup projects, you can change the startup order and action to take for each project: Start, Start without debugging, or None.<br />
*Select Apply, or OK to apply and close the dialog.<br />
<br />
[[File:2klee214.PNG|1000px]]<br />
<br />
<br />
'''Attach to a process'''<br />
<br />
The debugger can also attach to apps running in processes outside of Visual Studio, including on remote devices.<br />
After we attach to an app, we can use the Visual Studio debugger.<br />
<br />
Follow this:<br />
<br />
*With the app running, select Debug > Attach to Process.<br />
*In the Attach to Process dialog box, select the process from the Available Processes list, and then select Attach.<br />
<br />
[[File:3klee214.PNG|1000px]]<br />
<br />
'''Use the Registry Editor to automatically start a process in the debugger'''<br />
<br />
We might need to debug the startup code for an app that is launched by another process. You can have the debugger launch and automatically attach to the app.<br />
<br />
Follow this:<br />
<br />
*Start the Windows Registry Editor by running regedit.exe.<br />
*In Registry Editor, navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options.<br />
*Select the folder of the app that you want to start in the debugger.<br />
*If the app isn't listed as a child folder, right-click Image File Execution Options, select New > Key, and type the app name. Or, right-click the new *key in the tree, select Rename, and then enter the app name.<br />
*Right-click the new key in the tree and select New > String Value.<br />
*Change the name of the new value from New Value #1 to debugger.<br />
*Right-click debugger and select Modify.<br />
<br />
[[File:4klee214.PNG|1000px]]<br />
<br />
'''Debug with multiple processes'''<br />
<br />
When debugging an app with several processes, the breaking, stepping, and continuing debugger commands affect all processes by default.<br />
You can change this option.<br />
<br />
Follow this:<br />
<br />
*Under Tools (or Debug) > Options > Debugging > General, select or clear the Break all processes when one process breaks check box.<br />
<br />
[[File:5klee214.PNG|1000px]]<br />
<br />
'''Switch between processes'''<br />
<br />
Only one process should be active in the debugger at any given time. We can set the active or current process in the Debug Location toolbar, or in the Processes window. To switch between processes, both processes must be in break mode.<br />
<br />
To set the current process from the Debug Location toolbar:<br />
<br />
*To open the Debug Location toolbar, select View > Toolbars > Debug Location.<br />
*During debugging, on the Debug Location toolbar, select the process you want to set as the current process from the Process dropdown.<br />
<br />
To set the current process from the Processes window:<br />
<br />
*To open the Processes window, while debugging, select Debug > Windows > Processes.<br />
*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.<br />
<br />
[[File:6klee214.PNG|1000px]]<br />
<br />
= User Interface =<br />
For processes, the primary tools are the Attach to Process dialog box, the Processes window, and the Debug Location toolbar.<br />
<br />
For threads, the primary tools for debugging threads are the Threads window, thread markers in source windows, Parallel Stacks window, Parallel Watch window, and the Debug Location toolbar.<br />
<br />
==Attach to Process dialog box==<br />
The Attach to Process dialog box shows outside processes to be attached to the visual Studio debugger.<br />
<br />
[[File:Example.jpg]]<br />
<br />
'''You can attach the following processes'''<br />
<br />
*Process name (.exe)<br />
*Process ID number<br />
*Menubar Title<br />
*Type (Managed v4.0; Managed v2.0, v1.1, v1.0; x86; x64; IA64)<br />
*User Name (account name)<br />
*Session number<br />
<br />
'''Action you can perform'''<br />
<br />
*Select a process to attach to<br />
*Select a remote computer<br />
*Change transport type for connecting to remote computers<br />
<br />
==Processes window==<br />
The Process Window shows processes attached to the Visual Studio debugger.<br />
You can choose one of the processes during debugging mode.<br />
<br />
[[File:Example.jpg]]<br />
<br />
==Threads window==<br />
<br />
<br />
<br />
<br />
'''Setup:'''<br />
<br />
<br />
<br />
'''How to Use:'''<br />
<br />
<br />
<br />
'''Columns:'''<br />
<br />
<br />
==Source window==<br />
<br />
<br />
<br />
'''Setup:'''<br />
<br />
<br />
<br />
'''How to Use:'''<br />
<br />
<br />
==Debug Location toolbar== <br />
<br />
You can set the active or current process in the Debug Location toolbar.<br />
<br />
[[File:Example.jpg]]<br />
<br />
Debug Location toolbar has the following options:<br />
<br />
*Current process<br />
*Suspend the application<br />
*Resume the application<br />
*Suspend and shut down the application<br />
*Current thread<br />
*Toggle current thread flag state<br />
*Show only flagged threads<br />
*Show only current process<br />
*Current stack frame<br />
<br />
With this options you can perform the following actions:<br />
<br />
*Switch to another process<br />
*Suspend, resume, or shut down the application<br />
*Switch to another thread in current process<br />
*Switch to another stack frame in current thread<br />
*Flag or unflag current threads<br />
*Show only flagged threads<br />
*Show only the current process<br />
<br />
==Parallel Stacks window==<br />
<br />
'''Setup:'''<br />
<br />
<br />
'''How to Use:'''<br />
<br />
<br />
<br />
'''Features:''' <br/><br />
<br />
<br />
==Parallel Tasks window==<br />
<br />
==Parallel Watch window==<br />
<br />
<br />
<br />
'''Setup:'''<br />
<br />
<br />
'''How To Use:'''<br />
<br />
'''Features:'''<br />
<br />
= Walkthrough =<br />
<br />
==Case A - Using the Thread window==<br />
<br />
<br />
<br />
'''serial region'''<br />
<br />
<br />
<br />
'''auto OpenMP parallel region '''<br />
<br />
<br />
<br />
<br />
'''OpenMP parallel region thread number decided (8)'''<br />
<br />
==Case B - Using the Parallel Stacks and the Parallel Watch Window==<br />
<br />
<br />
<br />
'''Setup:''' <br />
<br />
<br />
<br />
<br />
'''Walkthrough:'''<br />
<br />
<br />
<br />
'''Setup:''' <br />
<br />
<br />
<br />
'''Walkthrough:'''<br />
<br />
<br />
https://en.wikipedia.org/wiki/Help:Cheatsheet</div>Klee214https://wiki.cdot.senecacollege.ca/w/index.php?title=GPU621/OpenMP_Debugging&diff=156692GPU621/OpenMP Debugging2021-12-06T03:35:45Z<p>Klee214: /* Multiple Processes Debug */</p>
<hr />
<div>=Group Members=<br />
# [mailto:klee214i@myseneca.ca?subject=GPU621 Kimin Lee]<br />
# [mailto:jluna4@myseneca.ca?subject=GPU621 Jashua Luna]<br />
# [mailto:ipark10@myseneca.ca?subject=GPU621 Irene Park]<br />
<br />
=Process and thread=<br />
<br />
==Process==<br />
<br />
A process is the instance of a computer program that is being executed by one or many threads.<br />
<br />
==Thread==<br />
<br />
A thread is a sequence of instructions to which the operating system grants processor time. Every process that is running in the operating system consists of at least one thread. Processes that have more than one thread are called multithreaded.<br />
<br />
==Multiple Processes Debug==<br />
<br />
Visual Studio can debug a solution that has several processes. You can start and switch between processes, break, continue, and step through source, stop debugging, and end or detach from individual processes.<br />
<br />
'''Create two projects'''<br />
<br />
To test it, the best way with Visual Studio is creating two projects. <br />
<br />
*1. Create a new project of Visual Studio<br />
*2. Add a new project within the Solution<br />
*3. Add test files on each projects<br />
<br />
[[File:1klee214.PNG]]<br />
<br />
'''Start debugging with multiple processes'''<br />
<br />
If you have more than one project in a project solution, you can choose which projects the debugger starts.<br />
<br />
Follow this:<br />
<br />
*Select the solution in Solution Explorer and then select the Properties icon in the toolbar, or right-click the solution and select Properties.<br />
*On the Properties page, select Common Properties > Startup Project.<br />
*Select Current selection, Single startup project and a project file, or Multiple startup projects.<br />
*If you select Multiple startup projects, you can change the startup order and action to take for each project: Start, Start without debugging, or None.<br />
*Select Apply, or OK to apply and close the dialog.<br />
<br />
[[File:2klee214.PNG]]<br />
<br />
<br />
'''Attach to a process'''<br />
<br />
The debugger can also attach to apps running in processes outside of Visual Studio, including on remote devices.<br />
After we attach to an app, we can use the Visual Studio debugger.<br />
<br />
Follow this:<br />
<br />
*With the app running, select Debug > Attach to Process.<br />
*In the Attach to Process dialog box, select the process from the Available Processes list, and then select Attach.<br />
<br />
[[File:3klee214.PNG]]<br />
<br />
'''Use the Registry Editor to automatically start a process in the debugger'''<br />
<br />
We might need to debug the startup code for an app that is launched by another process. You can have the debugger launch and automatically attach to the app.<br />
<br />
Follow this:<br />
<br />
*Start the Windows Registry Editor by running regedit.exe.<br />
*In Registry Editor, navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options.<br />
*Select the folder of the app that you want to start in the debugger.<br />
*If the app isn't listed as a child folder, right-click Image File Execution Options, select New > Key, and type the app name. Or, right-click the new *key in the tree, select Rename, and then enter the app name.<br />
*Right-click the new key in the tree and select New > String Value.<br />
*Change the name of the new value from New Value #1 to debugger.<br />
*Right-click debugger and select Modify.<br />
<br />
[[File:4klee214.PNG]]<br />
<br />
'''Debug with multiple processes'''<br />
<br />
When debugging an app with several processes, the breaking, stepping, and continuing debugger commands affect all processes by default.<br />
You can change this option.<br />
<br />
Follow this:<br />
<br />
*Under Tools (or Debug) > Options > Debugging > General, select or clear the Break all processes when one process breaks check box.<br />
<br />
[[File:5klee214.PNG]]<br />
<br />
'''Switch between processes'''<br />
<br />
Only one process should be active in the debugger at any given time. We can set the active or current process in the Debug Location toolbar, or in the Processes window. To switch between processes, both processes must be in break mode.<br />
<br />
To set the current process from the Debug Location toolbar:<br />
<br />
*To open the Debug Location toolbar, select View > Toolbars > Debug Location.<br />
*During debugging, on the Debug Location toolbar, select the process you want to set as the current process from the Process dropdown.<br />
<br />
To set the current process from the Processes window:<br />
<br />
*To open the Processes window, while debugging, select Debug > Windows > Processes.<br />
*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.<br />
<br />
[[File:6klee214.PNG]]<br />
<br />
= User Interface =<br />
For processes, the primary tools are the Attach to Process dialog box, the Processes window, and the Debug Location toolbar.<br />
<br />
For threads, the primary tools for debugging threads are the Threads window, thread markers in source windows, Parallel Stacks window, Parallel Watch window, and the Debug Location toolbar.<br />
<br />
==Attach to Process dialog box==<br />
The Attach to Process dialog box shows outside processes to be attached to the visual Studio debugger.<br />
<br />
[[File:Example.jpg]]<br />
<br />
'''You can attach the following processes'''<br />
<br />
*Process name (.exe)<br />
*Process ID number<br />
*Menubar Title<br />
*Type (Managed v4.0; Managed v2.0, v1.1, v1.0; x86; x64; IA64)<br />
*User Name (account name)<br />
*Session number<br />
<br />
'''Action you can perform'''<br />
<br />
*Select a process to attach to<br />
*Select a remote computer<br />
*Change transport type for connecting to remote computers<br />
<br />
==Processes window==<br />
The Process Window shows processes attached to the Visual Studio debugger.<br />
You can choose one of the processes during debugging mode.<br />
<br />
[[File:Example.jpg]]<br />
<br />
==Threads window==<br />
<br />
<br />
<br />
<br />
'''Setup:'''<br />
<br />
<br />
<br />
'''How to Use:'''<br />
<br />
<br />
<br />
'''Columns:'''<br />
<br />
<br />
==Source window==<br />
<br />
<br />
<br />
'''Setup:'''<br />
<br />
<br />
<br />
'''How to Use:'''<br />
<br />
<br />
==Debug Location toolbar== <br />
<br />
You can set the active or current process in the Debug Location toolbar.<br />
<br />
[[File:Example.jpg]]<br />
<br />
Debug Location toolbar has the following options:<br />
<br />
*Current process<br />
*Suspend the application<br />
*Resume the application<br />
*Suspend and shut down the application<br />
*Current thread<br />
*Toggle current thread flag state<br />
*Show only flagged threads<br />
*Show only current process<br />
*Current stack frame<br />
<br />
With this options you can perform the following actions:<br />
<br />
*Switch to another process<br />
*Suspend, resume, or shut down the application<br />
*Switch to another thread in current process<br />
*Switch to another stack frame in current thread<br />
*Flag or unflag current threads<br />
*Show only flagged threads<br />
*Show only the current process<br />
<br />
==Parallel Stacks window==<br />
<br />
'''Setup:'''<br />
<br />
<br />
'''How to Use:'''<br />
<br />
<br />
<br />
'''Features:''' <br/><br />
<br />
<br />
==Parallel Tasks window==<br />
<br />
==Parallel Watch window==<br />
<br />
<br />
<br />
'''Setup:'''<br />
<br />
<br />
'''How To Use:'''<br />
<br />
'''Features:'''<br />
<br />
= Walkthrough =<br />
<br />
==Case A - Using the Thread window==<br />
<br />
<br />
<br />
'''serial region'''<br />
<br />
<br />
<br />
'''auto OpenMP parallel region '''<br />
<br />
<br />
<br />
<br />
'''OpenMP parallel region thread number decided (8)'''<br />
<br />
==Case B - Using the Parallel Stacks and the Parallel Watch Window==<br />
<br />
<br />
<br />
'''Setup:''' <br />
<br />
<br />
<br />
<br />
'''Walkthrough:'''<br />
<br />
<br />
<br />
'''Setup:''' <br />
<br />
<br />
<br />
'''Walkthrough:'''<br />
<br />
<br />
https://en.wikipedia.org/wiki/Help:Cheatsheet</div>Klee214https://wiki.cdot.senecacollege.ca/w/index.php?title=GPU621/OpenMP_Debugging&diff=156691GPU621/OpenMP Debugging2021-12-06T03:34:51Z<p>Klee214: /* Process and thread */</p>
<hr />
<div>=Group Members=<br />
# [mailto:klee214i@myseneca.ca?subject=GPU621 Kimin Lee]<br />
# [mailto:jluna4@myseneca.ca?subject=GPU621 Jashua Luna]<br />
# [mailto:ipark10@myseneca.ca?subject=GPU621 Irene Park]<br />
<br />
=Process and thread=<br />
<br />
==Process==<br />
<br />
A process is the instance of a computer program that is being executed by one or many threads.<br />
<br />
==Thread==<br />
<br />
A thread is a sequence of instructions to which the operating system grants processor time. Every process that is running in the operating system consists of at least one thread. Processes that have more than one thread are called multithreaded.<br />
<br />
==Multiple Processes Debug==<br />
<br />
Visual Studio can debug a solution that has several processes. You can start and switch between processes, break, continue, and step through source, stop debugging, and end or detach from individual processes.<br />
<br />
'''Create two projects'''<br />
<br />
To test it, the best way with Visual Studio is creating two projects. <br />
<br />
*1. Create a new project of Visual Studio<br />
*2. Add a new project within the Solution<br />
*3. Add test files on each projects<br />
<br />
[[File:1klee214.png]]<br />
<br />
'''Start debugging with multiple processes'''<br />
<br />
If you have more than one project in a project solution, you can choose which projects the debugger starts.<br />
<br />
Follow this:<br />
<br />
*Select the solution in Solution Explorer and then select the Properties icon in the toolbar, or right-click the solution and select Properties.<br />
*On the Properties page, select Common Properties > Startup Project.<br />
*Select Current selection, Single startup project and a project file, or Multiple startup projects.<br />
*If you select Multiple startup projects, you can change the startup order and action to take for each project: Start, Start without debugging, or None.<br />
*Select Apply, or OK to apply and close the dialog.<br />
<br />
[[File:2klee214.png]]<br />
<br />
<br />
'''Attach to a process'''<br />
<br />
The debugger can also attach to apps running in processes outside of Visual Studio, including on remote devices.<br />
After we attach to an app, we can use the Visual Studio debugger.<br />
<br />
Follow this:<br />
<br />
*With the app running, select Debug > Attach to Process.<br />
*In the Attach to Process dialog box, select the process from the Available Processes list, and then select Attach.<br />
<br />
[[File:3klee214.png]]<br />
<br />
'''Use the Registry Editor to automatically start a process in the debugger'''<br />
<br />
We might need to debug the startup code for an app that is launched by another process. You can have the debugger launch and automatically attach to the app.<br />
<br />
Follow this:<br />
<br />
*Start the Windows Registry Editor by running regedit.exe.<br />
*In Registry Editor, navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options.<br />
*Select the folder of the app that you want to start in the debugger.<br />
*If the app isn't listed as a child folder, right-click Image File Execution Options, select New > Key, and type the app name. Or, right-click the new *key in the tree, select Rename, and then enter the app name.<br />
*Right-click the new key in the tree and select New > String Value.<br />
*Change the name of the new value from New Value #1 to debugger.<br />
*Right-click debugger and select Modify.<br />
<br />
[[File:4klee214.png]]<br />
<br />
'''Debug with multiple processes'''<br />
<br />
When debugging an app with several processes, the breaking, stepping, and continuing debugger commands affect all processes by default.<br />
You can change this option.<br />
<br />
Follow this:<br />
<br />
*Under Tools (or Debug) > Options > Debugging > General, select or clear the Break all processes when one process breaks check box.<br />
<br />
[[File:5klee214.png]]<br />
<br />
'''Switch between processes'''<br />
<br />
Only one process should be active in the debugger at any given time. We can set the active or current process in the Debug Location toolbar, or in the Processes window. To switch between processes, both processes must be in break mode.<br />
<br />
To set the current process from the Debug Location toolbar:<br />
<br />
*To open the Debug Location toolbar, select View > Toolbars > Debug Location.<br />
*During debugging, on the Debug Location toolbar, select the process you want to set as the current process from the Process dropdown.<br />
<br />
To set the current process from the Processes window:<br />
<br />
*To open the Processes window, while debugging, select Debug > Windows > Processes.<br />
*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.<br />
<br />
[[File:6klee214.png]]<br />
<br />
= User Interface =<br />
For processes, the primary tools are the Attach to Process dialog box, the Processes window, and the Debug Location toolbar.<br />
<br />
For threads, the primary tools for debugging threads are the Threads window, thread markers in source windows, Parallel Stacks window, Parallel Watch window, and the Debug Location toolbar.<br />
<br />
==Attach to Process dialog box==<br />
The Attach to Process dialog box shows outside processes to be attached to the visual Studio debugger.<br />
<br />
[[File:Example.jpg]]<br />
<br />
'''You can attach the following processes'''<br />
<br />
*Process name (.exe)<br />
*Process ID number<br />
*Menubar Title<br />
*Type (Managed v4.0; Managed v2.0, v1.1, v1.0; x86; x64; IA64)<br />
*User Name (account name)<br />
*Session number<br />
<br />
'''Action you can perform'''<br />
<br />
*Select a process to attach to<br />
*Select a remote computer<br />
*Change transport type for connecting to remote computers<br />
<br />
==Processes window==<br />
The Process Window shows processes attached to the Visual Studio debugger.<br />
You can choose one of the processes during debugging mode.<br />
<br />
[[File:Example.jpg]]<br />
<br />
==Threads window==<br />
<br />
<br />
<br />
<br />
'''Setup:'''<br />
<br />
<br />
<br />
'''How to Use:'''<br />
<br />
<br />
<br />
'''Columns:'''<br />
<br />
<br />
==Source window==<br />
<br />
<br />
<br />
'''Setup:'''<br />
<br />
<br />
<br />
'''How to Use:'''<br />
<br />
<br />
==Debug Location toolbar== <br />
<br />
You can set the active or current process in the Debug Location toolbar.<br />
<br />
[[File:Example.jpg]]<br />
<br />
Debug Location toolbar has the following options:<br />
<br />
*Current process<br />
*Suspend the application<br />
*Resume the application<br />
*Suspend and shut down the application<br />
*Current thread<br />
*Toggle current thread flag state<br />
*Show only flagged threads<br />
*Show only current process<br />
*Current stack frame<br />
<br />
With this options you can perform the following actions:<br />
<br />
*Switch to another process<br />
*Suspend, resume, or shut down the application<br />
*Switch to another thread in current process<br />
*Switch to another stack frame in current thread<br />
*Flag or unflag current threads<br />
*Show only flagged threads<br />
*Show only the current process<br />
<br />
==Parallel Stacks window==<br />
<br />
'''Setup:'''<br />
<br />
<br />
'''How to Use:'''<br />
<br />
<br />
<br />
'''Features:''' <br/><br />
<br />
<br />
==Parallel Tasks window==<br />
<br />
==Parallel Watch window==<br />
<br />
<br />
<br />
'''Setup:'''<br />
<br />
<br />
'''How To Use:'''<br />
<br />
'''Features:'''<br />
<br />
= Walkthrough =<br />
<br />
==Case A - Using the Thread window==<br />
<br />
<br />
<br />
'''serial region'''<br />
<br />
<br />
<br />
'''auto OpenMP parallel region '''<br />
<br />
<br />
<br />
<br />
'''OpenMP parallel region thread number decided (8)'''<br />
<br />
==Case B - Using the Parallel Stacks and the Parallel Watch Window==<br />
<br />
<br />
<br />
'''Setup:''' <br />
<br />
<br />
<br />
<br />
'''Walkthrough:'''<br />
<br />
<br />
<br />
'''Setup:''' <br />
<br />
<br />
<br />
'''Walkthrough:'''<br />
<br />
<br />
https://en.wikipedia.org/wiki/Help:Cheatsheet</div>Klee214https://wiki.cdot.senecacollege.ca/w/index.php?title=GPU621/OpenMP_Debugging&diff=156690GPU621/OpenMP Debugging2021-12-06T03:34:10Z<p>Klee214: /* Process and thread */</p>
<hr />
<div>=Group Members=<br />
# [mailto:klee214i@myseneca.ca?subject=GPU621 Kimin Lee]<br />
# [mailto:jluna4@myseneca.ca?subject=GPU621 Jashua Luna]<br />
# [mailto:ipark10@myseneca.ca?subject=GPU621 Irene Park]<br />
<br />
=Process and thread=<br />
<br />
==Process==<br />
<br />
A process is the instance of a computer program that is being executed by one or many threads.<br />
<br />
==Thread==<br />
<br />
A thread is a sequence of instructions to which the operating system grants processor time. Every process that is running in the operating system consists of at least one thread. Processes that have more than one thread are called multithreaded.<br />
<br />
==Multiple Processes Debug==<br />
<br />
Visual Studio can debug a solution that has several processes. You can start and switch between processes, break, continue, and step through source, stop debugging, and end or detach from individual processes.<br />
<br />
'''Create two projects'''<br />
<br />
To test it, the best way with Visual Studio is creating two projects. <br />
<br />
*1. Create a new project of Visual Studio<br />
*2. Add a new project within the Solution<br />
*3. Add test files on each projects<br />
<br />
[[File:1klee214.jpg]]<br />
<br />
'''Start debugging with multiple processes'''<br />
<br />
If you have more than one project in a project solution, you can choose which projects the debugger starts.<br />
<br />
Follow this:<br />
<br />
*Select the solution in Solution Explorer and then select the Properties icon in the toolbar, or right-click the solution and select Properties.<br />
*On the Properties page, select Common Properties > Startup Project.<br />
*Select Current selection, Single startup project and a project file, or Multiple startup projects.<br />
*If you select Multiple startup projects, you can change the startup order and action to take for each project: Start, Start without debugging, or None.<br />
*Select Apply, or OK to apply and close the dialog.<br />
<br />
[[File:2klee214.jpg]]<br />
<br />
<br />
'''Attach to a process'''<br />
<br />
The debugger can also attach to apps running in processes outside of Visual Studio, including on remote devices.<br />
After we attach to an app, we can use the Visual Studio debugger.<br />
<br />
Follow this:<br />
<br />
*With the app running, select Debug > Attach to Process.<br />
*In the Attach to Process dialog box, select the process from the Available Processes list, and then select Attach.<br />
<br />
[[File:3klee214.jpg]]<br />
<br />
'''Use the Registry Editor to automatically start a process in the debugger'''<br />
<br />
We might need to debug the startup code for an app that is launched by another process. You can have the debugger launch and automatically attach to the app.<br />
<br />
Follow this:<br />
<br />
*Start the Windows Registry Editor by running regedit.exe.<br />
*In Registry Editor, navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options.<br />
*Select the folder of the app that you want to start in the debugger.<br />
*If the app isn't listed as a child folder, right-click Image File Execution Options, select New > Key, and type the app name. Or, right-click the new *key in the tree, select Rename, and then enter the app name.<br />
*Right-click the new key in the tree and select New > String Value.<br />
*Change the name of the new value from New Value #1 to debugger.<br />
*Right-click debugger and select Modify.<br />
<br />
[[File:4klee214.jpg]]<br />
<br />
'''Debug with multiple processes'''<br />
<br />
When debugging an app with several processes, the breaking, stepping, and continuing debugger commands affect all processes by default.<br />
You can change this option.<br />
<br />
Follow this:<br />
<br />
*Under Tools (or Debug) > Options > Debugging > General, select or clear the Break all processes when one process breaks check box.<br />
<br />
[[File:5klee214.jpg]]<br />
<br />
'''Switch between processes'''<br />
<br />
Only one process should be active in the debugger at any given time. We can set the active or current process in the Debug Location toolbar, or in the Processes window. To switch between processes, both processes must be in break mode.<br />
<br />
To set the current process from the Debug Location toolbar:<br />
<br />
*To open the Debug Location toolbar, select View > Toolbars > Debug Location.<br />
*During debugging, on the Debug Location toolbar, select the process you want to set as the current process from the Process dropdown.<br />
<br />
To set the current process from the Processes window:<br />
<br />
*To open the Processes window, while debugging, select Debug > Windows > Processes.<br />
*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.<br />
<br />
[[File:6klee214.jpg]]<br />
<br />
= User Interface =<br />
For processes, the primary tools are the Attach to Process dialog box, the Processes window, and the Debug Location toolbar.<br />
<br />
For threads, the primary tools for debugging threads are the Threads window, thread markers in source windows, Parallel Stacks window, Parallel Watch window, and the Debug Location toolbar.<br />
<br />
==Attach to Process dialog box==<br />
The Attach to Process dialog box shows outside processes to be attached to the visual Studio debugger.<br />
<br />
[[File:Example.jpg]]<br />
<br />
'''You can attach the following processes'''<br />
<br />
*Process name (.exe)<br />
*Process ID number<br />
*Menubar Title<br />
*Type (Managed v4.0; Managed v2.0, v1.1, v1.0; x86; x64; IA64)<br />
*User Name (account name)<br />
*Session number<br />
<br />
'''Action you can perform'''<br />
<br />
*Select a process to attach to<br />
*Select a remote computer<br />
*Change transport type for connecting to remote computers<br />
<br />
==Processes window==<br />
The Process Window shows processes attached to the Visual Studio debugger.<br />
You can choose one of the processes during debugging mode.<br />
<br />
[[File:Example.jpg]]<br />
<br />
==Threads window==<br />
<br />
<br />
<br />
<br />
'''Setup:'''<br />
<br />
<br />
<br />
'''How to Use:'''<br />
<br />
<br />
<br />
'''Columns:'''<br />
<br />
<br />
==Source window==<br />
<br />
<br />
<br />
'''Setup:'''<br />
<br />
<br />
<br />
'''How to Use:'''<br />
<br />
<br />
==Debug Location toolbar== <br />
<br />
You can set the active or current process in the Debug Location toolbar.<br />
<br />
[[File:Example.jpg]]<br />
<br />
Debug Location toolbar has the following options:<br />
<br />
*Current process<br />
*Suspend the application<br />
*Resume the application<br />
*Suspend and shut down the application<br />
*Current thread<br />
*Toggle current thread flag state<br />
*Show only flagged threads<br />
*Show only current process<br />
*Current stack frame<br />
<br />
With this options you can perform the following actions:<br />
<br />
*Switch to another process<br />
*Suspend, resume, or shut down the application<br />
*Switch to another thread in current process<br />
*Switch to another stack frame in current thread<br />
*Flag or unflag current threads<br />
*Show only flagged threads<br />
*Show only the current process<br />
<br />
==Parallel Stacks window==<br />
<br />
'''Setup:'''<br />
<br />
<br />
'''How to Use:'''<br />
<br />
<br />
<br />
'''Features:''' <br/><br />
<br />
<br />
==Parallel Tasks window==<br />
<br />
==Parallel Watch window==<br />
<br />
<br />
<br />
'''Setup:'''<br />
<br />
<br />
'''How To Use:'''<br />
<br />
'''Features:'''<br />
<br />
= Walkthrough =<br />
<br />
==Case A - Using the Thread window==<br />
<br />
<br />
<br />
'''serial region'''<br />
<br />
<br />
<br />
'''auto OpenMP parallel region '''<br />
<br />
<br />
<br />
<br />
'''OpenMP parallel region thread number decided (8)'''<br />
<br />
==Case B - Using the Parallel Stacks and the Parallel Watch Window==<br />
<br />
<br />
<br />
'''Setup:''' <br />
<br />
<br />
<br />
<br />
'''Walkthrough:'''<br />
<br />
<br />
<br />
'''Setup:''' <br />
<br />
<br />
<br />
'''Walkthrough:'''<br />
<br />
<br />
https://en.wikipedia.org/wiki/Help:Cheatsheet</div>Klee214https://wiki.cdot.senecacollege.ca/w/index.php?title=File:7klee214.PNG&diff=156689File:7klee214.PNG2021-12-06T03:33:04Z<p>Klee214: </p>
<hr />
<div></div>Klee214https://wiki.cdot.senecacollege.ca/w/index.php?title=File:6klee214.PNG&diff=156688File:6klee214.PNG2021-12-06T03:32:47Z<p>Klee214: </p>
<hr />
<div></div>Klee214https://wiki.cdot.senecacollege.ca/w/index.php?title=File:5klee214.PNG&diff=156687File:5klee214.PNG2021-12-06T03:32:30Z<p>Klee214: </p>
<hr />
<div></div>Klee214https://wiki.cdot.senecacollege.ca/w/index.php?title=File:4klee214.PNG&diff=156686File:4klee214.PNG2021-12-06T03:32:15Z<p>Klee214: </p>
<hr />
<div></div>Klee214https://wiki.cdot.senecacollege.ca/w/index.php?title=File:3klee214.PNG&diff=156685File:3klee214.PNG2021-12-06T03:32:01Z<p>Klee214: </p>
<hr />
<div></div>Klee214https://wiki.cdot.senecacollege.ca/w/index.php?title=File:2klee214.PNG&diff=156684File:2klee214.PNG2021-12-06T03:31:44Z<p>Klee214: </p>
<hr />
<div></div>Klee214https://wiki.cdot.senecacollege.ca/w/index.php?title=File:1klee214.PNG&diff=156683File:1klee214.PNG2021-12-06T03:31:29Z<p>Klee214: </p>
<hr />
<div></div>Klee214https://wiki.cdot.senecacollege.ca/w/index.php?title=File:10klee214.PNG&diff=156682File:10klee214.PNG2021-12-06T03:30:28Z<p>Klee214: </p>
<hr />
<div></div>Klee214https://wiki.cdot.senecacollege.ca/w/index.php?title=File:9klee214.PNG&diff=156681File:9klee214.PNG2021-12-06T03:30:15Z<p>Klee214: </p>
<hr />
<div></div>Klee214https://wiki.cdot.senecacollege.ca/w/index.php?title=File:8klee214.PNG&diff=156680File:8klee214.PNG2021-12-06T03:30:01Z<p>Klee214: </p>
<hr />
<div></div>Klee214https://wiki.cdot.senecacollege.ca/w/index.php?title=File:7k.PNG&diff=156679File:7k.PNG2021-12-06T03:29:17Z<p>Klee214: </p>
<hr />
<div></div>Klee214https://wiki.cdot.senecacollege.ca/w/index.php?title=File:6k.PNG&diff=156678File:6k.PNG2021-12-06T03:28:58Z<p>Klee214: </p>
<hr />
<div></div>Klee214https://wiki.cdot.senecacollege.ca/w/index.php?title=File:5.PNG&diff=156677File:5.PNG2021-12-06T03:28:03Z<p>Klee214: Klee214 uploaded a new version of File:5.PNG</p>
<hr />
<div></div>Klee214https://wiki.cdot.senecacollege.ca/w/index.php?title=File:4.PNG&diff=156676File:4.PNG2021-12-06T03:27:28Z<p>Klee214: Klee214 uploaded a new version of File:4.PNG</p>
<hr />
<div></div>Klee214https://wiki.cdot.senecacollege.ca/w/index.php?title=File:3.PNG&diff=156675File:3.PNG2021-12-06T03:27:16Z<p>Klee214: Klee214 uploaded a new version of File:3.PNG</p>
<hr />
<div></div>Klee214https://wiki.cdot.senecacollege.ca/w/index.php?title=File:2.PNG&diff=156674File:2.PNG2021-12-06T03:27:06Z<p>Klee214: Klee214 uploaded a new version of File:2.PNG</p>
<hr />
<div></div>Klee214https://wiki.cdot.senecacollege.ca/w/index.php?title=File:1.PNG&diff=156673File:1.PNG2021-12-06T03:26:50Z<p>Klee214: Klee214 uploaded a new version of File:1.PNG</p>
<hr />
<div></div>Klee214https://wiki.cdot.senecacollege.ca/w/index.php?title=GPU621/OpenMP_Debugging&diff=156672GPU621/OpenMP Debugging2021-12-06T03:25:55Z<p>Klee214: /* User Interface */</p>
<hr />
<div>=Group Members=<br />
# [mailto:klee214i@myseneca.ca?subject=GPU621 Kimin Lee]<br />
# [mailto:jluna4@myseneca.ca?subject=GPU621 Jashua Luna]<br />
# [mailto:ipark10@myseneca.ca?subject=GPU621 Irene Park]<br />
<br />
=Process and thread=<br />
<br />
==Process==<br />
<br />
A process is the instance of a computer program that is being executed by one or many threads.<br />
<br />
==Thread==<br />
<br />
A thread is a sequence of instructions to which the operating system grants processor time. Every process that is running in the operating system consists of at least one thread. Processes that have more than one thread are called multithreaded.<br />
<br />
==Multiple Processes Debug==<br />
<br />
Visual Studio can debug a solution that has several processes. You can start and switch between processes, break, continue, and step through source, stop debugging, and end or detach from individual processes.<br />
<br />
'''Create two projects'''<br />
<br />
To test it, the best way with Visual Studio is creating two projects. <br />
<br />
*1. Create a new project of Visual Studio<br />
*2. Add a new project within the Solution<br />
*3. Add test files on each projects<br />
<br />
[[File:Example.jpg]]<br />
<br />
'''Start debugging with multiple processes'''<br />
<br />
If you have more than one project in a project solution, you can choose which projects the debugger starts.<br />
<br />
Follow this:<br />
<br />
*Select the solution in Solution Explorer and then select the Properties icon in the toolbar, or right-click the solution and select Properties.<br />
*On the Properties page, select Common Properties > Startup Project.<br />
*Select Current selection, Single startup project and a project file, or Multiple startup projects.<br />
*If you select Multiple startup projects, you can change the startup order and action to take for each project: Start, Start without debugging, or None.<br />
*Select Apply, or OK to apply and close the dialog.<br />
<br />
[[File:Example.jpg]]<br />
<br />
<br />
'''Attach to a process'''<br />
<br />
The debugger can also attach to apps running in processes outside of Visual Studio, including on remote devices.<br />
After we attach to an app, we can use the Visual Studio debugger.<br />
<br />
Follow this:<br />
<br />
*With the app running, select Debug > Attach to Process.<br />
*In the Attach to Process dialog box, select the process from the Available Processes list, and then select Attach.<br />
<br />
[[File:Example.jpg]]<br />
<br />
'''Use the Registry Editor to automatically start a process in the debugger'''<br />
<br />
We might need to debug the startup code for an app that is launched by another process. You can have the debugger launch and automatically attach to the app.<br />
<br />
Follow this:<br />
<br />
*Start the Windows Registry Editor by running regedit.exe.<br />
*In Registry Editor, navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options.<br />
*Select the folder of the app that you want to start in the debugger.<br />
*If the app isn't listed as a child folder, right-click Image File Execution Options, select New > Key, and type the app name. Or, right-click the new *key in the tree, select Rename, and then enter the app name.<br />
*Right-click the new key in the tree and select New > String Value.<br />
*Change the name of the new value from New Value #1 to debugger.<br />
*Right-click debugger and select Modify.<br />
<br />
[[File:Example.jpg]]<br />
<br />
'''Debug with multiple processes'''<br />
<br />
When debugging an app with several processes, the breaking, stepping, and continuing debugger commands affect all processes by default.<br />
You can change this option.<br />
<br />
Follow this:<br />
<br />
*Under Tools (or Debug) > Options > Debugging > General, select or clear the Break all processes when one process breaks check box.<br />
<br />
[[File:Example.jpg]]<br />
<br />
'''Switch between processes'''<br />
<br />
Only one process should be active in the debugger at any given time. We can set the active or current process in the Debug Location toolbar, or in the Processes window. To switch between processes, both processes must be in break mode.<br />
<br />
To set the current process from the Debug Location toolbar:<br />
<br />
*To open the Debug Location toolbar, select View > Toolbars > Debug Location.<br />
*During debugging, on the Debug Location toolbar, select the process you want to set as the current process from the Process dropdown.<br />
<br />
To set the current process from the Processes window:<br />
<br />
*To open the Processes window, while debugging, select Debug > Windows > Processes.<br />
*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.<br />
<br />
[[File:Example.jpg]]<br />
<br />
= User Interface =<br />
For processes, the primary tools are the Attach to Process dialog box, the Processes window, and the Debug Location toolbar.<br />
<br />
For threads, the primary tools for debugging threads are the Threads window, thread markers in source windows, Parallel Stacks window, Parallel Watch window, and the Debug Location toolbar.<br />
<br />
==Attach to Process dialog box==<br />
The Attach to Process dialog box shows outside processes to be attached to the visual Studio debugger.<br />
<br />
[[File:Example.jpg]]<br />
<br />
'''You can attach the following processes'''<br />
<br />
*Process name (.exe)<br />
*Process ID number<br />
*Menubar Title<br />
*Type (Managed v4.0; Managed v2.0, v1.1, v1.0; x86; x64; IA64)<br />
*User Name (account name)<br />
*Session number<br />
<br />
'''Action you can perform'''<br />
<br />
*Select a process to attach to<br />
*Select a remote computer<br />
*Change transport type for connecting to remote computers<br />
<br />
==Processes window==<br />
The Process Window shows processes attached to the Visual Studio debugger.<br />
You can choose one of the processes during debugging mode.<br />
<br />
[[File:Example.jpg]]<br />
<br />
==Threads window==<br />
<br />
<br />
<br />
<br />
'''Setup:'''<br />
<br />
<br />
<br />
'''How to Use:'''<br />
<br />
<br />
<br />
'''Columns:'''<br />
<br />
<br />
==Source window==<br />
<br />
<br />
<br />
'''Setup:'''<br />
<br />
<br />
<br />
'''How to Use:'''<br />
<br />
<br />
==Debug Location toolbar== <br />
<br />
You can set the active or current process in the Debug Location toolbar.<br />
<br />
[[File:Example.jpg]]<br />
<br />
Debug Location toolbar has the following options:<br />
<br />
*Current process<br />
*Suspend the application<br />
*Resume the application<br />
*Suspend and shut down the application<br />
*Current thread<br />
*Toggle current thread flag state<br />
*Show only flagged threads<br />
*Show only current process<br />
*Current stack frame<br />
<br />
With this options you can perform the following actions:<br />
<br />
*Switch to another process<br />
*Suspend, resume, or shut down the application<br />
*Switch to another thread in current process<br />
*Switch to another stack frame in current thread<br />
*Flag or unflag current threads<br />
*Show only flagged threads<br />
*Show only the current process<br />
<br />
==Parallel Stacks window==<br />
<br />
'''Setup:'''<br />
<br />
<br />
'''How to Use:'''<br />
<br />
<br />
<br />
'''Features:''' <br/><br />
<br />
<br />
==Parallel Tasks window==<br />
<br />
==Parallel Watch window==<br />
<br />
<br />
<br />
'''Setup:'''<br />
<br />
<br />
'''How To Use:'''<br />
<br />
'''Features:'''<br />
<br />
= Walkthrough =<br />
<br />
==Case A - Using the Thread window==<br />
<br />
<br />
<br />
'''serial region'''<br />
<br />
<br />
<br />
'''auto OpenMP parallel region '''<br />
<br />
<br />
<br />
<br />
'''OpenMP parallel region thread number decided (8)'''<br />
<br />
==Case B - Using the Parallel Stacks and the Parallel Watch Window==<br />
<br />
<br />
<br />
'''Setup:''' <br />
<br />
<br />
<br />
<br />
'''Walkthrough:'''<br />
<br />
<br />
<br />
'''Setup:''' <br />
<br />
<br />
<br />
'''Walkthrough:'''<br />
<br />
<br />
https://en.wikipedia.org/wiki/Help:Cheatsheet</div>Klee214https://wiki.cdot.senecacollege.ca/w/index.php?title=GPU621/OpenMP_Debugging&diff=156671GPU621/OpenMP Debugging2021-12-06T03:05:19Z<p>Klee214: /* Process and thread */</p>
<hr />
<div>=Group Members=<br />
# [mailto:klee214i@myseneca.ca?subject=GPU621 Kimin Lee]<br />
# [mailto:jluna4@myseneca.ca?subject=GPU621 Jashua Luna]<br />
# [mailto:ipark10@myseneca.ca?subject=GPU621 Irene Park]<br />
<br />
=Process and thread=<br />
<br />
==Process==<br />
<br />
A process is the instance of a computer program that is being executed by one or many threads.<br />
<br />
==Thread==<br />
<br />
A thread is a sequence of instructions to which the operating system grants processor time. Every process that is running in the operating system consists of at least one thread. Processes that have more than one thread are called multithreaded.<br />
<br />
==Multiple Processes Debug==<br />
<br />
Visual Studio can debug a solution that has several processes. You can start and switch between processes, break, continue, and step through source, stop debugging, and end or detach from individual processes.<br />
<br />
'''Create two projects'''<br />
<br />
To test it, the best way with Visual Studio is creating two projects. <br />
<br />
*1. Create a new project of Visual Studio<br />
*2. Add a new project within the Solution<br />
*3. Add test files on each projects<br />
<br />
[[File:Example.jpg]]<br />
<br />
'''Start debugging with multiple processes'''<br />
<br />
If you have more than one project in a project solution, you can choose which projects the debugger starts.<br />
<br />
Follow this:<br />
<br />
*Select the solution in Solution Explorer and then select the Properties icon in the toolbar, or right-click the solution and select Properties.<br />
*On the Properties page, select Common Properties > Startup Project.<br />
*Select Current selection, Single startup project and a project file, or Multiple startup projects.<br />
*If you select Multiple startup projects, you can change the startup order and action to take for each project: Start, Start without debugging, or None.<br />
*Select Apply, or OK to apply and close the dialog.<br />
<br />
[[File:Example.jpg]]<br />
<br />
<br />
'''Attach to a process'''<br />
<br />
The debugger can also attach to apps running in processes outside of Visual Studio, including on remote devices.<br />
After we attach to an app, we can use the Visual Studio debugger.<br />
<br />
Follow this:<br />
<br />
*With the app running, select Debug > Attach to Process.<br />
*In the Attach to Process dialog box, select the process from the Available Processes list, and then select Attach.<br />
<br />
[[File:Example.jpg]]<br />
<br />
'''Use the Registry Editor to automatically start a process in the debugger'''<br />
<br />
We might need to debug the startup code for an app that is launched by another process. You can have the debugger launch and automatically attach to the app.<br />
<br />
Follow this:<br />
<br />
*Start the Windows Registry Editor by running regedit.exe.<br />
*In Registry Editor, navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options.<br />
*Select the folder of the app that you want to start in the debugger.<br />
*If the app isn't listed as a child folder, right-click Image File Execution Options, select New > Key, and type the app name. Or, right-click the new *key in the tree, select Rename, and then enter the app name.<br />
*Right-click the new key in the tree and select New > String Value.<br />
*Change the name of the new value from New Value #1 to debugger.<br />
*Right-click debugger and select Modify.<br />
<br />
[[File:Example.jpg]]<br />
<br />
'''Debug with multiple processes'''<br />
<br />
When debugging an app with several processes, the breaking, stepping, and continuing debugger commands affect all processes by default.<br />
You can change this option.<br />
<br />
Follow this:<br />
<br />
*Under Tools (or Debug) > Options > Debugging > General, select or clear the Break all processes when one process breaks check box.<br />
<br />
[[File:Example.jpg]]<br />
<br />
'''Switch between processes'''<br />
<br />
Only one process should be active in the debugger at any given time. We can set the active or current process in the Debug Location toolbar, or in the Processes window. To switch between processes, both processes must be in break mode.<br />
<br />
To set the current process from the Debug Location toolbar:<br />
<br />
*To open the Debug Location toolbar, select View > Toolbars > Debug Location.<br />
*During debugging, on the Debug Location toolbar, select the process you want to set as the current process from the Process dropdown.<br />
<br />
To set the current process from the Processes window:<br />
<br />
*To open the Processes window, while debugging, select Debug > Windows > Processes.<br />
*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.<br />
<br />
[[File:Example.jpg]]<br />
<br />
= User Interface =<br />
<br />
==Attach to Process dialog box==<br />
<br />
<br />
==Processes window==<br />
<br />
<br />
<br />
<br />
'''Setup:'''<br />
<br />
<br />
<br />
'''How to Use:'''<br />
<br />
<br />
==Threads window==<br />
<br />
<br />
<br />
<br />
<br />
'''Setup:'''<br />
<br />
<br />
<br />
'''How to Use:'''<br />
<br />
<br />
<br />
'''Columns:'''<br />
<br />
<br />
==Source window==<br />
<br />
<br />
<br />
'''Setup:'''<br />
<br />
<br />
<br />
'''How to Use:'''<br />
<br />
<br />
==Debug Location toolbar== <br />
<br />
==Parallel Stacks window==<br />
<br />
'''Setup:'''<br />
<br />
<br />
'''How to Use:'''<br />
<br />
<br />
<br />
'''Features:''' <br/><br />
<br />
<br />
==Parallel Tasks window==<br />
<br />
==Parallel Watch window==<br />
<br />
<br />
<br />
'''Setup:'''<br />
<br />
<br />
'''How To Use:'''<br />
<br />
'''Features:'''<br />
<br />
<br />
= Walkthrough =<br />
<br />
==Case A - Using the Thread window==<br />
<br />
<br />
<br />
'''serial region'''<br />
<br />
<br />
<br />
'''auto OpenMP parallel region '''<br />
<br />
<br />
<br />
<br />
'''OpenMP parallel region thread number decided (8)'''<br />
<br />
==Case B - Using the Parallel Stacks and the Parallel Watch Window==<br />
<br />
<br />
<br />
'''Setup:''' <br />
<br />
<br />
<br />
<br />
'''Walkthrough:'''<br />
<br />
<br />
<br />
'''Setup:''' <br />
<br />
<br />
<br />
'''Walkthrough:'''<br />
<br />
<br />
https://en.wikipedia.org/wiki/Help:Cheatsheet</div>Klee214https://wiki.cdot.senecacollege.ca/w/index.php?title=GPU621/OpenMP_Debugging&diff=156670GPU621/OpenMP Debugging2021-12-06T03:03:52Z<p>Klee214: /* Process and thread */</p>
<hr />
<div>=Group Members=<br />
# [mailto:klee214i@myseneca.ca?subject=GPU621 Kimin Lee]<br />
# [mailto:jluna4@myseneca.ca?subject=GPU621 Jashua Luna]<br />
# [mailto:ipark10@myseneca.ca?subject=GPU621 Irene Park]<br />
<br />
=Process and thread=<br />
<br />
'''Process'''<br />
<br />
A process is the instance of a computer program that is being executed by one or many threads.<br />
<br />
'''Thread'''<br />
<br />
A thread is a sequence of instructions to which the operating system grants processor time. Every process that is running in the operating system consists of at least one thread. Processes that have more than one thread are called multithreaded.<br />
<br />
==Multiple Processes Debug==<br />
<br />
Visual Studio can debug a solution that has several processes. You can start and switch between processes, break, continue, and step through source, stop debugging, and end or detach from individual processes.<br />
<br />
'''Create two projects'''<br />
<br />
To test it, the best way with Visual Studio is creating two projects. <br />
<br />
*1. Create a new project of Visual Studio<br />
*2. Add a new project within the Solution<br />
*3. Add test files on each projects<br />
<br />
[[File:Example.jpg]]<br />
<br />
'''Start debugging with multiple processes'''<br />
<br />
If you have more than one project in a project solution, you can choose which projects the debugger starts.<br />
<br />
Follow this:<br />
<br />
*Select the solution in Solution Explorer and then select the Properties icon in the toolbar, or right-click the solution and select Properties.<br />
*On the Properties page, select Common Properties > Startup Project.<br />
*Select Current selection, Single startup project and a project file, or Multiple startup projects.<br />
*If you select Multiple startup projects, you can change the startup order and action to take for each project: Start, Start without debugging, or None.<br />
*Select Apply, or OK to apply and close the dialog.<br />
<br />
[[File:Example.jpg]]<br />
<br />
<br />
'''Attach to a process'''<br />
<br />
The debugger can also attach to apps running in processes outside of Visual Studio, including on remote devices.<br />
After we attach to an app, we can use the Visual Studio debugger.<br />
<br />
Follow this:<br />
<br />
*With the app running, select Debug > Attach to Process.<br />
*In the Attach to Process dialog box, select the process from the Available Processes list, and then select Attach.<br />
<br />
[[File:Example.jpg]]<br />
<br />
'''Use the Registry Editor to automatically start a process in the debugger'''<br />
<br />
We might need to debug the startup code for an app that is launched by another process. You can have the debugger launch and automatically attach to the app.<br />
<br />
Follow this:<br />
<br />
*Start the Windows Registry Editor by running regedit.exe.<br />
*In Registry Editor, navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options.<br />
*Select the folder of the app that you want to start in the debugger.<br />
*If the app isn't listed as a child folder, right-click Image File Execution Options, select New > Key, and type the app name. Or, right-click the new *key in the tree, select Rename, and then enter the app name.<br />
*Right-click the new key in the tree and select New > String Value.<br />
*Change the name of the new value from New Value #1 to debugger.<br />
*Right-click debugger and select Modify.<br />
<br />
[[File:Example.jpg]]<br />
<br />
'''Debug with multiple processes'''<br />
<br />
When debugging an app with several processes, the breaking, stepping, and continuing debugger commands affect all processes by default.<br />
You can change this option.<br />
<br />
Follow this:<br />
<br />
*Under Tools (or Debug) > Options > Debugging > General, select or clear the Break all processes when one process breaks check box.<br />
<br />
[[File:Example.jpg]]<br />
<br />
'''Switch between processes'''<br />
<br />
Only one process should be active in the debugger at any given time. We can set the active or current process in the Debug Location toolbar, or in the Processes window. To switch between processes, both processes must be in break mode.<br />
<br />
To set the current process from the Debug Location toolbar:<br />
<br />
*To open the Debug Location toolbar, select View > Toolbars > Debug Location.<br />
*During debugging, on the Debug Location toolbar, select the process you want to set as the current process from the Process dropdown.<br />
<br />
To set the current process from the Processes window:<br />
<br />
*To open the Processes window, while debugging, select Debug > Windows > Processes.<br />
*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.<br />
<br />
[[File:Example.jpg]]<br />
<br />
= User Interface =<br />
<br />
==Attach to Process dialog box==<br />
<br />
<br />
==Processes window==<br />
<br />
<br />
<br />
<br />
'''Setup:'''<br />
<br />
<br />
<br />
'''How to Use:'''<br />
<br />
<br />
==Threads window==<br />
<br />
<br />
<br />
<br />
<br />
'''Setup:'''<br />
<br />
<br />
<br />
'''How to Use:'''<br />
<br />
<br />
<br />
'''Columns:'''<br />
<br />
<br />
==Source window==<br />
<br />
<br />
<br />
'''Setup:'''<br />
<br />
<br />
<br />
'''How to Use:'''<br />
<br />
<br />
==Debug Location toolbar== <br />
<br />
==Parallel Stacks window==<br />
<br />
'''Setup:'''<br />
<br />
<br />
'''How to Use:'''<br />
<br />
<br />
<br />
'''Features:''' <br/><br />
<br />
<br />
==Parallel Tasks window==<br />
<br />
==Parallel Watch window==<br />
<br />
<br />
<br />
'''Setup:'''<br />
<br />
<br />
'''How To Use:'''<br />
<br />
'''Features:'''<br />
<br />
<br />
= Walkthrough =<br />
<br />
==Case A - Using the Thread window==<br />
<br />
<br />
<br />
'''serial region'''<br />
<br />
<br />
<br />
'''auto OpenMP parallel region '''<br />
<br />
<br />
<br />
<br />
'''OpenMP parallel region thread number decided (8)'''<br />
<br />
==Case B - Using the Parallel Stacks and the Parallel Watch Window==<br />
<br />
<br />
<br />
'''Setup:''' <br />
<br />
<br />
<br />
<br />
'''Walkthrough:'''<br />
<br />
<br />
<br />
'''Setup:''' <br />
<br />
<br />
<br />
'''Walkthrough:'''<br />
<br />
<br />
https://en.wikipedia.org/wiki/Help:Cheatsheet</div>Klee214https://wiki.cdot.senecacollege.ca/w/index.php?title=GPU621/DPS921_G_P_Index_20211&diff=156533GPU621/DPS921 G P Index 202112021-11-27T03:57:53Z<p>Klee214: /* We hate bugs */</p>
<hr />
<div>{{GPU621/DPS921 Index | 20217}}<br />
<br />
Please add an overview of your group here and create a separate project page for your group!<br />
<br />
= Project Rules =<br />
<br />
# Use the Group page for a Journal of your activities throughout the course of the project<br />
# Project should cover material that differ from the material on the course web site<br />
# Presentation can be in powerpoint or walkthru the group project page<br />
# Link to the project page should be on the Participants table<br />
# Presentation slots are first come first served<br />
# Attendance at all presentations is mandatory - marks will be deducted for absenteeism<br />
# Marks will be awarded for both Group Wiki page and for the Presentation<br />
<br />
= Sample Projects (Former Students) =<br />
<br />
#[[GPU621/DPS921_G_P_Index_20161 | Winter 2016 semester]]<br />
#[[GPU621/DPS921_G_P_Index_20167 | Fall 2016 semester]]<br />
#[[GPU621/DPS921_G_P_Index_20177 | Fall 2017 semester]]<br />
#[[GPU621/DPS921_G_P_Index_20187 | Fall 2018 semester]]<br />
#[[GPU621/DPS921_G_P_Index_20207 | Fall 2020 semester]]<br />
<br />
Suggested Projects (each * denotes one group that has claimed this topic)<br />
# Intel Parallel Studio Advisor - [[https://software.intel.com/en-us/intel-advisor-xe Intel Site]] <br />
# Intel Parallel Studio Inspector - [[https://software.intel.com/en-us/intel-inspector-xe Intel Site]] <br />
# Intel Parallel Studio vTune Amplifier - [[https://software.intel.com/en-us/intel-vtune-amplifier-xe Intel Site]] <br />
# Intel Math Kernel Library - [[https://software.intel.com/en-us/intel-mkl Intel Site]] *<br />
# Intel Data Analytics Acceleration Library - [[https://software.intel.com/en-us/blogs/daal Intel Site]] <br />
# Totalview Debugger - [[http://www.roguewave.com/products-services/student-request-form Get Student License]]<br />
# OpenMP Debugging in Visual Studio - [[https://msdn.microsoft.com/en-us/library/ms164746.aspx MSDN Notes]] <br />
# Debugging Threads in Intel Parallel Studio - [[http://www.drdobbs.com/windows/intel-parallel-debugger-extension-for-mi/214502747 Dr Dobbs Article]] <br />
# Analyzing False Sharing - [[http://www.drdobbs.com/parallel/eliminate-false-sharing/217500206 Herb Sutter's Article]] <br />
# The Chapel Programming Language - [[http://chapel.cray.com Chapel Site]] <br />
# Apache's Spark - [[http://spark.apache.org/ Spark Site]]<br />
# OpenMP Profiler - [[http://www.ompp-tool.com/home.html ompP]]<br />
# C++11 Threads Library Comparison to OpenMP - Case Studies <br />
# C++11 STL Comparison to TBB - Case Studies<br />
<br />
= Group and Project Index =<br />
<br />
You can find a sample project page template [[GPU621/DPS921_Sample_Project_Page | here]]<br />
<br />
== [[GPU621/Sample_Project | Sample Project]] ==<br />
'''Project Title here'''<br />
# [mailto:chris.szalwinski@myseneca.ca?subject=DPS921 Chris Szalwinski]<br />
# [mailto:fardad.soleimanloo@myseneca.ca?subject=DPS921 Fardad Soleimanloo]<br />
# [mailto:chris.szalwinski@myseneca.ca;fardad.soleimanloo@myseneca.ca?subject=DPS921 eMail All]<br />
<br />
== [[GPU621/False Sharing | False Sharing ]] ==<br />
'''Analyzing False Sharing'''<br />
# [mailto:kchou4@myseneca.ca?subject=DPS921 Kevin Chou]<br />
<br />
== [[DPS921/Intel Math Kernel Library | Intel Math Kernel Library ]] ==<br />
'''Slightly Above Average'''<br />
# [mailto:jinkster@myseneca.ca?subject=DPS921 James Inkster]<br />
# [mailto:lsie@myseneca.ca?subject=DPS921 Jordan Sie]<br />
# [mailto:vnagarajan1@myseneca.ca?subject=DPS921 Varshan Nagarajan]<br />
# [mailto:lsie@myseneca.ca;vnagarajan1@myseneca.ca;jinkster@myseneca.ca?subject=DPS921 eMail All]<br />
<br />
== [[DPS921/ A Crash Course on Processors | That's Not Parallel Bro]] ==<br />
''' A Crash Course on Processors'''<br />
# [mailto:mschumacher@myseneca.ca?subject=DPS921 Matthew Schumacher]<br />
# [mailto:gzayarnyy@myseneca.ca@myseneca.ca?subject=DPS921 Glib Zayarnyy]<br />
<br />
== [[GPU621/OpenMP Debugging | We hate bugs]] ==<br />
'''OpenMP Debugging in Visual Studio'''<br />
# [mailto:klee214i@myseneca.ca?subject=GPU621 Kimin Lee]<br />
# [mailto:jluna4@myseneca.ca?subject=GPU621 Jashua Luna]<br />
# [mailto:ipark10@myseneca.ca?subject=GPU621 Irene Park]<br />
<br />
= Presentation Schedule =<br />
<br />
{| border="1"<br />
|-<br />
|Team Name<br />
|Project Title<br />
|Date and Time<br />
|- <br />
|Nikita Sushko, Glib Gnennyi<br />
|The Chapel Programming Language<br />
|Dec 2nd 08:10AM<br />
|- <br />
|Lin Xu, Menglin Wu, Syed Muhammad Saad <br />
|Intel Math Kernel Library<br />
|Dec 2nd 08:30AM<br />
|- <br />
|Daniel Kerr <br />
|Parallelization in Game Engines<br />
|Dec 2nd 08:45AM<br />
|- <br />
|Adrian Ng, Milosz Zapolski,Muhammad Faaiz<br />
|Intel Data Analytics Acceleration Library<br />
|Dec 9th 08:10AM<br />
|- <br />
|Kevin Chou<br />
|Analyzing False Sharing<br />
|Dec 9th 08:30AM<br />
|- <br />
|Jigarkumar Pritamkumar Koradiya, Parsa Parichehreh, Ricardo Ramirez<br />
|Intel Parallel Studio Advisor<br />
|Dec 9th 08:45AM<br />
|- <br />
|Kimin Lee, Irene Park, Jashua Luna<br />
|OpenMP Debugging in Visual Studio<br />
|Dec 9th 09:00AM<br />
|- <br />
|Elliot Kyei, Joel Raymond<br />
|Intel Parallel Studio Inspector<br />
|Dec 9th 09:15AM<br />
|- <br />
|Iurii Kondrakov, Stephen Griffis, James Mai<br />
|Intel Parallel Studio vTune Amplifier<br />
|Dec 9th 09:30AM<br />
|- <br />
|[[https://wiki.cdot.senecacollege.ca/wiki/DPS921/Intel_Math_Kernel_Library | Slightly Above Average]]<br />
|<br />
|Dec 9th 08:10AM<br />
|- <br />
|That's Not Parallel Bro: A Crash Course on Processors<br />
|<br />
|Dec 9th 08:10AM<br />
|}<br />
<br />
<br /></div>Klee214https://wiki.cdot.senecacollege.ca/w/index.php?title=GPU621/OpenMP_Debugging&diff=156532GPU621/OpenMP Debugging2021-11-27T03:51:08Z<p>Klee214: Created page with "=Group Members= # [mailto:klee214i@myseneca.ca?subject=GPU621 Kimin Lee] # [mailto:jluna4@myseneca.ca?subject=GPU621 Jashua Luna] # [mailto:ipark10@myseneca.ca?subject=GPU621..."</p>
<hr />
<div>=Group Members=<br />
# [mailto:klee214i@myseneca.ca?subject=GPU621 Kimin Lee]<br />
# [mailto:jluna4@myseneca.ca?subject=GPU621 Jashua Luna]<br />
# [mailto:ipark10@myseneca.ca?subject=GPU621 Irene Park]<br />
<br />
=Process and thread=<br />
==Multiple Processes==<br />
'''Processes'''<br />
<br />
<br />
<br />
'''Configuration'''<br />
<br />
<br />
'''Changing this option:'''<br />
<br />
<br />
'''Multiple processes'''<br />
<br />
<br />
==Thread==<br />
<br />
<br />
= User Interface =<br />
<br />
==Attach to Process dialog box==<br />
<br />
<br />
==Processes window==<br />
<br />
<br />
<br />
<br />
'''Setup:'''<br />
<br />
<br />
<br />
'''How to Use:'''<br />
<br />
<br />
==Threads window==<br />
<br />
<br />
<br />
<br />
<br />
'''Setup:'''<br />
<br />
<br />
<br />
'''How to Use:'''<br />
<br />
<br />
<br />
'''Columns:'''<br />
<br />
<br />
==Source window==<br />
<br />
<br />
<br />
'''Setup:'''<br />
<br />
<br />
<br />
'''How to Use:'''<br />
<br />
<br />
==Debug Location toolbar== <br />
<br />
==Parallel Stacks window==<br />
<br />
'''Setup:'''<br />
<br />
<br />
'''How to Use:'''<br />
<br />
<br />
<br />
'''Features:''' <br/><br />
<br />
<br />
==Parallel Tasks window==<br />
<br />
==Parallel Watch window==<br />
<br />
<br />
<br />
'''Setup:'''<br />
<br />
<br />
'''How To Use:'''<br />
<br />
'''Features:'''<br />
<br />
<br />
= Walkthrough =<br />
<br />
<br />
==Case A - Using the Thread window== <br />
<br />
<br />
<br />
'''serial region'''<br />
<br />
<br />
<br />
'''auto OpenMP parallel region '''<br />
<br />
<br />
<br />
<br />
'''OpenMP parallel region thread number decided (8)'''<br />
<br />
<br />
==Case B - Using the Parallel Stacks and the Parallel Watch Window==<br />
<br />
<br />
<br />
'''Setup:''' <br />
<br />
<br />
<br />
<br />
'''Walkthrough:'''<br />
<br />
<br />
<br />
'''Setup:''' <br />
<br />
<br />
<br />
'''Walkthrough:'''<br />
<br />
<br />
https://en.wikipedia.org/wiki/Help:Cheatsheet</div>Klee214https://wiki.cdot.senecacollege.ca/w/index.php?title=GPU621/DPS921_G_P_Index_20211&diff=156530GPU621/DPS921 G P Index 202112021-11-27T03:36:29Z<p>Klee214: /* Group and Project Index */</p>
<hr />
<div>{{GPU621/DPS921 Index | 20217}}<br />
<br />
Please add an overview of your group here and create a separate project page for your group!<br />
<br />
= Project Rules =<br />
<br />
# Use the Group page for a Journal of your activities throughout the course of the project<br />
# Project should cover material that differ from the material on the course web site<br />
# Presentation can be in powerpoint or walkthru the group project page<br />
# Link to the project page should be on the Participants table<br />
# Presentation slots are first come first served<br />
# Attendance at all presentations is mandatory - marks will be deducted for absenteeism<br />
# Marks will be awarded for both Group Wiki page and for the Presentation<br />
<br />
= Sample Projects (Former Students) =<br />
<br />
#[[GPU621/DPS921_G_P_Index_20161 | Winter 2016 semester]]<br />
#[[GPU621/DPS921_G_P_Index_20167 | Fall 2016 semester]]<br />
#[[GPU621/DPS921_G_P_Index_20177 | Fall 2017 semester]]<br />
#[[GPU621/DPS921_G_P_Index_20187 | Fall 2018 semester]]<br />
#[[GPU621/DPS921_G_P_Index_20207 | Fall 2020 semester]]<br />
<br />
Suggested Projects (each * denotes one group that has claimed this topic)<br />
# Intel Parallel Studio Advisor - [[https://software.intel.com/en-us/intel-advisor-xe Intel Site]] <br />
# Intel Parallel Studio Inspector - [[https://software.intel.com/en-us/intel-inspector-xe Intel Site]] <br />
# Intel Parallel Studio vTune Amplifier - [[https://software.intel.com/en-us/intel-vtune-amplifier-xe Intel Site]] <br />
# Intel Math Kernel Library - [[https://software.intel.com/en-us/intel-mkl Intel Site]] *<br />
# Intel Data Analytics Acceleration Library - [[https://software.intel.com/en-us/blogs/daal Intel Site]] <br />
# Totalview Debugger - [[http://www.roguewave.com/products-services/student-request-form Get Student License]]<br />
# OpenMP Debugging in Visual Studio - [[https://msdn.microsoft.com/en-us/library/ms164746.aspx MSDN Notes]] <br />
# Debugging Threads in Intel Parallel Studio - [[http://www.drdobbs.com/windows/intel-parallel-debugger-extension-for-mi/214502747 Dr Dobbs Article]] <br />
# Analyzing False Sharing - [[http://www.drdobbs.com/parallel/eliminate-false-sharing/217500206 Herb Sutter's Article]] <br />
# The Chapel Programming Language - [[http://chapel.cray.com Chapel Site]] <br />
# Apache's Spark - [[http://spark.apache.org/ Spark Site]]<br />
# OpenMP Profiler - [[http://www.ompp-tool.com/home.html ompP]]<br />
# C++11 Threads Library Comparison to OpenMP - Case Studies <br />
# C++11 STL Comparison to TBB - Case Studies<br />
<br />
= Group and Project Index =<br />
<br />
You can find a sample project page template [[GPU621/DPS921_Sample_Project_Page | here]]<br />
<br />
== [[GPU621/Sample_Project | Sample Project]] ==<br />
'''Project Title here'''<br />
# [mailto:chris.szalwinski@myseneca.ca?subject=DPS921 Chris Szalwinski]<br />
# [mailto:fardad.soleimanloo@myseneca.ca?subject=DPS921 Fardad Soleimanloo]<br />
# [mailto:chris.szalwinski@myseneca.ca;fardad.soleimanloo@myseneca.ca?subject=DPS921 eMail All]<br />
<br />
== [[GPU621/False Sharing | False Sharing ]] ==<br />
'''Analyzing False Sharing'''<br />
# [mailto:kchou4@myseneca.ca?subject=DPS921 Kevin Chou]<br />
<br />
== [[DPS921/Intel Math Kernel Library | Intel Math Kernel Library ]] ==<br />
'''Slightly Above Average'''<br />
# [mailto:jinkster@myseneca.ca?subject=DPS921 James Inkster]<br />
# [mailto:lsie@myseneca.ca?subject=DPS921 Jordan Sie]<br />
# [mailto:vnagarajan1@myseneca.ca?subject=DPS921 Varshan Nagarajan]<br />
# [mailto:lsie@myseneca.ca;vnagarajan1@myseneca.ca;jinkster@myseneca.ca?subject=DPS921 eMail All]<br />
<br />
== [[DPS921/ A Crash Course on Processors | That's Not Parallel Bro]] ==<br />
''' A Crash Course on Processors'''<br />
# [mailto:mschumacher@myseneca.ca?subject=DPS921 Matthew Schumacher]<br />
# [mailto:gzayarnyy@myseneca.ca@myseneca.ca?subject=DPS921 Glib Zayarnyy]<br />
<br />
== [[GPU621/OpenMP Debugging | We hate bugs]] ==<br />
'''OpenMP Debugging'''<br />
# [mailto:klee214i@myseneca.ca?subject=GPU621 Kimin Lee]<br />
# [mailto:jluna4@myseneca.ca?subject=GPU621 Jashua Luna]<br />
# [mailto:ipark10@myseneca.ca?subject=GPU621 Irene Park]<br />
<br />
= Presentation Schedule =<br />
<br />
{| border="1"<br />
|-<br />
|Team Name<br />
|Project Title<br />
|Date and Time<br />
|- <br />
|Nikita Sushko, Glib Gnennyi<br />
|The Chapel Programming Language<br />
|Dec 2nd 08:10AM<br />
|- <br />
|Lin Xu, Menglin Wu, Syed Muhammad Saad <br />
|Intel Math Kernel Library<br />
|Dec 2nd 08:30AM<br />
|- <br />
|Daniel Kerr <br />
|Parallelization in Game Engines<br />
|Dec 2nd 08:45AM<br />
|- <br />
|Adrian Ng, Milosz Zapolski,Muhammad Faaiz<br />
|Intel Data Analytics Acceleration Library<br />
|Dec 9th 08:10AM<br />
|- <br />
|Kevin Chou<br />
|Analyzing False Sharing<br />
|Dec 9th 08:30AM<br />
|- <br />
|Jigarkumar Pritamkumar Koradiya, Parsa Parichehreh, Ricardo Ramirez<br />
|Intel Parallel Studio Advisor<br />
|Dec 9th 08:45AM<br />
|- <br />
|Kimin Lee, Irene Park, Jashua Luna<br />
|OpenMP Debugging in Visual Studio<br />
|Dec 9th 09:00AM<br />
|- <br />
|Elliot Kyei, Joel Raymond<br />
|Intel Parallel Studio Inspector<br />
|Dec 9th 09:15AM<br />
|- <br />
|Iurii Kondrakov, Stephen Griffis, James Mai<br />
|Intel Parallel Studio vTune Amplifier<br />
|Dec 9th 09:30AM<br />
|- <br />
|[[https://wiki.cdot.senecacollege.ca/wiki/DPS921/Intel_Math_Kernel_Library | Slightly Above Average]]<br />
|<br />
|Dec 9th 08:10AM<br />
|- <br />
|That's Not Parallel Bro: A Crash Course on Processors<br />
|<br />
|Dec 9th 08:10AM<br />
|}<br />
<br />
<br /></div>Klee214https://wiki.cdot.senecacollege.ca/w/index.php?title=GPU621/DPS921_G_P_Index_20211&diff=156380GPU621/DPS921 G P Index 202112021-11-09T21:22:47Z<p>Klee214: /* Presentation Schedule */</p>
<hr />
<div>{{GPU621/DPS921 Index | 20217}}<br />
<br />
Please add an overview of your group here and create a separate project page for your group!<br />
<br />
= Project Rules =<br />
<br />
# Use the Group page for a Journal of your activities throughout the course of the project<br />
# Project should cover material that differ from the material on the course web site<br />
# Presentation can be in powerpoint or walkthru the group project page<br />
# Link to the project page should be on the Participants table<br />
# Presentation slots are first come first served<br />
# Attendance at all presentations is mandatory - marks will be deducted for absenteeism<br />
# Marks will be awarded for both Group Wiki page and for the Presentation<br />
<br />
= Sample Projects (Former Students) =<br />
<br />
#[[GPU621/DPS921_G_P_Index_20161 | Winter 2016 semester]]<br />
#[[GPU621/DPS921_G_P_Index_20167 | Fall 2016 semester]]<br />
#[[GPU621/DPS921_G_P_Index_20177 | Fall 2017 semester]]<br />
#[[GPU621/DPS921_G_P_Index_20187 | Fall 2018 semester]]<br />
#[[GPU621/DPS921_G_P_Index_20207 | Fall 2020 semester]]<br />
<br />
Suggested Projects (each * denotes one group that has claimed this topic)<br />
# Intel Parallel Studio Advisor - [[https://software.intel.com/en-us/intel-advisor-xe Intel Site]] <br />
# Intel Parallel Studio Inspector - [[https://software.intel.com/en-us/intel-inspector-xe Intel Site]] <br />
# Intel Parallel Studio vTune Amplifier - [[https://software.intel.com/en-us/intel-vtune-amplifier-xe Intel Site]] <br />
# Intel Math Kernel Library - [[https://software.intel.com/en-us/intel-mkl Intel Site]] *<br />
# Intel Data Analytics Acceleration Library - [[https://software.intel.com/en-us/blogs/daal Intel Site]] <br />
# Totalview Debugger - [[http://www.roguewave.com/products-services/student-request-form Get Student License]]<br />
# OpenMP Debugging in Visual Studio - [[https://msdn.microsoft.com/en-us/library/ms164746.aspx MSDN Notes]] <br />
# Debugging Threads in Intel Parallel Studio - [[http://www.drdobbs.com/windows/intel-parallel-debugger-extension-for-mi/214502747 Dr Dobbs Article]] <br />
# Analyzing False Sharing - [[http://www.drdobbs.com/parallel/eliminate-false-sharing/217500206 Herb Sutter's Article]] <br />
# The Chapel Programming Language - [[http://chapel.cray.com Chapel Site]] <br />
# Apache's Spark - [[http://spark.apache.org/ Spark Site]]<br />
# OpenMP Profiler - [[http://www.ompp-tool.com/home.html ompP]]<br />
# C++11 Threads Library Comparison to OpenMP - Case Studies <br />
# C++11 STL Comparison to TBB - Case Studies<br />
<br />
= Group and Project Index =<br />
<br />
You can find a sample project page template [[GPU621/DPS921_Sample_Project_Page | here]]<br />
<br />
== [[GPU621/Sample_Project | Sample Project]] ==<br />
'''Project Title here'''<br />
# [mailto:chris.szalwinski@myseneca.ca?subject=DPS921 Chris Szalwinski]<br />
# [mailto:fardad.soleimanloo@myseneca.ca?subject=DPS921 Fardad Soleimanloo]<br />
# [mailto:chris.szalwinski@myseneca.ca;fardad.soleimanloo@myseneca.ca?subject=DPS921 eMail All]<br />
<br />
== [[DPS921/Intel Math Kernel Library | Intel Math Kernel Library ]] ==<br />
'''Slightly Above Average'''<br />
# [mailto:jinkster@myseneca.ca?subject=DPS921 James Inkster]<br />
# [mailto:lsie@myseneca.ca?subject=DPS921 Jordan Sie]<br />
# [mailto:vnagarajan1@myseneca.ca?subject=DPS921 Varshan Nagarajan]<br />
# [mailto:lsie@myseneca.ca;vnagarajan1@myseneca.ca;jinkster@myseneca.ca?subject=DPS921 eMail All]<br />
<br />
== [[DPS921/ A Crash Course on Processors | That's Not Parallel Bro]] ==<br />
''' A Crash Course on Processors'''<br />
# [mailto:mschumacher@myseneca.ca?subject=DPS921 Matthew Schumacher]<br />
# [mailto:gzayarnyy@myseneca.ca@myseneca.ca?subject=DPS921 Glib Zayarnyy]<br />
<br />
= Presentation Schedule =<br />
<br />
{| border="1"<br />
|-<br />
|Team Name<br />
|Project Title<br />
|Date and Time<br />
|- <br />
|Adrian Ng, Milosz Zapolski,Muhammad Faaiz<br />
|Intel Data Analytics Acceleration Library<br />
|Dec 9th 08:10AM<br />
|- <br />
|Kevin Chou<br />
|Analyzing False Sharing<br />
|Dec 9th 08:30AM<br />
|- <br />
|Jigarkumar Pritamkumar Koradiya, Parsa Parichehreh, Ricardo Ramirez<br />
|Intel Advisor<br />
|Dec 9th 08:45AM<br />
|- <br />
|Kimin Lee Irene Park<br />
|OpenMP Debugging in Visual Studio<br />
|Dec 9th 09:00AM<br />
|- <br />
|[[https://wiki.cdot.senecacollege.ca/wiki/DPS921/Intel_Math_Kernel_Library | Slightly Above Average]]<br />
|<br />
|Dec 9th 08:10AM<br />
|- <br />
|That's Not Parallel Bro: A Crash Course on Processors<br />
|<br />
|Dec 9th 08:10AM<br />
|}<br />
<br />
<br /></div>Klee214https://wiki.cdot.senecacollege.ca/w/index.php?title=GPU621/DPS921_G_P_Index_20211&diff=156379GPU621/DPS921 G P Index 202112021-11-09T21:21:34Z<p>Klee214: /* Presentation Schedule */</p>
<hr />
<div>{{GPU621/DPS921 Index | 20217}}<br />
<br />
Please add an overview of your group here and create a separate project page for your group!<br />
<br />
= Project Rules =<br />
<br />
# Use the Group page for a Journal of your activities throughout the course of the project<br />
# Project should cover material that differ from the material on the course web site<br />
# Presentation can be in powerpoint or walkthru the group project page<br />
# Link to the project page should be on the Participants table<br />
# Presentation slots are first come first served<br />
# Attendance at all presentations is mandatory - marks will be deducted for absenteeism<br />
# Marks will be awarded for both Group Wiki page and for the Presentation<br />
<br />
= Sample Projects (Former Students) =<br />
<br />
#[[GPU621/DPS921_G_P_Index_20161 | Winter 2016 semester]]<br />
#[[GPU621/DPS921_G_P_Index_20167 | Fall 2016 semester]]<br />
#[[GPU621/DPS921_G_P_Index_20177 | Fall 2017 semester]]<br />
#[[GPU621/DPS921_G_P_Index_20187 | Fall 2018 semester]]<br />
#[[GPU621/DPS921_G_P_Index_20207 | Fall 2020 semester]]<br />
<br />
Suggested Projects (each * denotes one group that has claimed this topic)<br />
# Intel Parallel Studio Advisor - [[https://software.intel.com/en-us/intel-advisor-xe Intel Site]] <br />
# Intel Parallel Studio Inspector - [[https://software.intel.com/en-us/intel-inspector-xe Intel Site]] <br />
# Intel Parallel Studio vTune Amplifier - [[https://software.intel.com/en-us/intel-vtune-amplifier-xe Intel Site]] <br />
# Intel Math Kernel Library - [[https://software.intel.com/en-us/intel-mkl Intel Site]] *<br />
# Intel Data Analytics Acceleration Library - [[https://software.intel.com/en-us/blogs/daal Intel Site]] <br />
# Totalview Debugger - [[http://www.roguewave.com/products-services/student-request-form Get Student License]]<br />
# OpenMP Debugging in Visual Studio - [[https://msdn.microsoft.com/en-us/library/ms164746.aspx MSDN Notes]] <br />
# Debugging Threads in Intel Parallel Studio - [[http://www.drdobbs.com/windows/intel-parallel-debugger-extension-for-mi/214502747 Dr Dobbs Article]] <br />
# Analyzing False Sharing - [[http://www.drdobbs.com/parallel/eliminate-false-sharing/217500206 Herb Sutter's Article]] <br />
# The Chapel Programming Language - [[http://chapel.cray.com Chapel Site]] <br />
# Apache's Spark - [[http://spark.apache.org/ Spark Site]]<br />
# OpenMP Profiler - [[http://www.ompp-tool.com/home.html ompP]]<br />
# C++11 Threads Library Comparison to OpenMP - Case Studies <br />
# C++11 STL Comparison to TBB - Case Studies<br />
<br />
= Group and Project Index =<br />
<br />
You can find a sample project page template [[GPU621/DPS921_Sample_Project_Page | here]]<br />
<br />
== [[GPU621/Sample_Project | Sample Project]] ==<br />
'''Project Title here'''<br />
# [mailto:chris.szalwinski@myseneca.ca?subject=DPS921 Chris Szalwinski]<br />
# [mailto:fardad.soleimanloo@myseneca.ca?subject=DPS921 Fardad Soleimanloo]<br />
# [mailto:chris.szalwinski@myseneca.ca;fardad.soleimanloo@myseneca.ca?subject=DPS921 eMail All]<br />
<br />
== [[DPS921/Intel Math Kernel Library | Intel Math Kernel Library ]] ==<br />
'''Slightly Above Average'''<br />
# [mailto:jinkster@myseneca.ca?subject=DPS921 James Inkster]<br />
# [mailto:lsie@myseneca.ca?subject=DPS921 Jordan Sie]<br />
# [mailto:vnagarajan1@myseneca.ca?subject=DPS921 Varshan Nagarajan]<br />
# [mailto:lsie@myseneca.ca;vnagarajan1@myseneca.ca;jinkster@myseneca.ca?subject=DPS921 eMail All]<br />
<br />
== [[DPS921/ A Crash Course on Processors | That's Not Parallel Bro]] ==<br />
''' A Crash Course on Processors'''<br />
# [mailto:mschumacher@myseneca.ca?subject=DPS921 Matthew Schumacher]<br />
# [mailto:gzayarnyy@myseneca.ca@myseneca.ca?subject=DPS921 Glib Zayarnyy]<br />
<br />
= Presentation Schedule =<br />
<br />
{| border="1"<br />
|-<br />
|Team Name<br />
|Project Title<br />
|Date and Time<br />
|- <br />
|Adrian Ng, Milosz Zapolski,Muhammad Faaiz<br />
|Intel Data Analytics Acceleration Library<br />
|Dec 9th 08:10AM<br />
|- <br />
|Kevin Chou<br />
|Analyzing False Sharing<br />
|Dec 9th 08:30AM<br />
|- <br />
|Jigarkumar Pritamkumar Koradiya, Parsa Parichehreh, Ricardo Ramirez<br />
|Intel Advisor<br />
|Dec 9th 08:45AM<br />
|- <br />
|Kimin Lee Irene Park<br />
|<br />
|Dec 9th 09:00AM<br />
|- <br />
|[[https://wiki.cdot.senecacollege.ca/wiki/DPS921/Intel_Math_Kernel_Library | Slightly Above Average]]<br />
|<br />
|Dec 9th 08:10AM<br />
|- <br />
|That's Not Parallel Bro: A Crash Course on Processors<br />
|<br />
|Dec 9th 08:10AM<br />
|}<br />
<br />
<br /></div>Klee214