Open main menu

CDOT Wiki β

Changes

GPU621/Group 5

1,056 bytes added, 00:43, 10 April 2023
no edit summary
== Investigative Report: Integrating OpenMP, TBB, and MPI into VSCode on MacOS v11.0+ ==
== Team ==
# [mailto:imuhammad-yusoof@myseneca.ca?subject=GPU621_Project Ibrahim Muhammad Yusoof]
# [mailto:hllo@myseneca.ca?subject=GPU621_Project 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 downloaded and installed:
* Visual Studio Code,
:* If not, you can find the Download and Install for it here: [https://code.visualstudio.com Visual Studio Code - Code Editing. Redefined]
== 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:
=== tasks.json ===
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.
This task tells VScode, when we use this task, run [this].command with [this].args. VScode will inject this into our terminal to automatically compile our code. This will help our VScode Debugger and help our launch task get ready for running our code.
g++ -fdiagnostics-color=always -g helloworld.cpp -o ./helloworld
=== launch.json ===
Our launch file will facilitate the execution of our code, in the '''task.json''' we compiled and produced an output, here we will run our code with the correct information.
}
]
}
'''prelaunchTask''': The prelaunch task is set to a string that matches the label section in our tasks. It identifies which task needs to run in order for the launch to be successful. This is where you can create multiple launch tasks that setup your files differently. We’ll be adding a '''task''' and a '''launch''' for all the library we’ll be setting up.
We recommend you create and test these configurations yourself, after you’ve gotten it working, you can use the same /.vscode directory in your other projects.
== OpenMP ==
Assuming that you’ve already installed the *Intel oneAPI Base & HPC Toolkits*, let’s start with integrating OpenMP into our workspace. We’ll need to do a couple of things:
# Add a Launch
# Add the library and bin directory location for intellisense
=== tasks.json ===
We’ll add a task to compile our source code using OpenMP, this task will only build the active file using OpenMP.
24
edits