100% Guaranteed Results


HPC – Faculty of Computers and Information Solved
$ 24.99
Category:

Description

5/5 – (1 vote)

High Performance Computing Parallel
Assignment 2 –MPI
1. The assignment is individual.
2. Code must be in C and MPI & you must run it before sending.
3. Cheating could lead to serious consequences.
Calculating Standard Deviation Problem Statement:
Write a parallel c program to calculate standard deviation using MPI_Bcast, MPI_Reduce & MPI_Allreduce ONLY. Don’t use MPI_Send and MPI_Receive
Given:
An integer n (number of elements per each process).
Output:
Standard deviation of randomly generated (n * numberOfProcesses) elements.
How to Calculate Standard Deviation:
1. Calculate the Mean.
2. For each number, subtract the mean and square the result.
3. Calculate the mean of the squared differences.
4. Take the square root of step three results.
1
Faculty of Computers and Information
Parallelization Scenario:
Master Process:
✔ Read n from the user.
✔ Broadcast n to each slave process using MPI_Bcast. ✔ Calculate the square root of the mean of squared differences.
Slave Process:
✔ Get n through the MPI_Bcast call.
✔ Generate n random elements. So each process will generate n numbers.
✔ Calculate local sum of the generated n elements.
✔ Share this local sum with the rest of the processes using MPI_Allreduce.
✔ Calculate the global mean. (Total sum of elements / n * numOfProcesses).
✔ Calculate local sum of squared differences from the mean. Sum (n – mean)2
✔ Share this local sum of squared differences with the master process using MPI_Reduce call.
Grading: (100)
Using MPI_Bcast 15
Using MPI_Reduce or MPI_Allreduce 20
Compile code 40
Run and Output correct 25

2

Reviews

There are no reviews yet.

Be the first to review “HPC – Faculty of Computers and Information Solved”

Your email address will not be published. Required fields are marked *

Related products