

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


COSC 612 Programming with MPI Distributed 10/15/ Due: 10/29/09? You will implement the following using MPI. You can demo on a single node (e.g., your laptop), with a variety of processes. There are three parts to this program. Do them in order. These assignments are slightly modified from Pacheco, Parallel Programming with MPI , Chapter 5. Use your answer to #1 as help in implementing the subsequent parts. “1. In order to avoid some of the problems that may occur with I/O on your system, you should only input the scalar parameters to your programs. For example, if you are multiplying a matrix by a vector, you should only input the order of the matrix. The program should generate the matrix and vector (e.g., a matrix of all ones and a vectors of all ones). Of course, you won’t be able to tell whether your program works unless you print the results of your computations. So you should write two output functions: a vector output function and a matrix output function for matrices distributed by block rows*.”
} /* for i / } /Parallel_matrix_vector_prod */ “3. Recollect that a matrix-matrix product is formed by taking the dot product of each row of the left factor with each column of the right factor. More explicitly, suppose A = (aij) is an m X n matrix and B = (bij) is an n X r matrix. Then the product matrix, AB = C = (cij) is an m X r matrix, and cij is the dot product of the ith row of A with the jth column of B, or cij = ai0b0j + ai1b1j +... + ai,n- 1 bn-1, j. If A and B have been distributed by block rows, then we can use out parallel matrix vector product to compute a parallel matrix-matrix product as follows: for each column x of B { compute the parallel matrix-vector product Ax } Write a program that will compute a parallel matrix-matrix product using this algorithm.