[Solved] CS471 Assignment 2 Calculating Standard Deviation

$25

File Name: CS471_Assignment_2_Calculating_Standard_Deviation.zip
File Size: 461.58 KB

SKU: [Solved] CS471 Assignment 2 –Calculating Standard Deviation Category: Tag:
5/5 - (1 vote)

Calculating Standard Deviation Problem Statement:

Write a parallel c program to calculate standard deviation using MPI_Bcast, MPI_Reduce & MPI_Allreduce ONLY. Dont 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.

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
  • 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.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] CS471 Assignment 2 Calculating Standard Deviation
$25