Skip to content

anishp3613/HPC-LAB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Parallel Quicksort using MPI

πŸ“Œ Project Overview

This project compares:

  • Serial Quicksort (Normal C++)
  • Parallel Quicksort using MPI

The purpose is to measure performance improvement using parallel computing.


πŸ–₯️ System Requirements

  • Windows 10 / 11
  • WSL (Ubuntu installed)
  • g++ compiler
  • OpenMPI installed

πŸ“‚ Project Folder Setup (Using nano)

πŸ”Ή Step 1: Open Ubuntu (WSL)

Search Ubuntu in Windows and open it.


πŸ”Ή Step 2: Create Project Folder

mkdir quicksort_project
cd quicksort_project

πŸ”Ή Step 3: Create Serial File

nano serial.cpp

πŸ‘‰ Paste your serial code πŸ‘‰ Press:

  • CTRL + O β†’ Press Enter (Save)
  • CTRL + X β†’ Exit nano

πŸ”Ή Step 4: Create Parallel File

nano parallel.cpp

πŸ‘‰ Paste your parallel MPI code πŸ‘‰ Press:

  • CTRL + O β†’ Press Enter
  • CTRL + X β†’ Exit

πŸ”Ή Running Serial Version

Compile

g++ serial.cpp -o serial

Run

./serial

Example Output:

Serial Execution Time: 0.114773 seconds

πŸ”Ή Running Parallel Version (MPI)

Compile

mpic++ parallel.cpp -o parallel

Run with 4 processes

mpirun --oversubscribe -np 4 ./parallel

Example Output:

Parallel Execution Time: 0.0701045 seconds

πŸ“Š Performance Calculation

Speedup

Speedup = Serial Time / Parallel Time

Example:

Speedup = 0.114773 / 0.0701045 β‰ˆ 1.63


Efficiency

Efficiency = Speedup / Number of Processes

Efficiency = 1.63 / 4 β‰ˆ 0.40


⚠️ Common Ubuntu / MPI Errors & Solutions


❌ g++: command not found

βœ… Solution:

sudo apt update
sudo apt install g++

❌ mpic++: command not found

βœ… Solution:

sudo apt update
sudo apt install openmpi-bin openmpi-common libopenmpi-dev

❌ Not enough slots available

Error message:

There are not enough slots available...

βœ… Solution:

mpirun --oversubscribe -np 4 ./parallel

❌ Permission denied

βœ… Solution:

chmod +x serial
chmod +x parallel

❌ No such file or directory

βœ… Solution:

Check current folder:

pwd
ls

Make sure you are inside:

quicksort_project

❌ Ubuntu password not showing while typing

Nothing appears while typing password.

βœ… Solution:

Just type password and press Enter. It is normal in Linux.


❌ nano stuck / file not saving

βœ… How to Exit nano properly:

  • Save β†’ CTRL + O
  • Press Enter
  • Exit β†’ CTRL + X

If you want to exit without saving:

  • CTRL + X
  • Press N

❌ mpirun freezes

βœ… Solution:

Stop program:

CTRL + C

Then try smaller process count:

mpirun --oversubscribe -np 2 ./parallel

πŸ“ˆ What This Project Demonstrates

  • Parallel computing reduces execution time.

  • MPI allows communication between processes.

  • Speedup is limited due to:

    • Communication overhead
    • Synchronization delay
    • Sequential part of program

🎯 Conclusion

This project demonstrates practical use of MPI for parallel programming and shows performance comparison between serial and parallel Quicksort algorithms.


πŸ‘¨β€πŸ’» Author

Anish Phatake Harsh Kadam Pruthviraj Pawar Sachin Chavan BE Computer Engineering Mini Project – High Performance Computing

About

HELLO EVERYONE THIS REPO CONTAINING THE HPC (HIGH PERFORMANCE COMPUTING) LAB MINI PROJECT FOR SAVITRIBAI PHULE PUNE UNIVERSITY (SPPU) WITH HOW TO RUN AND SETUP GUIDANCE PROVIDED IN readme.md FILE

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages