Skip to content

Latest commit

 

History

History
193 lines (126 loc) · 4.27 KB

File metadata and controls

193 lines (126 loc) · 4.27 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

Parallel Computing using OpenMP

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, December 2024



INSTALL

Parallel Computing using OpenMP

This repository contains laboratory simulations and source code for Parallel Computing using OpenMP, developed as part of the Parallel Systems course at the University of West Attica. The focus is on matrix operations, diagonal dominance checking, and parallel reduction algorithms using the fork-join model.

All exercises are implemented in C using OpenMP.


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/OpenMP.git

Alternatively, download the ZIP file and extract it locally.

2.2 Navigate to Project Directory

cd OpenMP

Ensure the following structure exists:

assign/
docs/
src/
README.md

src/ contains the main program (omp.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 omp.c -fopenmp

Explanation:

-o omp → output executable named omp

-fopenmp → enables OpenMP directives


4. Execution Instructions

Run the program with two arguments:

  1. Input file for Task A (matrix file)
  2. Input file for Task B (matrix file)

Example:

./omp src/A/A_T8_N400_CZ20.txt src/B/B_T8_N400_CZ20.txt
  • Output will be saved automatically in src/Output/ with names matching the input configuration.

5. Input Files

  • Task A files: src/A/ – matrices for diagonal dominance and other operations
  • Task B files: src/B/ – matrices for the second task (maximum diagonal, B matrix generation, etc.)

File naming pattern:

A_T<Threads>_N<Size>_CZ<Chunk>.txt

Example: A_T12_N1000_CZ100.txt → 12 threads, 1000×1000 matrix, chunk size 100.


6. Output Files

All results are saved to src/Output/:

  • Contains task results: dominance check, maximum diagonal, B matrix, minimum element (via different methods)
  • File names correspond to input configuration for easy correlation

7. Running Experiments

  • Modify thread count or chunk size in input files
  • Compare sequential vs parallel execution
  • Analyze speedup using the timing results in docs/Times.xlsx