This project consists of two programs implemented in C using the MPI (Message Passing Interface) standard for parallel processing:
-
sum_matrices.c: Performs the addition of two matrices using MPI to distribute the computation of the sum across different nodes.
-
performance_evaluation.c: Measures the communication time between two MPI nodes for messages of different sizes.
- Make sure to have MPI installed on your system. You can install it using:
sudo apt update
sudo apt install openmpi-bin
sudo apt install libopenmpi-dev
mpicc --version
- Create a MPI Cluster
3 Virtual Machines with Ubuntu 18.04.06 were created for this task using VirtualBox.
Follow these instructions to create the MPI CLUSTER: https://www.geeksforgeeks.org/creating-an-mpi-cluster/
-
Clone this repository to your local machine.
-
Navigate to the project directory:
cd ce4302-mpi
- Compile the code using
mpicc
:
mpicc -o main sum_matrices.c
- Run the program:
./main
- Choose one of the options:
1
to execute the matrix addition.2
to view the performance evaluation for different message sizes.
The program performs the addition of two matrices by distributing the computation across different nodes. The initial matrices are printed to the initial.txt
file, and the result is printed to the results.txt
file.
The program measures the communication time between two MPI nodes for messages of different sizes. The results are displayed in the console, providing information about the communication time for each message size.