Sheet 2: Problem 1: Matrix Multiplication Using CREW PRAM
Sheet 2: Problem 1: Matrix Multiplication Using CREW PRAM
1
2. Perform matrix multiplication on the padded matrices using the algorithm
from part (a)
Complexity Analysis:
• m < 2n
c) Cost-optimality analysis
The original solution uses O(n3) processors and O(log n) time, giving a cost of
O(n3log n), which is not cost-optimal (sequential algorithm has cost O(n3)).
Cost-optimal version:
This version:
2
Algorithm 3 CREW Array Initialization
1: Input: Array A of size n, value X
2: Output: Array A initialized with value X
3: for all processors P(i) where 1 ≤ i ≤ n do in parallel
4: A[i] ←X
5: end for