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
Vasileios Evangelos Athanasiou
Student ID: 19390005
Supervision
Supervisor: Vasileios Mamalis, Professor
Co-supervisor: Michalis Iordanakis, Academic Scholar
Athens, February 2025
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.
- GCC Compiler (version supporting OpenMP, typically ≥ 4.2)
- OpenMP library support
- Operating System: Linux, macOS, or Windows (via WSL or MinGW)
- Text Editor / IDE for source code editing (VSCode, CLion, etc.)
- Spreadsheet Viewer for analyzing timing results (
docs/Times.xlsx)
Clone using Git:
git clone https://github.com/Parallel-Systems-aka-Uniwa/Multisort.gitAlternatively, download the ZIP file and extract it locally.
cd MultisortEnsure the following structure exists:
assign/
docs/
src/
README.mdsrc/ contains the main program (omp_msort.c) and input files for exercises A and B.
docs/ contains documentation and performance results.
Compile the OpenMP C program using GCC:
gcc -o omp_msort src/omp_msort.c -fopenmpExplanation:
-o omp_msort → output executable named omp_msort
-fopenmp → enables OpenMP directives
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
- Located in
src/A_unsort/ - Contain integer arrays of different sizes
- File naming pattern:
A_T<Threads>_N<Size>_L<Limit>.txtExample: A_T16_N100000000_L1000.txt → 16 threads, 100 million elements, LIMIT 1000
- Stored in
src/A_sort/ - Contains the sorted integer array corresponding to input configuration
Examples:
Output_T4_N1000000_L500.txtOutput_T16_N100000000_L1000.txt
- 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

