Interconnect Technology and Computational Speed

Similar documents
4. Networks. in parallel computers. Advances in Computer Architecture

EE/CSCI 451: Parallel and Distributed Computation

Network-on-chip (NOC) Topologies

Lecture 12: Interconnection Networks. Topics: communication latency, centralized and decentralized switches, routing, deadlocks (Appendix E)

CS575 Parallel Processing

Scalability and Classifications

Interconnection Networks

Interconnection Network

Lecture: Interconnection Networks

INTERCONNECTION NETWORKS LECTURE 4

Lecture 2 Parallel Programming Platforms

Overview. Processor organizations Types of parallel machines. Real machines

Lecture 24: Interconnection Networks. Topics: topologies, routing, deadlocks, flow control

TDT Appendix E Interconnection Networks

Communication has significant impact on application performance. Interconnection networks therefore have a vital role in cluster systems.

Lecture 26: Interconnects. James C. Hoe Department of ECE Carnegie Mellon University

Lecture 13: Interconnection Networks. Topics: lots of background, recent innovations for power and performance

What is Parallel Computing?

Physical Organization of Parallel Platforms. Alexandre David

Chapter 4 NETWORK HARDWARE

Interconnection Networks: Topology. Prof. Natalie Enright Jerger

Parallel Systems Prof. James L. Frankel Harvard University. Version of 6:50 PM 4-Dec-2018 Copyright 2018, 2017 James L. Frankel. All rights reserved.

Chapter 9 Multiprocessors

BlueGene/L. Computer Science, University of Warwick. Source: IBM

Topologies. Maurizio Palesi. Maurizio Palesi 1

Non-Uniform Memory Access (NUMA) Architecture and Multicomputers

Non-Uniform Memory Access (NUMA) Architecture and Multicomputers

This chapter provides the background knowledge about Multistage. multistage interconnection networks are explained. The need, objectives, research

CSC630/CSC730: Parallel Computing

Topologies. Maurizio Palesi. Maurizio Palesi 1

Lecture 12: Interconnection Networks. Topics: dimension/arity, routing, deadlock, flow control

Interconnection Networks. Issues for Networks

Interconnection Network. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

Parallel Architectures

Non-Uniform Memory Access (NUMA) Architecture and Multicomputers

Lecture 16: On-Chip Networks. Topics: Cache networks, NoC basics

Advanced Parallel Architecture. Annalisa Massini /2017

VIII. Communication costs, routing mechanism, mapping techniques, cost-performance tradeoffs. April 6 th, 2009

Parallel Architectures

Interconnection Network

Lecture 22: Router Design

Networks. Distributed Systems. Philipp Kupferschmied. Universität Karlsruhe, System Architecture Group. May 6th, 2009

Module 16: Distributed System Structures

Networks: Routing, Deadlock, Flow Control, Switch Design, Case Studies. Admin

Module 17: "Interconnection Networks" Lecture 37: "Introduction to Routers" Interconnection Networks. Fundamentals. Latency and bandwidth

Multiprocessors and Thread Level Parallelism Chapter 4, Appendix H CS448. The Greed for Speed

Performance of Multihop Communications Using Logical Topologies on Optical Torus Networks

Parallel Computers. c R. Leduc

UNIT- 2 Physical Layer and Overview of PL Switching

BİL 542 Parallel Computing

Pipelined Computations

Multicomputer distributed system LECTURE 8

Network Properties, Scalability and Requirements For Parallel Processing. Communication assist (CA)

CH : 15 LOCAL AREA NETWORK OVERVIEW

Recall: The Routing problem: Local decisions. Recall: Multidimensional Meshes and Tori. Properties of Routing Algorithms

EE/CSCI 451: Parallel and Distributed Computation

Interconnection networks

Interconnection Networks

Lecture 15: PCM, Networks. Today: PCM wrap-up, projects discussion, on-chip networks background

Parallel Architecture. Sathish Vadhiyar

Network Properties, Scalability and Requirements For Parallel Processing. Communication assist (CA)

Different network topologies

SHARED MEMORY VS DISTRIBUTED MEMORY

CS 770G - Parallel Algorithms in Scientific Computing Parallel Architectures. May 7, 2001 Lecture 2

Blocking SEND/RECEIVE

MIMD Overview. Intel Paragon XP/S Overview. XP/S Usage. XP/S Nodes and Interconnection. ! Distributed-memory MIMD multicomputer

Lecture 18: Communication Models and Architectures: Interconnection Networks

Local Area Networks (LANs): Packets, Frames and Technologies Gail Hopkins. Part 3: Packet Switching and. Network Technologies.

Parallel Computer Architecture II

On Topology and Bisection Bandwidth of Hierarchical-ring Networks for Shared-memory Multiprocessors

Lecture 7: Parallel Processing

Outline: Connecting Many Computers

CS 258, Spring 99 David E. Culler Computer Science Division U.C. Berkeley Wide links, smaller routing delay Tremendous variation 3/19/99 CS258 S99 2

Understanding the Routing Requirements for FPGA Array Computing Platform. Hayden So EE228a Project Presentation Dec 2 nd, 2003

Routing Algorithms. Review

Chapter 3 : Topology basics

Lecture: Interconnection Networks. Topics: TM wrap-up, routing, deadlock, flow control, virtual channels

EE382 Processor Design. Illinois

CPS 303 High Performance Computing. Wensheng Shen Department of Computational Science SUNY Brockport

Introduction to Multiprocessors (Part I) Prof. Cristina Silvano Politecnico di Milano

UNIT-II OVERVIEW OF PHYSICAL LAYER SWITCHING & MULTIPLEXING

Lecture 28: Networks & Interconnect Architectural Issues Professor Randy H. Katz Computer Science 252 Spring 1996

MULTIPROCESSORS. Characteristics of Multiprocessors. Interconnection Structures. Interprocessor Arbitration

CS Parallel Algorithms in Scientific Computing

CMSC 611: Advanced. Interconnection Networks

2 Network Basics. types of communication service. how communication services are implemented. network performance measures. switching.

TDT4260/DT8803 COMPUTER ARCHITECTURE EXAM

Multiple Processor Systems. Lecture 15 Multiple Processor Systems. Multiprocessor Hardware (1) Multiprocessors. Multiprocessor Hardware (2)

Lecture 3: Flow-Control

Lecture 7: Flow Control - I

Communication Performance in Network-on-Chips

Model Questions and Answers on

Lecture: Transactional Memory, Networks. Topics: TM implementations, on-chip networks

Parallel Computing Platforms

Routing Algorithm. How do I know where a packet should go? Topology does NOT determine routing (e.g., many paths through torus)

Memory. From Chapter 3 of High Performance Computing. c R. Leduc

The Impact of Optics on HPC System Interconnects

Packet Switch Architecture

Packet Switch Architecture

Area Covered is small Area covered is large. Data transfer rate is high Data transfer rate is low

Transcription:

Interconnect Technology and Computational Speed From Chapter 1 of B. Wilkinson et al., PARAL- LEL PROGRAMMING. Techniques and Applications Using Networked Workstations and Parallel Computers, augmented by Chapter 12 of High Performance Computing c 2002-2004 R. Leduc

Interconnect Technology Strong similarity between high performance computing and high performance networking. Both share many technologies. Parallel processors can be thought of a variation on network of workstations. They just have faster interconnection. Processors need to communicate with one another to solve problems. Need some form of interconnect. Interconnect: Network connecting all parts of parallel system. c 2002-2004 R. Leduc 1

Interconnect Technology Cont. K. Dowd and C. Severance, High Performance Computing, 2nd Ed., O reilly, 1998. c 2002-2004 R. Leduc 2

Bus Architecture Easy to build and expand. Every component connected to bus. Can watch every operation on bus. Cache coherency easy to implement. Limitation: Only 1 CPU can use bus at time. Doesn t scale well. c 2002-2004 R. Leduc 3

Crossbar Like a network switch. Offers multiple paths between processors and memory. Offers overall better data throughput. Scales better than bus-based approach. Expensive to build, and costly as number of CPUs increases. Doesn t scale to 1000 of processors. Related: Completely connected network. For n nodes, there is a link to any other node. Requires n(n 1)/2 links. Only practical for small n. c 2002-2004 R. Leduc 4

Pipelined Multistep Communication More scalable means no longer able to directly connect to each node. May be several steps in path. At each step message encounters a router. Takes incoming message and forward it on appropriate link towards destination. If had to wait for entire message at each stop, would be slow. Also, need lots of memory at each router. Minimize latency by pipelining data. Dynamically establishes a temporary link through network. See Figure 12-4. c 2002-2004 R. Leduc 5

Pipelined Multistep Communication Eg. Figure 12-4 on following slide shows an example of a multistep communication network. Only a small part of the network is shown, a source and destination, and three routers. Each input of a router is hardwired to a compute node (first row of routers), or another router (2nd and 3rd row). The output of last row of router are hardwired to compute nodes. All links are bidirectional. Each router has four output ports, labelled 0 to 3, starting from the top. By selecting a specific output port on a router, you are selecting the router/node that is connected to that port. c 2002-2004 R. Leduc 6

Pipelined Multistep Comm. Eg. II For example, selecting output port 2 of router B, means the message should be sent to input port 3 of router C (see Figure 12-4). When the source node sends a message to the destination node, it starts transmitting data to router A. The first two bits of the message tell router A which port to transmit the message to. in our example, the first two bits would be: a 1 a 0 = 01 (output port 1 - the least significant bit of a number is sent first, just like in the parallelaccess shift register from your digital logic course). Router strips bits a 1 a 0 from the message and starts transmitting the rest of the message to router B via its output port 1. c 2002-2004 R. Leduc 7

Pipelined Multistep Comm. Eg. III The next two bits of the message tell router B which port to send the message to. In our example, the next two bits would be b 1 b 0 = 10. (output port two, thus router C). Router B strips off bits b 1 b 0, and starts transmitting the rest of the message via its output port 2. The next two bits of the message tell router C which port to send the message to. In our example, the next two bits would be c 1 c 0 = 11. (output port three, thus to destination node). c 2002-2004 R. Leduc 8

Pipelined Multistep Comm. Eg. IV Router C strips off bits c 1 c 0, and starts transmitting the rest of the message via its output port 3. It thus starts transmitting the main data part of message to destination. After the time to set up the links (bit c 1 arrived at router C), the remaining message time is the time to transmit the message over the last link due to the pipeline effect. c 2002-2004 R. Leduc 9

Pipelined Multistep Communication II K. Dowd and C. Severance, High Performance Computing, 2nd Ed., O reilly, 1998. c 2002-2004 R. Leduc 10

Multistage Interconnection Network A multistage interconnection network (MIN) is a network of small crossbars. Scales far better than a bus or crossbar. K. Dowd and C. Severance, High Performance Computing, 2nd Ed., O reilly, 1998. c 2002-2004 R. Leduc 11

Multistage Interconnection Network Cont. A 4x4 crossbar requires 1 step to communicate. The MIN in Fig 12-5 requires 2. Can minimize this by pipelining memory access. c 2002-2004 R. Leduc 12

Static Networks Common form for message-passing multicomputer. Have direct fixed physical links between nodes. An example would be a mesh network that we will look at soon. A crossbar interconnect is not a static network. Links may be bidirectional or 2 uni-directional links. May be transmitted serially or in parallel. c 2002-2004 R. Leduc 13

Network Criteria Network Bandwidth: Number of bits that can be transmitted in unit time (bits/sec). Network Latency: Time to make a message transfer through network. Communication Latency: Total time to send the message. Includes software overhead and interface delays. Message Latency: This is the total time to send a zero length message. In other words, just the software/hardware overhead in sending a message. Also called startup time. c 2002-2004 R. Leduc 14

Network Criteria Cont. Diameter: Minimum number of links between the two furthest apart nodes. Used to determine worst case delay. bisection Width: The number of links that must be cut to divide network in half. Can also provide lower bound for messages in parallel algorithm. c 2002-2004 R. Leduc 15

Bisection Width Eg. Assume network is 3 3 mesh (see diagram on board in class). Assume each link is serial and bi-directional. For our example, we have n numbers, thus we have n/2 numbers on each side of network (assuming uniformally distributed). We need to move each set of numbers to the other half of the network. For our network, the bisection width, w, is four. This determines the maximum number of paths that can be used to exchange information from one side of network to the other. c 2002-2004 R. Leduc 16

Bisection Width Eg. Cont. Let n = 16. This means we have n/2 = 8 numbers on each side of the network. To move one half of the numbers to the other half of network will require n/2 w messages phases. As links are bidirectional, can only transmit in one direction at a time. To swap both sets of numbers, will thus require n/2 w 2 = w n message phases. Substituting for n and w, we get n w = 16 4 = 4. For our example, we find that it would take 4 messages phases to swap the two sets of numbers. c 2002-2004 R. Leduc 17

Line/Ring A line is a row of nodes, with connections limited to adjacent nodes. Formed into a ring structure by connecting the two opposite ends. Applicable to certain types of computations. n node ring requires n links. Diameter, n 1 if links unidirectional. Diameter is n/2 if bidirectional. When not completely connected, a network needs a routing algorithm. c 2002-2004 R. Leduc 18

Mesh Networks Two dimensional mesh created by connecting node to its 4 nearest neighbors. See Figure 12-6. Assuming n (n number of nodes) is an integer, then we have a n n mesh. Diameter is 2( n 1) K. Dowd and C. Severance, High Performance Computing, 2nd Ed., O reilly, 1998. c 2002-2004 R. Leduc 19

Mesh Networks Cont. To move data through mesh, map Cartesian (x,y) route between two points. Like a MIN, first bits of message used to route. Bits stripped off, and rest of message sent on. Visualize as a worm passing though mesh. Where head goes, data trails after it. This technique called wormhole routing. c 2002-2004 R. Leduc 20

Torus Networks Variation of Mesh network. The unused ends of the mesh are wrapped around to the opposite end. Reduces worst case number of hops by 50%. Each node in an n n torus has four links, with 2n links in all. K. Dowd and C. Severance, High Performance Computing, 2nd Ed., O reilly, 1998. c 2002-2004 R. Leduc 21

Tree Networks For a binary tree network (see Figure 1.12), the first node is called the root. Each node has two links to the two nodes below. At j th level below root node, there are 2 j nodes. There are 2 j+1 1 nodes in the network, from the j th level and above. Such a tree is called a complete binary tree, as it is fully populated. Height of tree is number of links from root to lowest leaves. Useful for divide and conquer algorithms. c 2002-2004 R. Leduc 22

Root Links Processing element Figure 1.12 Tree structure. c 2002-2004 R. Leduc 23 Parallel Programming: Techniques and Applications using Networked Workstations and Parallel Computers Barry Wilkinson and Michael Allen Prentice Hall, 1998 12

Hypercubes Before wormhole routing, number of hops a message must pass through important. Want interconnect to minimize # of hops, but easy/cheap to build. Used n-dimensional hypercubes. Each node connects to one node in each of the n dimensions. With 4 processors, could build 2-cube. Number of nodes, N, is 2 n. A 3-cube, has 8 processors, and is an actual cube. Number of hops between any two nodes is n. Diameter is thus log 2 (N) = n. Bisection width is N/2. c 2002-2004 R. Leduc 24

Hypercubes Cont. Higher dimension cubes created by combining two lower dimension cubes (see 4-cube). Each node assigned a n-bit binary address. Each bit corresponds to a dimension. See Figure 1.13 Each node connects to nodes that differ by one bit. K. Dowd and C. Severance, High Performance Computing, 2nd Ed., O reilly, 1998. c 2002-2004 R. Leduc 25

110 111 100 101 010 011 000 001 Figure 1.13 Three-dimensional hypercube. c 2002-2004 R. Leduc 26 Parallel Programming: Techniques and Applications using Networked Workstations and Parallel Computers Barry Wilkinson and Michael Allen Prentice Hall, 1998 13

Hypercube Routing Has simple minimal distance deadlock-free routing algorithm. Called e-cube routing algorithm. Route from node S, with address s n 1 s n 2... s 0, to Node D, with address d n 1 d n 2... d 0. Each bit different represents a direction that must be traversed. Found by doing exclusive-or, R = S D, on bit pairs. Dimensions to travel are bits of R that are 1. At each stage of route, exclusive-or of current node and destination node made. Most significant (left-most bit) 1 bit used to choose next direction. c 2002-2004 R. Leduc 27

Embedding For static networks, embedding means mapping nodes of one type of network, onto nodes of another. For instance, a ring network (the embedded network), can be embedded in a torus (the embedding network). See Figure 1.15. Above called a perfect embedding. Each link in ring actually exists in torus. ie. didn t have to use extra node to make link. c 2002-2004 R. Leduc 28

Ring Figure 1.15 Embedding a ring onto a torus. c 2002-2004 R. Leduc 29 Parallel Programming: Techniques and Applications using Networked Workstations and Parallel Computers Barry Wilkinson and Michael Allen Prentice Hall, 1998 15

Embedding Cont. Can embed a mesh or torus in a hypercube. See 4x4 mesh example in Figure 1.16. Every node in mesh has an x and a y coordinate, labelled in a gray code. Each node connects to another node whose addresses differs by one bit (thus one link). c 2002-2004 R. Leduc 30

Nodal address 1011 10 11 01 00 x y 00 01 11 10 Figure 1.16 hypercube. Embedding a mesh into a c 2002-2004 R. Leduc 31 Parallel Programming: Techniques and Applications using Networked Workstations and Parallel Computers Barry Wilkinson and Michael Allen Prentice Hall, 1998 16

Embedding Tree Networks Dilation refers to quality of embedding. Dilation is maximum number of links in embedding network that correspond to one link in embedded network. Mapping a tree network into a mesh or hypercube usually doesn t result in a dilation of 1. In Figure 1.17, the dilation is two. c 2002-2004 R. Leduc 32

A Root A A A A A Figure 1.17 Embedding a tree into a mesh. c 2002-2004 R. Leduc 33 Parallel Programming: Techniques and Applications using Networked Workstations and Parallel Computers Barry Wilkinson and Michael Allen Prentice Hall, 1998 17

Communication Methods To get message from source to destination, often need to route through intermediate nodes. Two methods: Circuit Switching Packet Switching. With circuit switching, you establish path and maintain all links until entire message has passed through (ie. wormhole routing). c 2002-2004 R. Leduc 34

Packet Switching Message broken up into packets of data. Each has a source and destination address. Network has maximum size. If too large, must be broken down into multiple packets. Nodes have buffers to hold packet before retransmission. Called store-and-forward packet switching. High latency! Alternative is virtual cut-through. If outgoing link available, message is immediately transmitted and not stored in buffer. c 2002-2004 R. Leduc 35

Wormhole Routing for Packet Switching Alternative to normal store-and-forward routing: goal to reduce latency and size of buffers. In wormhole routing, message divided into smaller units called flits. Size is usually 1-2 bytes. Only head of message (first flit) is transmitted from source node to next node when link available. Following flits transmitted when links available. When head flit moves to next node, the next flit can move ahead. Requires a request/acknowledge system. See Figure 1.18 c 2002-2004 R. Leduc 36

Packet Head Movement Flit buffer Request/ Acknowledge signal(s) Figure 1.18 Distribution of flits. c 2002-2004 R. Leduc 37 Parallel Programming: Techniques and Applications using Networked Workstations and Parallel Computers Barry Wilkinson and Michael Allen Prentice Hall, 1998 18

Wormhole Routing for Packet Switching Cont. Necessary to reserve entire path for message as the flits are linked. Other packets can be interleaved along the same links. Approach requires less storage and has latency independent of path length. c 2002-2004 R. Leduc 38

Network Latency Comparison We will now evaluate the network latency for four different communication methods. Let B stand for bandwidth (bits/s), l be the number of links the message passes through, and L the message size in bits. For sending L bits over a single link, the transmission time is: L/B Circuit Switching: Let L c be the length (in bits) of control packet sent to establish path. Latency = ( L c B )l + ( L B ) Latency reduces to L/B if L c L c 2002-2004 R. Leduc 39

Network Latency Comparison Cont. Store and Forward: Latency = ( L B )l Virtual Cut Through: Let L h be the length (in bits) of header field of first packet of message. Latency = ( L h B )l + ( L B ) Latency reduces to L/B if L h L Wormhole Routing: Let L f be the length (in bits) of each flit. Latency = ( L f B )l + ( L B ) Latency reduces to L/B if L f L c 2002-2004 R. Leduc 40

Packet switching Network latency Wormhole routing Circuit switching Distance (number of nodes between source and destination) Figure 1.20 Network delay characteristics. c 2002-2004 R. Leduc 41 Parallel Programming: Techniques and Applications using Networked Workstations and Parallel Computers Barry Wilkinson and Michael Allen Prentice Hall, 1998 20

Deadlock Interconnection networks use routing algorithms to determine path. Can be adaptive; They can choose alternative paths depending on criteria - ie. local traffic Algorithm may deadlock or livelock. Livelock: When packet continually moves through network, but can never reach destination. Deadlock: When a packet is stuck at a node, and can go no further do to other packets. c 2002-2004 R. Leduc 42

Node 4 Node 3 Messages Node 1 Node 2 Figure 1.21 networks. Deadlock in store-and-forward c 2002-2004 R. Leduc 43 Parallel Programming: Techniques and Applications using Networked Workstations and Parallel Computers Barry Wilkinson and Michael Allen Prentice Hall, 1998 21

Deadlock Cont. A solution is to provide virtual channels, each with separate buffers. Physical links or channels or the actual links between nodes. Multiple virtual channels are associate with a physical channel, and time-multiplexed onto the physical channel. See Figure 1.22. c 2002-2004 R. Leduc 44

Virtual channel buffer Node Node Route Physical link Figure 1.22 Multiple virtual channels mapped onto a single physical channel. c 2002-2004 R. Leduc 45 Parallel Programming: Techniques and Applications using Networked Workstations and Parallel Computers Barry Wilkinson and Michael Allen Prentice Hall, 1998 22

Networked Computers as Multicomputer Platform Attractive alternative to expensive supercomputers. High performance PCs and workstations inexpensive and easily available. Latest processors can easily be added as they become available. Current software can be used or modified. Many networks of workstations already exist, and can be used. Commonly connected using Ethernet (10 Mbit/sec, 100 Mbit/sec (fast), or 1000 Mbit/sec (Gigabit)). c 2002-2004 R. Leduc 46

Networked Computers as Multicomputer Platform Cont. Originally, Ethernet was single cable connecting all workstations. Bus topology, with high latency. Other common networks used are ring structures (ie Token rings/fddi networks - see Figure 1.25) and star networks (See Figure 1.26). Point-to-Point communications have highest bandwidth. Created using switches. Examples: High Performance Parallel Interface (HIPPI), fast and Gigabit Ethernet, and fiber optics. Networks usually organized into subnetworks. May be mixed type. c 2002-2004 R. Leduc 47

Network Workstation/ file server Figure 1.25 Workstations Network of workstations connected via a ring. c 2002-2004 R. Leduc 48 Parallel Programming: Techniques and Applications using Networked Workstations and Parallel Computers Barry Wilkinson and Michael Allen Prentice Hall, 1998 25

Workstations Workstation/ file server Figure 1.26 Star connected network. c 2002-2004 R. Leduc 49 Parallel Programming: Techniques and Applications using Networked Workstations and Parallel Computers Barry Wilkinson and Michael Allen Prentice Hall, 1998 26

Networked Computers vs Static Linked Computers Networked workstations typically have higher latency, but more flexible communication. For static linked, want to map communicating processes onto nearby processors in the interconnect topology. Networked computers tend to be of mixed type and speed. Static linked usually has CPUs of the same type and speed. c 2002-2004 R. Leduc 50

Dedicated Programming Cluster Workstations on a private network. Dedicated to cluster tasks. Except for the cluster head, usually don t have keyboards, or monitors etc. Simplest/cheapest to use Ethernet hubs. Would prefer something higher performance and that responds better to simultaneous traffic. Collisions can be significantly reduced by multiple, overlapping, communication paths as in Figure 1.27. c 2002-2004 R. Leduc 51

Parallel programming cluster (a) Using specially designed adaptors (b) Using separate Ethernet interfaces Figure 1.27 Overlapping connectivity Ethernets. c 2002-2004 R. Leduc 52 Parallel Programming: Techniques and Applications using Networked Workstations and Parallel Computers Barry Wilkinson and Michael Allen Prentice Hall, 1998 27

Potential for Increased Speed No matter what form of parallel computer, must break computation into multiple processes (tasks) that can run simultaneously. Granularity describes the size of a process. Coarse Granularity: Each process has large number of instructions and takes a while to run. Fine Granularity: Process contains only a few instructions. Medium Granularity: Somewhere in between. Granularity can also be the amount of computation between communication or synchronization points. c 2002-2004 R. Leduc 53

Granularity Metric Want to find compromise between cost of process creation and communication, against how much we can parallelize. For message passing, want to reduce amount of intercomputer communication. As we divide problem, there s a point when the communication time dominates execution time. Following ratio can be used as granularity metric: Computation/communication ratio = Computation time Communication time = t comp t comm Want to maximize ratio, but still maintain sufficient parallelism. c 2002-2004 R. Leduc 54

Granularity Metric Example We have two computers connected by a network. Each CPU has clock period T, and the communication latency for the network is L. We examine the performance of the following task: Each process (1 per CPU) must process 10 commands. Each command takes 30 clock cycles to execute. Process 1 then sends a message to process 2, who then replies. For our system, T = 12.5ns, and L = 500us. t comp = 10 30 T = 10 30 12.5 10 9 s = 3.75 10 6 s t comm = 2 L = 2 500 10 6 s = 0.01s ratio = t comp t comm = 3.75 10 6 s 0.01s = 0.00375 NOTE: total execution time of task is: t comp + t comm c 2002-2004 R. Leduc 55

Granularity Metric Cont. Granularity related to number of processors. For domain decomposition (partitioning the data), the size of the per CPU data can be increased to improve ratio. For a fixed data size, could reduce number of CPUs used. Want to design a program where it is easy to vary granularity. c 2002-2004 R. Leduc 56

Speedup Factor Measure of performance improvement between a single processor and parallel computer is the speedup factor, S(n) (n the number of processors). S(n) = = t s t p Execution time using single CPU Execution time using n processors For theoretical analysis, can also express as computational steps. S(n) = Number of steps using single CPU Number of parallel steps using n processors c 2002-2004 R. Leduc 57

Speedup The maximum speedup factor due to parallelization is n with n processors. This is called linear speedup. For example: S(n) = t s t s /n = n Superlinear speedup is when S(n) > n. Unusual, and usually due to a suboptimal sequential algorithm or special features of the architecture which favor parallel programs. Normally, can t fully parallelize a program. Some part must be done serially. Will be periods when only one processor doing work, and others idle. See Figure 1.28. c 2002-2004 R. Leduc 58

Process 1 Process 2 Computing Process 3 Process 4 Slope indicating time to send message Waiting to send a message Message Time Figure 1.28 Space-time diagram of a message-passing program. c 2002-2004 R. Leduc 59 Parallel Programming: Techniques and Applications using Networked Workstations and Parallel Computers Barry Wilkinson and Michael Allen Prentice Hall, 1998 28

Overhead Overhead is the time delays that are added due to the parallelization. Factors that cause overhead and reduce speedup are: Periods when all processors are not doing useful work. Additional computations not in serial version. Communication time for sending messages. c 2002-2004 R. Leduc 60

Maximum Speedup Normally, there will always be some fraction of the program that must be performed serially. Let the serial fraction of the program be f; thus, 1 f is the fraction that can be parallelized. Assuming no overhead results when program divided into concurrent parts, then computation time with n processors is: t p = ft s + (1 f)t s /n See Figure 1.29. c 2002-2004 R. Leduc 61

t s ft s Serial section (1 f)t s Parallelizable sections (a) One processor (b) Multiple processors n processors t p (1 f)t s /n Figure 1.29 Parallelizing sequential problem Amdahl s law. c 2002-2004 R. Leduc 62 Parallel Programming: Techniques and Applications using Networked Workstations and Parallel Computers Barry Wilkinson and Michael Allen Prentice Hall, 1998 29

Maximum Speedup Cont. This gives us the equation below known as Amdahl s law. S(n) = t s ft s + (1 f)t s /n = n 1 + (n 1)f See Figure 1.30. Limit of speedup with infinite number of processors: S(n) n = 1 f c 2002-2004 R. Leduc 63

20 f = 0% 20 n = 256 Speedup factor, S(n) 16 12 8 f = 5% f = 10% Speedup factor, S(n) 16 12 8 4 f = 20% 4 n = 16 4 8 12 16 20 Number of processors, n (a) 0.2 0.4 0.6 0.8 1.0 Serial fraction, f (b) Figure 1.30 (a) Speedup against number of processors. (b) Speedup against serial fraction, f. c 2002-2004 R. Leduc 64 Parallel Programming: Techniques and Applications using Networked Workstations and Parallel Computers Barry Wilkinson and Michael Allen Prentice Hall, 1998 30

Efficiency The system efficiency, E, is defined as: E = = Execution time with single CPU Execution time with multiprocessor number of CPUs t s t p n Efficiency as a percentage is given by: E = S(n) n 100 % The processor-time product, or cost of a computation is: Cost = t p n = t sn S(n) = t s E c 2002-2004 R. Leduc 65

Scalability Has different meanings. Architecture or Hardware Scalability: A hardware design that permits system to be enlarged which results in increased performance. Usually, adding more processors means network must be increased. Means greater delay and contention thus lower efficiency. Algorithmic Scalability: Means parallel algorithm can handle increase in data with low and bounded increase in computational steps. One way to define problem size is the number of data elements to be processed. Problem: doubling data size doesn t necessarily mean doubling number of computation steps. c 2002-2004 R. Leduc 66

Scalability Cont. Alternative: equate problem size with number of steps in best sequential algorithm. Still, increasing number of data elements will mean increasing problem size. c 2002-2004 R. Leduc 67

Setting for Gustafson s Law Gustafson argued that Amdahl s law is not as limiting as it seems. Observed that a large multiprocessor means you can handle bigger problems. In practice, problem size is related to number of processors. Assume parallel processing time fixed, not problem size. Gustafson claimed that serial section doesn t increase as problem size increases. c 2002-2004 R. Leduc 68

Setting for Gustafson s Law Cont. Let s be the serial computation time. Let p be the time required to execute the parallel portion of the program on a single processor. Assume s + p is fixed. For convenience, we choose s + p = 1, so they represent fractions. We can then represent Amdahl s law as: S(n) = s + p s + p/n = 1 s + (1 s)/n c 2002-2004 R. Leduc 69

Gustafson s Law For Gustafson s scaled speedup factor, S s (n), he assumes the parallel execution is constant, and the serial time (t s ) changes. Again, we have s + p = 1. Execution time on single processor is now s + pn. This gives us: S s (n) = s + np s + p = s + np = n + (1 n)s c 2002-2004 R. Leduc 70

Gustafson s Law Cont. c 2002-2004 R. Leduc 71