0% found this document useful (0 votes)
48 views38 pages

Matrix Multi

This document discusses algorithms for matrix-vector multiplication and back substitution on parallel computers. It proposes: 1) A algorithm for matrix-vector multiplication on a linear array computer that assigns each processor one element of the output vector and uses communication to compute its value. 2) An algorithm for matrix-vector multiplication on a tree computer that distributes the matrix rows and vector among processors, uses local computation and communication to multiply pairs of values and combine results up the tree. 3) A parallel algorithm for back substitution that assigns each processor one equation and uses communication to solve the system simultaneously.

Uploaded by

insha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views38 pages

Matrix Multi

This document discusses algorithms for matrix-vector multiplication and back substitution on parallel computers. It proposes: 1) A algorithm for matrix-vector multiplication on a linear array computer that assigns each processor one element of the output vector and uses communication to compute its value. 2) An algorithm for matrix-vector multiplication on a tree computer that distributes the matrix rows and vector among processors, uses local computation and communication to multiply pairs of values and combine results up the tree. 3) A parallel algorithm for back substitution that assigns each processor one equation and uses communication to solve the system simultaneously.

Uploaded by

insha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

Row i of matrix A lags one time unit behind i-1 row for 2<i<m.

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:

Our first algorithm for matrix-by-vector multiplication is designed to run on a


linear array with m processors P1, P2 , . . ., Pm

.
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,

-n - 2 intermediate processors Pn+1, Pn+2, ... P2n- 2,

and a root processor P2n – 1.

Leaf processor Pi stores ui throughout the execution of the algorithm.

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:

Assume that two processors are available on a CREW SM MIMD computer.

=[-;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:

Updating permutation using procedure PARALLEL PERMUTATIONS


We now turn to the problem of generating all combinations of S = {
1,2,.. . ., n in lexicographic order.

A Fast Combination Generator


EXAMPLE:

The behavior of PARALLEL COMBINATIONS is for the case where n = 5 and


m = 3. The figure shows the contents of each of the arrays y, z, and c as
well as the value of k after each step of the procedure where they are
modified by an assignment. Note that t and f represent true and false,
respectively. Also, (xI X2 x3) = (3 4 5) throughout.
Generating combinations of three out of five items using procedure
PARALLEL COMBINATIONS.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy