Lect8 Parallel System
Lect8 Parallel System
Sorting Algorithm
1- Internal 2- External
The number of Use auxiliary storage (such
elements is small hard disks) to store because
enough to fit into the number of elements to
the processor’s be sorted is too large to fit
main memory into memory
Sorting Algorithm
1- Comparison based
Repeatedly comparing pairs of elements and if they are
out of order, exchange them. This is called (compare-
exchange).
Lower bound is Θ(n log n) on the sequential computer.
*In parallel sorting, there are two places where these sequences
can reside. They may be sorted on only one of the processors, or
they may be distributed among the processors.
Step 3
sorting
More than one elements per processor
≈ Θ
Mapping Bitonic sort algorithm into a
Hypercube and Mesh Networks
Mapping Bitonic sort algorithm into a Hypercube
and Mesh Networks
=Θ
* Mesh
The connectivity of a mesh is lower than that of a hypercube, so it is
impossible to map wires to processors such that each compare
exchange operation occurs only between neighboring processors.
Instead, we map wires such that the most frequent compare exchange
operations occur between neighboring processors.
There are several ways to map the input wires into the mesh
processors.
Each processor is label by the wire that is mapped into it.
In this formula, in general wires that differ in the ith least significant bit
are mapped into processors that are 2[(i-1)/2] communication links away
* Mesh – row major shuffled mapping
The advantage of row major shuffled mapping is that perform
compare exchange operation reside on square subsections of the
mesh.
For every stage of bitonic sort (corresponding to wires that differ in
the least significant bit ) are neighbors.
total amount of communication performed by each processor = 7
A block of elements per processors
Mesh
Bubble sort and its variants
The sequential bubble sort algorithm compares and exchanges
adjacent elements in the sequence to be sorted.