24
edits
Changes
no edit summary
== 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:
Note: Installing Visual Studio Code and the HPC packages are not apart of the scope of this report. The installation is straight forward through the wizard.
=== Vocabulary ===
Going forward, we’ll be using these terms:
{
// OpenMP - Runtime Routines
// omp_hi.cpp// for OpenMP library functions
#include <iostream>
int main() {
#pragma omp parallel// Start of parallel region using pragma directive
{
int tid = omp_get_thread_num(); // Get the ID of the current thread
std::cout << "Hi from thread "
<< tid << '\n';// Print a message showing the ID of the current thread
}
}
// tbb.cpp
#include <iostream>
#include <tbb/tbb.h>// for TBB library functions
int main() {
<< TBB_VERSION_MAJOR << "."
<< TBB_VERSION_MINOR << " ("
<< TBB_INTERFACE_VERSION << ")" << std::endl; // Print a message showing the version of TBB being used
}
}
#include <stdio.h>
#include <mpi.h>// for MPI library functions
int main(int argc, char** argv) {
int rank, np;
MPI_Init(&argc, &argv);// Initialize MPI MPI_Comm_rank(MPI_COMM_WORLD, &rank); // Get the rank of the current process MPI_Comm_size(MPI_COMM_WORLD, &np);// Get the total number of processes
printf("Hello from process %d of %d\n",
rank, np);// Print a message showing the rank and total number of processes MPI_Finalize();// Finalize MPI
return 0;
}
}