Write portions of a MPI program to multiply two n-by-n matrices A and B of integers using p processors organized in a ring network. Assume matrix A is stored in row-major order and the matrix B is stored as its transpose – call it matrix BT. The latter assumption allows you to send/receive columns of B by referring to the rows of matrix BT. P0 will initially distribute ith row-band of A and ith row-band of BT to Pi, 1 ≤ i ≤ p−1. To compute their row-bands of product matrix C, the processors will use p steps of computation (multiplying row-bands of A and BT) and (p-1) steps of communication (sending the row-band of BT to the right neighbor and receiving from the left neighbor. You must only use send/receive primitives. P0 finally receives the ith row-bands of product matrix C from Pi, 1 ≤ i ≤ p − 1. Note: To simplify, you can assume that you can multiply row-band of A with row-band of BT each starting at row j and with m rows and store the block produced into row-band of matrix C at row j starting in column k by calling a function mat mul row band(A, BT, j, m, C, k). You may modify the interface of this function slightly to suit your design. (a) Give the code for P0 to send the ith row-band of A and ith row-bands of BT to Pi, 1 ≤ i ≤ p − 1. Clearly show the starting row and number of rows to be sent to each processor, including the last processor. (b) Give the code for Pi to receive the ith row-band of A and ith row-band of BT from P0. Give the correct parameter for how many integers are received.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Write portions of a MPI program to multiply two n-by-n matrices A and B of integers using p processors organized in a ring network. Assume matrix A is stored in row-major order and the matrix B is stored as its transpose – call it matrix BT. The latter assumption allows you to send/receive columns of B by referring to the rows of matrix BT. P0 will initially distribute ith row-band of A and ith row-band of BT to Pi, 1 ≤ i ≤ p−1. To compute their row-bands of product matrix C, the processors will use p steps of computation (multiplying row-bands of A and BT) and (p-1) steps of communication (sending the row-band of BT to the right neighbor and receiving from the left neighbor. You must only use send/receive primitives. P0 finally receives the ith row-bands of product matrix C from Pi, 1 ≤ i ≤ p − 1. Note: To simplify, you can assume that you can multiply row-band of A with row-band of BT each starting at row j and with m rows and store the block produced into row-band of matrix C at row j starting in column k by calling a function mat mul row band(A, BT, j, m, C, k). You may modify the interface of this function slightly to suit your design.

(a) Give the code for P0 to send the ith row-band of A and ith row-bands of BT to Pi, 1 ≤ i ≤ p − 1. Clearly show the starting row and number of rows to be sent to each processor, including the last processor.

(b) Give the code for Pi to receive the ith row-band of A and ith row-band of BT from P0. Give the correct parameter for how many integers are received.

Expert Solution
steps

Step by step

Solved in 2 steps with 5 images

Blurred answer
Similar questions
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY