Matrix Multi
Matrix Multi
Column j of
matrix A lags one time unit behind j-1 for 2 < J < k. This ensures that ais
meets bsj in processor P(i,j) at right time. At the end of the algorithm,
element Cij of the product matrix C resides in processor P(i, j). Initially, Cij is
zero. When P(I, j) receives two input a and b:
Example:
computer.
Example:
A CRCW SM SIMD computer with sixty-four processors can multiply the two matrices
Output:
The problem addressed in this section is that of multiplying an m x n matrix
A by an n x 1 vector U to produce an m x 1 vector V, as shown for m = 3
and n = 4:
.
Processor Pi is used to compute element vi of V Initially, vi is zero. Matrix A
and vector U are fed to the array, for n = 4 and m = 3. Each processor Pi
has three registers a, u, and v. When Pi receives two inputs aij and uj, it
Example:
matrix-by-vector multiplication requires m + n -1 steps on a linear array. It
is possible to reduce this time to m - 1 + log n by performing the
multiplication on a tree-connected SIMD computer. The arrangement is as
shown in Fig. for m = 3 and n = 4.
-The tree has n leaf processors P1, P 2, .. .,Pn,
The matrix A is fed to the tree row by row, one element per leaf.
When leaf processor Pi receives aji, it computes ui x aji and sends the
product to its parent.
When intermediate or root processor Pk receives two inputs from its
children, it adds them and sends the result to its parent.
Eventually vj emerges from the root. If the rows of A are input at the leaves
in consecutive time units, then the elements of V are also produced as
output from the root in consecutive time units. The algorithm is given as
procedure TREE MV MULTIPLICATION.
Example:
SOLVING LINEAR SYSTEMS
Computers.
system.
Definition:
A Sequential algorithm for back substitution
A Parallel implemention of Back substitution algo
Example:
CRCW ALGORITHM
Example:
=[-;09
GRAPH ALGORITHMS
Example:
Fig:
PERMUTATION
Order.
COMBINATION
Assume that m processors are available on an EREW SM SIMD computer. We
give our first parallel m-permutation generator as procedure PARALLEL
PERMUTATIONS. The procedure takes n and m as input
Procedure PARALLEL PERMUTATIONS also invokes the following four
procedures for EREW SM SIMD computers:
EXAMPLE: