GPU621/Debugging OpenMP

From CDOT Wiki
Revision as of 00:05, 29 November 2022 by Ryla (talk | contribs) (Multiple Processes)
Jump to: navigation, search

Group Members

  1. Jimmy Liu
  2. Sami Ali
  3. Leon Liu

// TODO: Create a tutorial on how to debug parallel programs using OpenMP in Visual Studio

// remember to add pictures if possible

// Steps

1. Read the Microsoft Documentation for your section

2. Paraphrase the contents of your section onto the Wiki

3. Test it yourself in Visual Studio and add examples

// Uploading Files

To upload a file, go to https://wiki.cdot.senecacollege.ca/wiki/Special:Upload

To include a file in a page, use [[File:File.jpg]] to use the full version of the file

Process and Thread

Process

A process is an instance of a program executed by the computer. Processes are started when programs are initiated, and they can be comprised of one or more threads.

On Windows operating systems, you can look at your running processes on the Task Manager.

Thread

A single thread is a set of instructions that the CPU schedules and executes independently. A process consists of one or more threads which are able to be run concurrently. This forms the basis of multithreading.

Multiple Processes

Background

Visual Studio supports the creation of solutions with multiple processes. Visual Studio's debugger will by default run the first project (selected in bold), but this can be changed in the Solution Explorer by right-clicking on a different project and selecting Set as Startup Project. This will allow you when debugging to switch between processes, as well as break, stop, and continue currently debugging processes.

Setup

To set the startup project or multiple projects:

1. Right-click the solution in the Solution Explorer and select Properties. 2. In the Properties window, select Common Properties > Startup Project. 3. Here you can change the Startup Project to either the currently selected project, a single startup project (this is selected by default), or multiple startup projects. 4. When selecting Multiple startup projects, you can modify the execution order and action for each project between Start, Start without debugging, or None. 5. Save your settings by selected Apply or OK.

User Interface

// TODO: Show the window and explain what it does for every single window below (medium)

// documentation for windows are here: https://learn.microsoft.com/en-us/visualstudio/debugger/debug-threads-and-processes?view=vs-2022

Attach to Process Dialog Box

Process Window

Thread Window

Source Window

Debug Location Window

Parallel Stacks Window

Parallel Tasks Window

Parallel Watch Window

Walkthrough

// TODO: Step-by-step walkthrough on how to debug program with the specific window

// use same program for both tests

// can probably just take something from course notes and modify it to fit our parameters

Case A: Using the Thread Window

// TODO: walkthrough on using thread window to debug (medium)

// https://learn.microsoft.com/en-us/visualstudio/debugger/walkthrough-debugging-a-parallel-application?view=vs-2022&tabs=cpp

Case B: Using the Parallel Stacks Window

// TODO: walkthrough on using parallel stacks window to debug (long)

// https://learn.microsoft.com/en-us/visualstudio/debugger/using-the-parallel-stacks-window?view=vs-2022

https://en.wikipedia.org/wiki/Help:Cheatsheet