Escolar Documentos
Profissional Documentos
Cultura Documentos
Presentation document
Submitted To:
Mrs. Harjeet Kaur
Submitted By:
Vikas Agarwal
ROllNo: 73
RegNo: 7070070006
[PARALLEL ALGORITHM
FOR MULTIPROCESSORS]
Parallel algorithm – definition
A parallel algorithm is an algorithm that has been specifically written for execution on a computer with
two or more processing units.
Some algorithms are easy to divide up into pieces like this. For example, splitting up the job of checking
all of the numbers from one to a hundred thousand to see which are primes could be done by assigning a
subset of the numbers to each available processor, and then putting the list of positive results back
together.
Most of the available algorithms to compute pi (π), on the other hand, cannot be easily split up into
parallel portions. They require the results from a preceding step to effectively carry on with the next step.
Such problems are called inherently serial problems. Iterative numerical methods, such as Newton's
method or the three-body problem, are also algorithms which are inherently serial. Some problems are
very difficult to parallelize, although they are recursive. One such example is the depth-first search of
graphs.
Parallel algorithms are valuable because of substantial improvements in multiprocessing systems and the
rise of multi-core processors. In general, it is easier to construct a computer with a single fast processor
than one with many slow processors with the same throughput. But processor speed is increased primarily
by shrinking the circuitry, and modern processors are pushing physical size and heat limits. These twin
barriers have flipped the equation, making multiprocessing practical even for small systems.
Parallel algorithms
can be run on computers with single processor
A superscalar processor executes more than one instruction during a clock cycle by
-> simultaneously dispatching multiple instructions to redundant functional units on the processor.
->Each functional unit is not a separate CPU core but an execution resource within a single CPU such as
an arithmetic logic unit, a bit shifter, or a multiplier.
Modelling algorithms
when designing algorithm, take into account the cost of communication, the number of processors
(efficiency)
designer usually uses an abstract model of computation called parallel random-access machine
(PRAM)
each CPU operation = one step (step like logical operations, memory accesses, arithmetic
operations)
model’s advantages
Multiprocessor model
MultiPROCESSOR
MODEL
typically the modules (proc and mem) are arranged in the way that the access to memory is
uniform for all processors
Work-depth model
Picture: Summing 16 numbers on a tree. The total depth (longest chain of dependencies) is 4 and the total
work (number of operations) is 15.
Work - W
Depth - D
Mergesort
Conceptually, a merge sort works as follows:
Otherwise:
Divide the unsorted list into two sublists of about half the size.
Search
At any one time, some tasks are actively engaged in expanding the tree further (these are shaded
in the figure);
others have reached solution nodes and are terminating, or are waiting for their offspring to
report back with solutions.
Shortest-Path Algorithms
The all-pairs shortest-path problem involves finding the shortest path between all pairs of vertices
in a graph.
E ⊆ V x X of edges.
Formally, given a weighted graph (that is, a set V of vertices, a set E of edges, and a real-valued weight
function f : E → R), and one element v of V, find a path P from v to a v' of V so that \sum_{p\in P} f(p)
is minimal among all paths connecting v to v' .
The problem is also sometimes called the single-pair shortest path problem, to distinguish it from the
following generalizations:
* The single-source shortest path problem, in which we have to find shortest paths from a source vertex
v to all other vertices in the graph.
* The single-destination shortest path problem, in which we have to find shortest paths from all vertices
in the graph to a single destination vertex v. This can be reduced to the single-source shortest path
problem by reversing the edges in the graph.
* The all-pairs shortest path problem, in which we have to find shortest paths between every pair of
vertices v, v' in the graph.
Floyd’s algorithm
Floyd’s algorithm is a graph analysis algorithm for finding shortest paths in a weighted graph.
A single execution of the algorithm will find the shortest paths between all pairs of vertices.
parallel Floyd’s algorithm
Parallel Floyd’s algorithm
The first parallel Floyd algorithm is based on a one-dimensional, rowwise domain decomposition
of the intermediate matrix I and the output matrix S.
Each task has one or more adjacent rows of I and is responsible for performing computation on
those rows.
In (a), the data allocated to a single task are shaded: a contiguous block of rows.
In (b), the data required by this task in the k th step of the algorithm are shaded: its own block
and the k th row.
In(a), the data allocated to a single task are shaded: a contiguous submatrix.
In (b), the data required by this task in the k th step of the algorithm are shaded: its own block,
and part of the k th row and column.