0% found this document useful (0 votes)
11 views50 pages

Parallel Processing Techniques Explained

Chapter 8 discusses parallel processing, outlining various processor organizations such as SISD, SIMD, MISD, and MIMD, and their characteristics. It covers the architecture of symmetric multiprocessors (SMP), including advantages and disadvantages of bus organization, multiprocessor operating system design considerations, and cache coherence protocols. Additionally, it addresses multithreading, clusters, and nonuniform memory access (NUMA) as alternatives to SMP for enhancing performance and scalability in computing systems.

Uploaded by

layermunch
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)
11 views50 pages

Parallel Processing Techniques Explained

Chapter 8 discusses parallel processing, outlining various processor organizations such as SISD, SIMD, MISD, and MIMD, and their characteristics. It covers the architecture of symmetric multiprocessors (SMP), including advantages and disadvantages of bus organization, multiprocessor operating system design considerations, and cache coherence protocols. Additionally, it addresses multithreading, clusters, and nonuniform memory access (NUMA) as alternatives to SMP for enhancing performance and scalability in computing systems.

Uploaded by

layermunch
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

Chapter 8

PARALLEL PROCESSING
+
Multiple Processor Organization

 Single instruction, single data  Multiple instruction, single data


(SISD) stream (MISD) stream
 Single processor executes a  A sequence of data is transmitted
single instruction stream to to a set of processors, each of
operate on data stored in a single which executes a different
memory instruction sequence
 Uniprocessors fall into this  Not commercially implemented
category

 Single instruction, multiple data  Multiple instruction, multiple


(SIMD) stream data (MIMD) stream
 A single machine instruction  A set of processors
controls the simultaneous simultaneously execute different
execution of a number of instruction sequences on different
processing elements on a data sets
lockstep basis  SMPs, clusters and NUMA systems
 Vector and array processors fall fit this category
into this category
Figure 8.1
Figure 8.2
Symmetric Multiprocessor (SMP)

A stand alone computer with


the following characteristics:
Processors All System
share same processors controlled by
memory and share access integrated
I/O facilities to I/O All operating
Two or more devices processors system
• Processors are
similar connected by a • Either through can perform
• Provides
processors of bus or other same channels the same interaction
comparable internal or different functions between
capacity connection channels giving (hence processors and
• Memory access paths to same their programs
time is devices
“symmetric”) at job, task, file
approximately and data
the same for element levels
each processor
Multiprogramming
and
Multiprocessing

Figure 8.3
Figure 8.4
Symmetric Multiprocessor
Organization

Figure 8.5
+
The bus organization has several
attractive features:

 Simplicity
 Simplest approach to multiprocessor organization

 Flexibility
 Generally easy to expand the system by attaching more
processors to the bus

 Reliability
 The bus is essentially a passive medium and the failure of any
attached device should not cause failure of the whole system
+
Disadvantages of the bus organization:

 Main drawback is performance


 All memory references pass through the common bus
 Performance is limited by bus cycle time

 Each processor should have cache memory


 Reduces the number of bus accesses

 Leads to problems with cache coherence


 If a word is altered in one cache it could conceivably invalidate a
word in another cache
 To prevent this the other processors must be alerted that an
update has taken place
 Typically addressed in hardware rather than the operating system
+
Multiprocessor Operating System
Design Considerations
 Simultaneous concurrent processes
 OS routines need to be reentrant to allow several processors to execute the same IS code simultaneously
 OS tables and management structures must be managed properly to avoid deadlock or invalid operations

 Scheduling
 Any processor may perform scheduling so conflicts must be avoided
 Scheduler must assign ready processes to available processors

 Synchronization
 With multiple active processes having potential access to shared address spaces or I/O resources, care must be
taken to provide effective synchronization
 Synchronization is a facility that enforces mutual exclusion and event ordering

 Memory management
 In addition to dealing with all of the issues found on uniprocessor machines, the OS needs to exploit the available
hardware parallelism to achieve the best performance
 Paging mechanisms on different processors must be coordinated to enforce consistency when several processors
share a page or segment and to decide on page replacement

 Reliability and fault tolerance


 OS should provide graceful degradation in the face of processor failure
 Scheduler and other portions of the operating system must recognize the loss of a processor and restructure
accordingly
+
Cache Coherence
Software Solutions

 Attempt to avoid the need for additional hardware circuitry


and logic by relying on the compiler and operating system to
deal with the problem

 Attractive because the overhead of detecting potential


problems is transferred from run time to compile time, and
the design complexity is transferred from hardware to
software
 However, compile-time software approaches generally must make
conservative decisions, leading to inefficient cache utilization
+
Cache Coherence
Hardware-Based Solutions
 Generally referred to as cache coherence protocols

 These solutions provide dynamic recognition at run time of


potential inconsistency conditions

 Because the problem is only dealt with when it actually arises


there is more effective use of caches, leading to improved
performance over a software approach

 Approaches are transparent to the programmer and the


compiler, reducing the software development burden

 Can be divided into two categories:


 Directory protocols
 Snoopy protocols
Directory Protocols

Collect and Effective in large


maintain scale systems with
information about complex
copies of data in interconnection
cache schemes

Directory stored in Creates central


main memory bottleneck

Requests are Appropriate


checked against transfers are
directory performed
Snoopy Protocols
 Distribute the responsibility for maintaining cache coherence
among all of the cache controllers in a multiprocessor
 A cache must recognize when a line that it holds is shared with other
caches
 When updates are performed on a shared cache line, it must be
announced to other caches by a broadcast mechanism
 Each cache controller is able to “snoop” on the network to observe
these broadcast notifications and react accordingly

 Suited to bus-based multiprocessor because the shared bus


provides a simple means for broadcasting and snooping
 Care must be taken that the increased bus traffic required for
broadcasting and snooping does not cancel out the gains from the
use of local caches

 Two basic approaches have been explored:


 Write invalidate
 Write update (or write broadcast)
+
Write Invalidate

 Multiple readers, but only one writer at a time

 When a write is required, all other caches of the line are


invalidated

 Writing processor then has exclusive (cheap) access until


line is required by another processor

 Most widely used in commercial multiprocessor systems


such as the Pentium 4 and PowerPC

 State of every line is marked as modified, exclusive, shared


or invalid
 For this reason the write-invalidate protocol is called MESI
+
Write Update

 Can be multiple readers and writers

 When a processor wishes to update a shared line the word to


be updated is distributed to all others and caches containing
that line can update it

 Some systems use an adaptive mixture of both write-


invalidate and write-update mechanisms
+
MESI Protocol
To provide cache consistency on an SMP the data cache
supports a protocol known as MESI:

 Modified
 The line in the cache has been modified and is available only in
this cache

 Exclusive
 The line in the cache is the same as that in main memory and is
not present in any other cache

 Shared
 The line in the cache is the same as that in main memory and may
be present in another cache

 Invalid
 The line in the cache does not contain valid data
Table 8.1
MESI Cache Line States
MESI State Transition Diagram

Figure 8.6
+
Multithreading and Chip
Multiprocessors
 Processor performance can be measured by the rate at which it
executes instructions

 MIPS rate = f * IPC


 f = processor clock frequency, in MHz
 IPC = average instructions per cycle

 Increase performance by increasing clock frequency and


increasing instructions that complete during cycle

 Multithreading
 Allows for a high degree of instruction-level parallelism without
increasing circuit complexity or power consumption
 Instruction stream is divided into several smaller streams, known as
threads, that can be executed in parallel
Definitions of Threads
and Processes Thread in multithreaded
processors may or may not be
the same as the concept of
software threads in a
multiprogrammed operating
system

Thread is concerned with


Thread switch scheduling and execution,
whereas a process is
• The act of switching processor control
between threads within the same concerned with both
process scheduling/execution and
• Typically less costly than process resource and resource
switch ownership

Thread:
• Dispatchable unit of work within a Process:
process • An instance of program running on
• Includes processor context (which computer
includes the program counter and • Two key characteristics:
stack pointer) and data area for stack
• Resource ownership
• Executes sequentially and is
interruptible so that the processor can • Scheduling/execution
turn to another thread

Process switch
• Operation that switches the processor
from one process to another by saving all
the process control data, registers, and
other information for the first and
replacing them with the process
information for the second
Implicit and Explicit
Multithreading
 All commercial processors and most
experimental ones use explicit multithreading
 Concurrently execute instructions from different
explicit threads
 Interleave instructions from different threads on
shared pipelines or parallel execution on parallel
pipelines

 Implicit multithreading is concurrent execution


+ of multiple threads extracted from single
sequential program
 Implicit threads defined statically by compiler or
dynamically by hardware
+ Approaches to Explicit
Multithreading
 Interleaved  Blocked
 Fine-grained  Coarse-grained
 Processor deals with two or  Thread executed until event
more thread contexts at a causes delay
time  Effective on in-order
 Switching thread at each processor
clock cycle  Avoids pipeline stall
 If thread is blocked it is
skipped  Chip multiprocessing
 Processor is replicated on a
 Simultaneous (SMT) single chip
 Instructions are  Each processor handles
simultaneously issued from separate threads
multiple threads to  Advantage is that the
execution units of available logic area on a chip
superscalar processor is used effectively
+

Approaches to
Executing Multiple
Threads

Figure 8.7
+
Example Systems

Pentium 4 IBM Power5


 More recent models of the  Chip used in high-end
Pentium 4 use a multithreading PowerPC products
technique that Intel refers to as
hyperthreading  Combines chip
multiprocessing with SMT
 Approach is to use SMT with  Has two separate processors,
support for two threads each of which is a multithreaded
processor capable of supporting
 Thus the single multithreaded two threads concurrently using
processor is logically two SMT
processors  Designers found that having two
two-way SMT processors on a
single chip provided superior
performance to a single four-
way SMT processor
Power5 Instruction Data Flow

Figure 8.8
Clusters
 Alternative to SMP as an approach to providing
high performance and high availability

 Particularly attractive for server applications

 Defined as:
 A group of interconnected whole computers working
together as a unified computing resource that can
create the illusion of being one machine
 (The term whole computer means a system that can run
on its own, apart from the cluster)

 Each computer in a cluster is called a node


+  Benefits:
 Absolute scalability
 Incremental scalability
 High availability
 Superior price/performance
+

Cluster
Configurations

Figure 8.9
Table 8.2
Clustering Methods: Benefits and Limitations
+
Operating System Design Issues

 How failures are managed depends on the clustering method used

 Two approaches:
 Highly available clusters
 Fault tolerant clusters

 Failover
 The function of switching applications and data resources over from a failed system
to an alternative system in the cluster

 Failback
 Restoration of applications and data resources to the original system once it
has been fixed

 Load balancing
 Incremental scalability
 Automatically include new computers in scheduling
 Middleware needs to recognize that processes may switch between machines
Parallelizing Computation

Effective use of a cluster requires executing


software from a single application in parallel

Three approaches are:

Parallelizing complier Parallelized Parametric computing


• Determines at compile time application • Can be used if the essence of
which parts of an application • Application written from the the application is an
can be executed in parallel outset to run on a cluster and algorithm or program that
• These are then split off to be uses message passing to must be executed a large
assigned to different move data between cluster number of times, each time
computers in the cluster nodes with a different set of starting
conditions or parameters
Cluster Computer Architecture

Figure 8.10
Example
100-Gbps
Ethernet
Configuration
for Massive
Blade Server
Site

Figure 8.11
+
Clusters Compared to SMP
 Both provide a configuration with multiple processors to
support high demand applications
 Both solutions are available commercially

SMP Clustering
 Easier to manage and  Far superior in terms of
configure incremental and absolute
scalability
 Much closer to the original
single processor model for  Superior in terms of
which nearly all applications availability
are written
 All components of the system
 Less physical space and lower can readily be made highly
power consumption redundant

 Well established and stable


+
Nonuniform Memory Access
(NUMA)
 Alternative to SMP and clustering

 Uniform memory access (UMA)


 All processors have access to all parts of main memory using loads and stores
 Access time to all regions of memory is the same
 Access time to memory for different processors is the same

 Nonuniform memory access (NUMA)


 All processors have access to all parts of main memory using loads and stores
 Access time of processor differs depending on which region of main memory
is being accessed
 Different processors access different regions of memory at different speeds

 Cache-coherent NUMA (CC-NUMA)


 A NUMA system in which cache coherence is maintained among the caches of
the various processors
Motivation
SMP has practical limit to In clusters each node has its
number of processors that own private main memory
can be used • Applications do not see a large
• Bus traffic limits to between 16 and global memory
64 processors • Coherency is maintained by
software rather than hardware

Objective with NUMA is to


maintain a transparent
NUMA retains SMP flavor system wide memory while
while giving large scale permitting multiple
multiprocessing multiprocessor nodes, each
with its own bus or internal
interconnect system
+

CC-NUMA
Organization

Figure 8.12
+
NUMA Pros and Cons

 Main advantage of a CC-


NUMA system is that it can
deliver effective performance
at higher levels of parallelism  Does not transparently look
than SMP without requiring like an SMP
major software changes
 Software changes will be
 Bus traffic on any individual required to move an operating
node is limited to a demand system and applications from
that the bus can handle an SMP to a CC-NUMA system

 If many of the memory  Concern with availability


accesses are to remote nodes,
performance begins to break
down
+
Vector Computation

 There is a need for computers to solve mathematical problems of


physical processes in disciplines such as aerodynamics, seismology,
meteorology, and atomic, nuclear, and plasma physics

 Need for high precision and a program that repetitively performs


floating point arithmetic calculations on large arrays of numbers
 Most of these problems fall into the category known as continuous-field
simulation

 Supercomputers were developed to handle these types of problems


 However they have limited use and a limited market because of their price tag
 There is a constant demand to increase performance

 Array processor
 Designed to address the need for vector computation
 Configured as peripheral devices by both mainframe and minicomputer users
to run the vectorized portions of programs
Vector Addition Example

Figure 8.13
+

Matrix Multiplication
(C = A * B)

Figure 8.14
+
Approaches to
Vector
Computation

Figure 8.15
+

Pipelined Processing
of Floating-Point
Operations

Figure 8.16
A Taxonomy of
Computer Organizations

Figure 8.17
+

IBM 3090 with


Vector Facility

Figure 8.18
+
Alternative
Programs
for Vector
Calculation

Figure 8.19
+

Registers for the IBM


3090 Vector Facility

Figure 8.20
Table 8.3
IBM 3090 Vector Facility:
Arithmetic and Logical Instructions
+ Summary Parallel
Processing
Chapter 8
 Multithreading and chip multiprocessors
 Implicit and explicit multithreading
 Approaches to explicit multithreading
 Multiple processor organizations  Example systems
 Types of parallel processor systems
 Clusters
 Parallel organizations
 Cluster configurations
 Symmetric multiprocessors  Operating system design issues
 Cluster computer architecture
 Organization
 Blade servers
 Multiprocessor operating system
design considerations  Clusters compared to SMP

 Nonuniform memory access


 Cache coherence and the MESI
 Motivation
protocol
 Organization
 Software solutions
 NUMA Pros and cons
 Hardware solutions
 The MESI protocol  Vector computation
 Approaches to vector computation
 IBM 3090 vector facility

Common questions

Powered by AI

In multiprocessor environments, operating systems face complex scheduling and synchronization challenges. Scheduling must be handled such that any processor can perform it, avoiding conflicts by ensuring ready processes are efficiently assigned to available processors. Synchronization is critical due to multiple active processes potentially accessing shared resources simultaneously, necessitating mechanisms for mutual exclusion and event ordering. These environments also require the operating system routines to be reentrant, allowing multiple processors to execute the same code simultaneously without conflict. Effective memory management is further needed to exploit hardware parallelism and coordinate paging mechanisms to enforce consistency across processors .

The write-invalidate mechanism permits multiple readers but enforces only one writer at a time. When a cache line needs updating, all other caches' copies of that line are invalidated, allowing the writing processor exclusive access until another processor requires the line. It is labeled as the MESI protocol due to states each cache line can hold, such as Modified, Exclusive, Shared, or Invalid. In contrast, the write-update mechanism allows caches to update shared lines directly whenever an update is needed, distributing the updated data to all relevant caches. While this method can support multiple writers simultaneously, it often results in higher bus traffic. The write-invalidate approach is more prevalent in commercial multiprocessor systems, as seen in the Pentium 4 and PowerPC, due to its effectiveness in reducing bus usage .

Clustered computer systems have several advantages over SMP systems, including superior incremental and absolute scalability, better price/performance ratio, and high availability. Clusters can be configured to maintain high availability through methods like failover and load balancing. They are easier to manage and configure, aligning closely with the original single-processor model, making them ideal for applications that require server-like performance. However, unlike SMPs, clusters require more sophisticated software for task management and inter-node communication. SMPs are limited by the number of processors they can support efficiently due to bus traffic constraints, but they typically offer a consistent memory access time across all processors, making them easier to program for some applications .

Clusters provide high availability and scalability by integrating multiple interconnected complete systems, or nodes, to operate as a unified computing resource. This configuration allows them to sustain high performance and remain operational even if individual nodes fail. High availability is achieved through mechanisms like failover, where resources switch from a failed node to an operative one, and load balancing, where tasks are distributed optimally across nodes. Furthermore, clusters allow for incremental scalability, enabling administrators to seamlessly add new nodes as the workload increases, maintaining efficient performance and resource utilization. This scalability is bolstered by middleware that accommodates dynamic node addition and resource scheduling .

Snoopy and directory protocols are two primary methods for maintaining cache coherence. Snoopy protocols distribute the responsibility of cache coherence among all cache controllers in a multiprocessor system. Caches "snoop" on a shared bus to detect and react to broadcast notifications about cache line updates, benefiting from simple broadcasting but potentially increasing bus traffic. They are well-suited for bus-based multiprocessors due to the simplicity provided by the shared bus structure. Directory protocols, conversely, maintain a centralized directory in main memory to track all copies of a data block stored in caches. This approach is effective in large systems with complex interconnections but can create a central bottleneck. Directory protocols excel in larger systems where snooping could be inefficient due to the bus complexity .

In an SMP environment, managing cache coherence is challenging due to the problems of cache incoherence when a word is altered in one cache, potentially invalidating a word in another cache. This issue is commonly addressed at the hardware level rather than in the operating system. Protocols such as the MESI (Modified, Exclusive, Shared, Invalid) are utilized to maintain cache coherence. The MESI protocol categorizes cache lines with different states to ensure that updates are synchronized across all caches. It supports mechanisms like write-invalidate and write-update protocols, with the snoopy and directory protocols being prevalent methods to dynamically handle inconsistencies when they arise, reducing the software development burden .

NUMA systems address the scalability limits of SMP systems by providing each processor with access to all parts of main memory, yet with varying access times depending on the memory region. This setup reduces the bottleneck associated with bus traffic in SMPs, allowing for higher levels of parallelism. NUMA retains the SMP advantage of a transparent system-wide memory appearance while allowing for larger-scale multiprocessing. Unlike SMP, where each processor accesses the same memory at roughly the same speed, NUMA can effectively handle more processors since traffic is distributed over different nodes, thereby improving scalability and maintaining efficient performance at higher processor counts .

Although NUMA systems maintain a broad architectural similarity to SMP systems by providing a unified view of memory access, they differ in access time variability due to their non-uniform memory access structure. Unlike SMPs, where any processor's memory access time remains consistent, NUMA systems incur differential access times based on the memory region accessed. This requirement means that applications and operating systems optimized for the uniform access of SMPs may not inherently perform well under NUMA's architecture. As a result, both OS and applications need modifications to efficiently handle variable access speeds and potentially optimize for local versus remote memory access .

Parallel processing systems are categorized into four main types: SISD, SIMD, MISD, and MIMD. SISD (Single Instruction, Single Data) involves a single processor executing a single instruction stream to operate on data stored in a single memory. SIMD (Single Instruction, Multiple Data) involves a single machine instruction controlling the simultaneous execution of multiple processing elements. MISD (Multiple Instruction, Single Data) had data transmitted to a set of processors, each executing different instruction sequences; however, this is not commercially implemented. MIMD (Multiple Instruction, Multiple Data) involves a set of processors that simultaneously execute different instruction sequences on different data sets, with SMPs, clusters, and NUMA systems fitting this category .

Explicit multithreading involves the concurrent execution of instructions from different explicitly defined threads, with techniques such as interleaved, simultaneous (SMT), or blocked multithreading. It is the approach used by most commercial processors, enhancing instruction-level parallelism without significantly increasing circuit complexity or power consumption. Implicit multithreading, on the other hand, involves concurrently executing multiple threads extracted from a single sequential program, defined statically by a compiler or dynamically by hardware. The implicit approach can improve performance by better utilizing existing hardware capability but often requires sophisticated compiler and hardware support .

You might also like