Skip to content

Latest commit

 

History

History
65 lines (54 loc) · 3.1 KB

File metadata and controls

65 lines (54 loc) · 3.1 KB

Parallel Processing & Distributed System Lab

Installation of MPI in Windows Subsystem for Linux

  • Go to Turn Windows features on or off & turn on the Windows Subsystem for Linux
  • Now go to windows Terminal & run the 1st command (if doesn't work run the 2nd command)
wsl.exe --install
wsl --install -d Ubuntu-22.04
  • If any error occurs go to the provided link & download the latest package from Step 4 - Download the Linux kernel update package
  • If further error occurs with error code 0x80370102 go to Terminal & run the following command
wsl --update
wsl --set-default-version 1
  • Now go to Ubunto & Setup with Username & Password
  • Then run the following commands on Ubunto
sudo apt-get update
sudo apt-get install mpich
  • Once after every session you have to mount your drive using the command on Ubuntu
cd /mnt/(C/D/E/F)

Run Command on Ubuntu

  • To run a C Program, go to Ubuntu & then run the following commands
mpicc name.c -o name
mpirun -n number_of_processors ./name  
  • To run a C++ Program, go to Ubuntu & then run the following commands
mpic++ name.cpp -o name
mpirun -n number_of_processors ./name  

Installation of MPI in Visual Studio Code

  • To install MPI, see this video & follow every step carefully. If you face the issue "sal.h dependency not found" or something like that, uninstall the MinGW compiler & follow this video

Run Command on Visual Studio Code

  • To run a C Program, go to Terminal > Run Build Task... in the VS Code & then run the following command
mpiexec -n number_of_processors file_name_without_extension

Lab Tasks

  • Write an MPI program to multiply two matrices of size MxN and NxP
  • Write an MPI program to simulate a simple calculator. Perform each operation using a different process in parallel ✓
  • Write an MPI program to count the words in a file & sort it in descending order of frequency of words that is, the highest occurring word must come first & the least occurring word must come last
  • Write a nMPI program using synchronous send. The sender process sends a word to the receiver. The second process receives the word, toggles each letter of the word and sends it back to the first process. Both processes use synchronous send operations ✓
  • Write an MPI program to add an array of size N using two processes. Print the result in the root process. Investigate the amount of time taken by each process ✓
  • Write a Cuda program for matrix multiplication
  • Write a Cuda program to find out the maximum common subsequence
  • Given a paragraph & a pattern like %x%. Now write a Cuda program to find out the line number where %x% this pattern exists in the given paragraph