Write an MPI program that implements the matrix-vector multiplication algorithm
ID: 3786664 • Letter: W
Question
Write an MPI program that implements the matrix-vector multiplication algorithm (see page 343). The program should use 16 processes (4 times 4 mesh) and 2-D partitioning of matrix A. The size of the matrix A is the size of vector z is 400. Assume that the matrix is partitioned among the processes using a block 2-D partitioning (100 times 100 blocks per process). Initially the vector z is distributed only in the last column of four processes. The output vector y should be stored in the last column of four processes. Use as a test matrix A a matrix that has in all the rows the following elements {1, 2, 3, ..., 399, 400}The vector r has all elements equal to 1.Explanation / Answer
#define N 16384
int temp1[16384];
int temp2[2*N];
int pointer;
int main() { //... }
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.