The P-MATRIX-MULTIPLY-RECURSIVE procedure has the disadvantage that it must allocate a temporary matrix T of size n

Question:

The P-MATRIX-MULTIPLY-RECURSIVE procedure has the disadvantage that it must allocate a temporary matrix T of size n × n, which can adversely affect the constants hidden by the ‚-notation. The P-MATRIX-MULTIPLY-RECURSIVE procedure does have high parallelism, however. For example, ignoring the constants in the ‚-notation, the parallelism for multiplying 1000 × 1000 matrices comes to approximately 10003/102 = 107, since lg 1000 ≈ 10. Most parallel computers have far fewer than 10 million processors.


a. Describe a recursive multithreaded algorithm that eliminates the need for the temporary matrix T at the cost of increasing the span to Θ(n). Compute C = C + AB following the general strategy of P-MATRIX-MULTIPLYRECURSIVE, but initialize C in parallel and insert a sync in a judiciously chosen location.


b. Give and solve recurrences for the work and span of your implementation.


c. Analyze the parallelism of your implementation. Ignoring the constants in the ‚-notation, estimate the parallelism on 1000 × 1000 matrices. Compare with the parallelism of P-MATRIX-MULTIPLY-RECURSIVE.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Introduction to Algorithms

ISBN: 978-0262033848

3rd edition

Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest

Question Posted: