angelortizv / ce4302-mpi

Repository from Github https://github.comangelortizv/ce4302-mpiRepository from Github https://github.comangelortizv/ce4302-mpi

Parallel Matrix Addition and Performance Evaluation

Description

This project consists of two programs implemented in C using the MPI (Message Passing Interface) standard for parallel processing:

  1. sum_matrices.c: Performs the addition of two matrices using MPI to distribute the computation of the sum across different nodes.

  2. performance_evaluation.c: Measures the communication time between two MPI nodes for messages of different sizes.

Instructions to Run

Prerequisites

  1. 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
  1. 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/

Compile and Execute

  1. Clone this repository to your local machine.

  2. Navigate to the project directory:

cd ce4302-mpi
  1. Compile the code using mpicc:
mpicc -o main sum_matrices.c
  1. Run the program:
./main
  1. Choose one of the options:
    • 1 to execute the matrix addition.
    • 2 to view the performance evaluation for different message sizes.

Results

Execution of sum_matrices.c

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.

sum_matrices

files

Execution of performance_evaluation.c

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.

performance_evaluation

About


Languages

Language:C 100.0%