Skip to content

Latest commit

 

History

History
199 lines (132 loc) · 4.33 KB

File metadata and controls

199 lines (132 loc) · 4.33 KB

UNIWA

UNIVERSITY OF WEST ATTICA
SCHOOL OF ENGINEERING
DEPARTMENT OF COMPUTER ENGINEERING AND INFORMATICS

University of West Attica · Department of Computer Engineering and Informatics


Parallel Systems

Multisort

Vasileios Evangelos Athanasiou
Student ID: 19390005

GitHub · LinkedIn


Supervision

Supervisor: Vasileios Mamalis, Professor

UNIWA Profile

Co-supervisor: Michalis Iordanakis, Academic Scholar

UNIWA Profile · Scholar


Athens, February 2025



INSTALL

Multisort

This repository contains the Multisort algorithm implementation using OpenMP, developed as part of the Parallel Systems course at the University of West Attica. The project demonstrates a parallel divide-and-conquer sorting algorithm optimized for multi-threaded execution.


1. Prerequisites

1.1 Required Software

  • GCC Compiler (version supporting OpenMP, typically ≥ 4.2)
  • OpenMP library support
  • Operating System: Linux, macOS, or Windows (via WSL or MinGW)

1.2 Optional Software

  • Text Editor / IDE for source code editing (VSCode, CLion, etc.)
  • Spreadsheet Viewer for analyzing timing results (docs/Times.xlsx)

2. Installation Steps

2.1 Clone the Repository

Clone using Git:

git clone https://github.com/Parallel-Systems-aka-Uniwa/Multisort.git

Alternatively, download the ZIP file and extract it locally.

2.2 Navigate to Project Directory

cd Multisort

Ensure the following structure exists:

assign/
docs/
src/
README.md

src/ contains the main program (omp_msort.c) and input files for exercises A and B.

docs/ contains documentation and performance results.


3. Compilation Instructions

Compile the OpenMP C program using GCC:

gcc -o omp_msort src/omp_msort.c -fopenmp

Explanation:

-o omp_msort → output executable named omp_msort

-fopenmp → enables OpenMP directives


4. Execution Instructions

Run the program via command line with input and output file arguments:

./omp_msort src/A_unsort/A_unsort.txt src/A_sort/A_sort.txt
  • First argument: path to unsorted input array (A_unsort.txt)
  • Second argument: path for writing sorted output (A_sort.txt)

Example Run

./omp_msort src/A_unsort/A_T4_N1000000_L500.txt src/A_sort/Output_T4_N1000000_L500.txt
  • 4 threads, 1 million elements, recursion LIMIT = 500
  • Output saved in the src/A_sort/ folder

5. Input Files

  • Located in src/A_unsort/
  • Contain integer arrays of different sizes
  • File naming pattern:
A_T<Threads>_N<Size>_L<Limit>.txt

Example: A_T16_N100000000_L1000.txt → 16 threads, 100 million elements, LIMIT 1000


6. Output Files

  • Stored in src/A_sort/
  • Contains the sorted integer array corresponding to input configuration

Examples:

  • Output_T4_N1000000_L500.txt
  • Output_T16_N100000000_L1000.txt

7. Running Experiments

  • Modify thread count (T) to evaluate parallel performance
  • Modify array size (N) to test scalability
  • Adjust recursion LIMIT for optimal parallel/sequential balance
  • Compare execution times using spreadsheet data in docs/Times_Multisort.xlsx