UNIVERSITY OF WEST ATTICA
SCHOOL OF ENGINEERING
DEPARTMENT OF COMPUTER ENGINEERING AND INFORMATICS
University of West Attica · Department of Computer Engineering and Informatics
Introduction to Parallel Computing
Vasileios Evangelos Athanasiou
Student ID: 19390005
Supervision
Supervisor: Vasileios Mamalis, Professor
Supervisor: Grammati Pantziou, Professor
Co-supervisor: Michalis Iordanakis, Academic Scholar
Athens, January 2023
The primary objective of this exercise is to manage and process a vector X of size N across p processes using MPI and collective communication.
| Section | Folder | Description |
|---|---|---|
| 1 | assign/ |
Assignment material for the Collective Communication laboratory |
| 1.1 | assign/PAR-LAB-EXER-II-2022-23.pdf |
Laboratory exercise description in English |
| 1.2 | assign/ΠΑΡ-ΕΡΓ-ΑΣΚ-ΙΙ-2022-23.pdf |
Περιγραφή εργαστηριακής άσκησης (Greek) |
| 2 | docs/ |
Documentation and theoretical background on collective communication |
| 2.1 | docs/Collective-Communication.pdf |
Theory and mechanisms of collective communication (EN) |
| 2.2 | docs/Συλλογική-Επικοινωνία.pdf |
Θεωρία Συλλογικής Επικοινωνίας (EL) |
| 3 | src/ |
Source code implementing collective communication operations |
| 3.1 | src/collective_communication.c |
C implementation of MPI collective communication primitives |
| 4 | README.md |
Project documentation |
| 5 | INSTALL.md |
Usage instructions |
The system follows a manager–worker model:
-
Process P₀ (Manager):
- Initializes and owns the full vector
- Distributes vector segments to all processes (including itself)
- Coordinates global calculations and gathers results
-
Worker Processes (P₁ … Pₚ₋₁):
- Perform computations on their assigned sub-vectors
- Participate in collective communication operations
All calculations are executed locally first and then combined using MPI collective routines.
The program performs the following operations on the distributed vector X:
- Computes the mean value of the vector
- Counts:
- Elements greater than the average
- Elements less than the average
The dispersion (variance) is calculated using:
where:
is the mean value of the vector
Computes a normalized percentage vector
:
This expresses each element’s relative position between the minimum and maximum values.
- Identifies the maximum value in the vector
- Determines its global index
- Computes the prefix sum vector of X
- Each element contains the sum of all previous elements up to that position
This project demonstrates effective use of MPI collective communication for distributed numerical processing. It highlights practical applications of MPI_Bcast, MPI_Scatter, MPI_Reduce, and MPI_Scan, offering a strong foundation for understanding data-parallel computation and process coordination in high-performance computing environments.
