Page 1 of 1

Write an MPI program that efficiently compute the sum of array elements. Program 1: Tasks communicate with MPI_Scatter a

Posted: Fri May 20, 2022 10:27 am
by answerhappygod
Write an MPI program that efficiently compute the sum of array
elements.
Program 1: Tasks communicate with MPI_Scatter and MPI_Reduce.
1. The programs can assume that the number of processes is a power
of two.
2. The programs should add 2^15 = 65536 random doubles in the range
0 to 100.
Task 0 must generate the numbers, store them in array and
distribute them to the tasks.
3. Each task does a serial sum of the numbers it is assigned. The
local sums are then
added together using a tree structured parallel sum.
4. After the parallel sum is complete, task 0 should compute a
serial sum of the
same numbers (to verify the result).
5. Task 0 must print the parallel sum, the serial sum and the time
required for the
parallel sum (including data distribution).
Collect and tabulate timing data for both implementations. Collect
data using two nodes
nodes and 2^i tasks, where i = 2, 3, 4. Collect times for at least
three runs of each configuration.
Discuss your timing results.