Lab12 Parallel and Distributed Computing
Lab12 Parallel and Distributed Computing
EXPERIMENT NO 12
Ability to
Conduct
Experiment
Ability to assimilate the
results
Data presentation
Experimental results
Conclusion
LAB REPORT 12
Date: 12/23/2024
LAB TASKS
Lab Task 1: Write an MPI program that divides an array of integers
among several processes, and each process computes the sum of its
subarray. Finally, process 0 should collect and print the total sum.
Setup:
Code:
Output:
Lab Task 02:
Implement a parallel matrix addition program in C using MPI, where each
process adds a submatrix and then gathers the result on process 0.
Code:
Output:
Lab Task 3: Implement an MPI program in C that parallelizes the
computation of the sum of an array by distributing the elements across
multiple processes and combining the results.
Code:
Output:
Lab Task 4: Write an MPI program in C to compute the sum of an array
by distributing the array elements across multiple processes and then
combining the partial sums to get the total sum.
Code:
Output:
Conclusion:
In this lab, we focused on the fundamentals of parallel and distributed computing using
MPI. We gained practical insights into the benefits and challenges of parallel computing. I
used MPI communication primitives such as MPI_Scatter and MPI_Reduce to efficiently
distribute data and aggregate results, ensuring effective collaboration between processes
and reducing redundancy. These skills are critical for solving real-world problems in high
performance computing and distributed systems.