MAPPING OF ONE MODEL INTO OTHER MODEL
Submitted by:-RATIKA AGARWALM.Tech.-CSE
• Relationship between two networksG(V,E) G’(V’,E’)
• Graph G, G’• Vertices V, V’• Edges E, E’
Embedding:
MAP
E E’
V V’
Process Mapping (Eg.- 2-d Mesh)
Underlying Architecture
Processes and their interactions
Mapping of Processes to nodes
G(V,E) G’(V’,E’)Communication structure of an algorithm differs
from the interconnection architecture of the intended parallel machine.
Number of processes required by the algorithm exceeds the number of processors available.
Need of Mapping:
Types of network topologies: (Continued..)
Linear Arrays
2-d Mesh
Binary Tree
Types of network topologies: (Hypercube)
0-d Hypercube
1-d Hypercube
2-d Hypercube
3-d Hypercube
4-d Hypercube
Mapping techniques for graphs:
Topology embedding:Embed a communication pattern into a given interconnection topology. Linear Array in a Hypercube . 2-D Mesh in a Hypercube. Linear Array in a 2-D Mesh. 2-D Mesh in a Linear Array.
And more…
Metrics used for Embedding:
DILATION
CONGESTION
EXPANSION
Expansion =No.of Nodes in V’ = |V’| / |V|No.of Nodes in V
Where ( |V|<|V’| )
Expansion
Congestion
Congestion of k: ‘k’ Es to one E’
k>1
Dilation
Dilation of k: One E to ‘k’ E’s.
MAPPING
Linear Array/Ring into Hypercube
Node ‘i’
Linear Array 2d nodes d-dimesional Hypercube
G(i, d) : Gray code of ith node of Array.
RGC : Binary Reflected Gray Code.
Node G(i,d)
MAP
G(i,x+1) G(i,x) for i < 2x
2x + G[ (2x+1 –1) -i, x] for i >= 2x
G(0,1) = 0G(1,1) = 1
• 2d = 23= 8, i.e., 8 nodes in ring and hypercube.
Example: Say d = 3
Node ‘i’ in Ring
NodeG(i, d) in
hypercube (x+1=3)
(x+1=2) (x+1=1)
G(0,1)=0
G(1,1)=1Binary
Notation
0 (000) G(0,3)= G(0,2)= G(0,1)= 0= 0 000
1 (001) G(1,3)= G(1,2)= G(1,1)= 1= 1 001
2 (010) G(2,3)= G(2,2)= 2+ G(1,1)= 2+1= 3 011
3 (011) G(3,3)= G(3,2)= 2+ G(0,1)= 2+0= 2 010
4 (100) G(4,3)= 22 +G(3,2)= 4+ 2+ G(0,1)= 4+2+0= 6 110
5 (101) G(5,3)= 22 +G(2,2)= 4+ 2+ G(1,1)= 4+2+1= 7 111
6 (110) G(6,3)= 22 +G(1,2)= 4+ G(1,1)= 4+1= 5 101
7 (111) G(7,3)= 22 +G(0,2)= 4+ G(0,1)= 4+0= 4 100
Gray Coding
0 0 0 0 00
1 0 1 0 01
1 1 0 11
1 0 0 10
1 10
1 11
1 01
1 00
1 bit RGC 2 bit RGC 3 bit RGC
G(0,1) = 0G(1,1) = 1
Congestion=1Dilation=1
<Mapped Model>
01234567
ALTERNATIVE METHOD
Gray Coding
0 0 0 0 00
1 0 1 0 01
1 1 0 11
1 0 0 10
1 10
1 11
1 01
1 00
1 bit RGC 2 bit RGC 3 bit RGC
ALTERNATIVE METHOD
G(0,1) = 0G(1,1) = 1
Congestion=1Dilation=1
<Mapped Model>
01234567
2-D Mesh into Hypercube
2r*2s nodes of Mesh (r+s) dimension Hypercube of 2r+s nodesMAP
Node (i, j) Node G(i, r) || G(j, s)
‘||’ is concatenation of two Gray codes
Wraparound Mesh
MAP
Mesh Node Hypercube Node
Binary Notation
(0,0) G(0,1)||G(0,2) 0||0 0||00 000
(0,1) G(0,1)||G(1,2) 0||1 0||01 001
(0,2) G(0,1)||G(2,2) 0||3 0||11 011
(0,3) G(0,1)||G(3,2) 0||2 0||10 010
(1,0) G(1,1)||G(0,2) 1||0 1||00 100
(1,1) G(1,1)||G(1,2) 1||1 1||01 101
(1,2) G(1,1)||G(2,2) 1||3 1||11 111
(1,3) G(1,1)||G(3,2) 1||2 1||10 110
Example for 2*4 mesh…
Dilation=Congestion =1
00 00
11 00
01 00
10 01
10 00
10 11
10 10
Same row of Mesh ‘r’ identical MSBs in mapped node Same column of Mesh ‘s’ identical LSBs in mapped node
Linear Array into 2-D Mesh
Congestion=1
16 node linear array 2-d Mesh MAP
Solid lines: links in arrayNormal lines: links in the mesh
2-D Mesh into Linear Array
Inversion of the previous mapping.
Congestion =5
Solid lines: links in arrayNormal lines: links in the mesh
Congestion =5
Congestion =5
Summary
Applications of Embedding: To minimize the communication overhead of a
parallel algorithm. Laying out circuits on chips.
Reasons for embedding: An algorithm can run on many architecture. Algorithm mapped on interconnection network to
achieve maximum parallelism.
THANK YOU