Difference between revisions of "GPU621/Group 5"

From CDOT Wiki
Jump to: navigation, search
(Introduction: Added Introduction)
(Integrating)
Line 18: Line 18:
  
 
== Integrating ==
 
== Integrating ==
 +
Before we go into specifically each library, let’s talk about how VScode handles compilers. Within VSCode, when we create a .CPP file, we can either run the code in our terminal, or we can create a '''task''' that compiles our code before '''launching''' the executable with our runtime arguments. We’ll use this **task and launch** method to setup our environment for C++.
 +
 +
Start by creating a regular C++ workspace:
 +
 +
# Open up VScode and open a directory where you want to code
 +
# Create a C++ file, for our example we’ll call it: `helloworld.cpp`
 +
# You can add this code into it for now:
 +
 +
#include <iostream>
 +
 +
int main(int argc, char const *argv[])
 +
{
 +
    std::cout << "Hello world";
 +
    return 0;
 +
}
 +
 +
 +
=== Tasks ===
 +
 +
From here, we want to tell VScode what **tasks** to run when we press the Run and Debug button. This will be similar to how we use terminal to '''build''' our code.
 +
 +
# Press '''Command+Shift+P'''
 +
# At the search bar that comes up, type: '''Tasks: Configure Task''' and press '''Enter'''
 +
# You’ll may see another option come up, to choose what kind of task, select “'''C/C++: g++ build active file'''” (If you don’t have other C/C++ compilers installed, you may not, “'''C/C++: g++ build active file'''” will be the default)
 +
# This will create a folder called '''.vscode''' with a JSON file called: '''tasks.json'''
 +
# Open the '''tasks.json''' file, it should look like this:
 
=== OpenMP ===
 
=== OpenMP ===
 
OpenMP
 
OpenMP
Line 23: Line 49:
 
TBB
 
TBB
 
=== MPI ===
 
=== MPI ===
MPI  
+
MPI
  
 
== Testing ==
 
== Testing ==

Revision as of 14:38, 30 March 2023

Investigative Report: Integrating OpenMP, TBB, and MPI into VSCode on MacOS v11.0+

Team

  1. Ibrahim Muhammad Yusoof
  2. Ho Wa Lo

Introduction

Since 2020, there has been a lot of updates to the Mac OS ecosystem, and its command line interface. Which has caused for the dependancy documentation for integrating with Mac OS outdated. So this report is our comprehensive findings for interfacing with the OpenMP, TBB, and MPI libraries on Visual Studio Code to leverage Parallel Computing Concepts that are outlined in this course. As many Software Developers working on Mac already now, Visual Studio for Mac only supports some languages, one of which isn’t C/C++. So we’ll be using the common and popular text editor, Visual Studio Code. Visual Studio Code will allow us to use the command line interface for our compiler to integrate and option the dependancies that we want to use.

You should already have Visual Studio Code downloaded, if not, you can find the Download and Install for it here: Visual Studio Code - Code Editing. Redefined

Vocabulary

Going forward, we’ll be using these terms:

CLI - Command Line Interface
VScode - Visual Studio Code

Integrating

Before we go into specifically each library, let’s talk about how VScode handles compilers. Within VSCode, when we create a .CPP file, we can either run the code in our terminal, or we can create a task that compiles our code before launching the executable with our runtime arguments. We’ll use this **task and launch** method to setup our environment for C++.

Start by creating a regular C++ workspace:

  1. Open up VScode and open a directory where you want to code
  2. Create a C++ file, for our example we’ll call it: `helloworld.cpp`
  3. You can add this code into it for now:
#include <iostream>

int main(int argc, char const *argv[])
{
   std::cout << "Hello world";
   return 0;
}


Tasks

From here, we want to tell VScode what **tasks** to run when we press the Run and Debug button. This will be similar to how we use terminal to build our code.

  1. Press Command+Shift+P
  2. At the search bar that comes up, type: Tasks: Configure Task and press Enter
  3. You’ll may see another option come up, to choose what kind of task, select “C/C++: g++ build active file” (If you don’t have other C/C++ compilers installed, you may not, “C/C++: g++ build active file” will be the default)
  4. This will create a folder called .vscode with a JSON file called: tasks.json
  5. Open the tasks.json file, it should look like this:

OpenMP

OpenMP

TBB

TBB

MPI

MPI

Testing

OpenMP

OpenMP

TBB

TBB

MPI

MPI