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 project implements and evaluates the Multisort algorithm—a parallel alternative to Mergesort—using OpenMP. The goal is to achieve high-performance sorting through a multi-threaded "divide and conquer" approach.
| Section | Folder/File | Description |
|---|---|---|
| 1 | assign/ |
Assignment material for the Multisort OpenMP workshop |
| 1.1 | assign/_Par_Sys_Ask_2_2024-25.pdf |
Assignment description in English |
| 1.2 | assign/_Παρ_Συσ_Ασκ_2_2024-25.pdf |
Assignment description in Greek |
| 2 | docs/ |
Documentation and performance results for Multisort algorithm |
| 2.1 | docs/Algorithm-Multisort.pdf |
English documentation for Multisort algorithm |
| 2.2 | docs/Αλγόριθμος-Multisort.pdf |
Greek documentation for Multisort algorithm |
| 2.3 | docs/Times_Multisort.xlsx |
Execution times and benchmarks |
| 3 | src/ |
Source code and input/output data for Multisort exercises |
| 3.1 | src/omp_msort.c |
Main OpenMP Multisort program |
| 3.2 | src/A_sort/ |
Sorted input data files for exercise A |
| 3.3 | src/A_unsort/ |
Unsorted input data files for exercise A |
| 3.4 | src/Output/ |
Output result files from Multisort execution |
| 4 | README.md |
Project documentation |
| 5 | INSTALL.md |
Usage instructions |
The Multisort algorithm decomposes the sorting problem recursively and distributes tasks to parallel threads.
-
Partitioning
Divide the input array of N integers into four equal-sized parts. -
Parallel Recursion
Each part is sorted recursively using OpenMP tasks, allowing up to four threads to process simultaneously. -
Termination Criterion
If a sub-array reaches a user-defined LIMIT, recursion stops and sequential Quicksort is used. -
Parallel Merging
- Merge the four sorted parts in pairs simultaneously.
- Finally, merge the two remaining parts sequentially to produce a fully sorted array.
#pragma omp parallel→ Activates parallel threads#pragma omp single→ Starts the initial recursive call by a single thread#pragma omp task→ Defines tasks for recursion and mergingfirstprivate→ Ensures each thread has its own initialized copy of variables#pragma omp taskwait→ Synchronization barrier to wait for all sub-tasks
| Function | Description |
|---|---|
multisort |
Core parallel function managing partitioning and task allocation |
merge |
Merges two sorted subsets into a temporary array before writing back |
quicksort |
Sequential fallback for small sub-arrays below LIMIT |
pivotPartition |
Partitions array around a pivot element for Quicksort |
The implementation evaluates efficiency based on:
- Table Size (N) → Total number of integers
- Threads (T) → Number of parallel threads
- Limit (LIMIT) → Threshold for switching from parallel recursion to sequential Quicksort
Speedup Analysis: Execution times for sequential runs (1 thread) are compared against parallel runs (up to 16 threads).
The program is executed via command line with parameters:
- Number of threads
- Array size
- Recursion limit
Output_T4_N1000000_L500.txt→ 4 threads, 1 million elements, LIMIT 500Output_T16_N100000000_L1000.txt→ 16 threads, 100 million elements, LIMIT 1000

