Skip to content

Latest commit

 

History

History

High_Performance_Computing_CSE_4014

High Performance Computing - CSE4014

Setup

There are two main frameworks which are necessary for proceeding with these labs -- openmp and mpi. Programming Experience with C language is also recommended to follow through.

I have performed the installation on a Mac OSX environment, and thus the installation process on other Operating systems would differ.

1. Open MP :

  • Installed using GCC Compiler

  • I have installed gcc-10 using homebrew in mac.

  • Compilation

gcc-10 -fopenmp <file_name.c>
  • Execution
./a.out
  • To set the number of threads, run this command in the terminal before compiling the program.
export OMP_NUM_THREADS=<number of threads to use> 

2. MPI :

  • Installed open-mpi using
brew install openmpi
  • To Compile -
mpicc -o <output_file_name> <file_name>.c
  • To Run -
mpirun -np <number_of_processors> <output_file_name>
  • Default Compiler Location : /usr/local/bin/mpicc

  • To create more than 2 processors :

mpirun -np 3 --oversubscribe a.out

Index

  1. Fibonacci Series

In this, we use the Open MP constructs to use multiple threads to compute and store the fibonacci series in a parallel manner.

  1. Inter Process Communication - Introduction

A template for MPI constructs, and a basic program to get a hang of different constructs used with MPI.
We will also display the details of the processor in the system.

  1. MPI - Scatter and Gather Constructs

A program to find the average of a few numbers using the Scatter and Gather constructs of MPI.

  1. MPI - Reduction

A program to find the average of a few numbers using the Scatter and Reduce constructs of MPI.

  1. MPI - Passing Integers

A program to send and recieve integers between two processes.

  1. MPI - Passing Strings

A program to send and recieve string messages between two processes. Note : This program has not been written by me, but instead the author has been credited in the code.

  1. MPI - Message Passing with Probing

A program to send and recieve string messages between two processes with probing using MPI_Probe and MPI_Get_count constructs.

  1. MPI - Passing Arrays

A program to send and recieve arrays of integers between two processes.

  1. MPI - Message Broadcast

A program to broadcast messages from one process to all other processes. This is mainly used for data synchronization among the processes and is achieved through the MPI_Bcast construct.

  1. MPI - Ping Pong

A program which will cause a message to bounce back and forth between two processes till a condition is met.

  1. MPI - Token Ring

A program which will arrange multiple processes in the form of a ring and make a message float through them. The message passes from say Process 1 through all other processes and returns back to Process 1.