Starting from:

$30

Homework 8 Write and run an MPI program

Homework 8
Write and run an MPI program to compute the following recurrence:
for (int i = 0; i<n; i++) {
t = t + a[i];
}
print(t);
Write two versions of the program:
1. Write a version using MPI collective communication.
2. Write a version using send/recv or send/irecv that forms a fan-in tree such as used by the
MPI recurrence.
Time the two versions using arrays of size 10000, 100000 and 1000000. Do several
timings and take the average. Run on one node with 16 processes.
What to turn in: You should turn in a zip file called <your last name>.zip. When unzipped it
should create a directory called <your last name> containing your code, your output and average
times for the six runs (3 for part 1 and 3 for part 2 using the different problem sizes.) Your output
can either be a screen shot, what you capture from using the Unix/Linux script command or the
program output directed into another file. 

More products