The purpose of this assignment is to give you experience writing simple programs in shared memory and message passing. This experience will provide a foundation for writing and/or running much more complex programs.
We have given you accounts on 14-processor Sun E6000 named cabernet.cs.wisc.edu. Unless you already had an account, you should only use this machine only for 757 homework assigments or, with instructor's permission, for your course project. In any case, you should never interfere with the research work on this research machine.
(a) Write a shared-memory program that reads in three N x N matrices, multiplies them, and writes the output to a file. Your program should operate in parallel with P processors specified on the command line. It is okay to only handle the just easy cases (e.g., N is multiple of P).
(b) For N a power of two, how big does N have to be for your program to reliably take over one minute in the parallel phase?
(c) Write an improved program that multiplies matrices more rapidly (where N is set to the size of your answer to part (b).
(a) Write the same program as in Problem 1 except this time write it using message-passing mechanisms instead of shared memory. You will be using the MPI (Message Passing Interface) standard to implement your message-passing code. You will be able to write C (not C++) code, compile it, and run it on the same machine as Problem 1.
Please turn this homework in on paper at the beginning of lecture.