Docsity

Multiprocessors, Thread-Level Parallelism - Advanced Computer Architecture - Lecture Slides, Slides of Computer Science

Partial preview of the text

Download Multiprocessors, Thread-Level Parallelism - Advanced Computer Architecture - Lecture Slides and more Slides Computer Science in PDF only on Docsity!

Chapter 6

Multiprocessors and Thread-Level

Parallelism

Introduction

  • When can the speed of uniprocessor not be improved

further?

  • Why multiprocessor?
    • It is a logical way to interconnecting a lot of uniprocessors to increase the performance.
    • No clear evidence shows that the architectural innovation to exploiting ILP will sustain.
    • There appears to be slow but steady progress on the major obstacle to wide spread use of parallel processors, namely, software.
  • This chapter focuses on multiprocessors with small to

medium number of processors (<= 128).

The Rise of the MIMD Machines

• Two factors

  • MIMDs offer flexibility
    • Can be used as single-user machines or as multiprogrammed machines.
  • MIMDs can be built on the cost/performance advantages of off-the-self microprocessors.

Two Classes of MIMD Machines

  • Centralized shared-memory architectures:
    • All processors share a single main memory. With small processor counts, the processors and memory are connected by a single bus.
    • Because there is a single main memory that has a symmetric relationship to all processors and a uniform access time from any processors, these multiprocessors are often called symmetric (shared-memory) multiprocessors(SMPs), and the style of architecture is called uniform memory access (UMA).
  • Physically distributed memory architectures:
    • Memories are distributed among the processors. It is a preferable architecture to support a large number of processors that require a large amount of memory bandwidth.

Models for Communication and Memory

Architecture

  • Two architectural approaches that differ in the method used for communicating data among processors: - Distributed shared-memory (DSM or NUMA) - The physically separate memories can be addressed as one logically shared address space, meaning that a memory reference can be made by any processor to any memory location. » Key features: (1). The address space is shared. (2). Shared-memory does not mean that there is a single centralized memory. - Multicomputer architecture - The address space can consist of multiple private address spaces that are logically disjoint and can not be addressed by a remote processor. Therefore, the same physical address on two different processors refers to two different locations in two different memories.

Communication Mechanisms

  • For a machine with a shared address space, that

address space can be used to communicate data implicitly via load and store operations.

  • For a machine with multiple address spaces,

communication of data is done by explicitly passing messages among the processors.

Advantages of Shared-Memory

Communication

  • Compatibility with the well-understood mechanism in

use in centralized multiprocessors.

  • Ease of programming when the communication

patterns among processors are complex.

  • The ability to focus attention only on those accesses

that are performance critical.

  • Lower overhead for communication and better use of

bandwidth when communicating small items.

  • The ability to use hardware-controlled caching to

reduce the frequency of remote communication by

supporting automatic caching of all data, both shared

and private.

Advantages of Message-Passing

Communication

  • Advantages
    • The hardware can be simpler.
    • Communication is explicit, forcing programmers and compilers to pay attention to communication.
    • Explicit communication enables programmer to focus on this costly aspect of parallel computation.
    • Synchronization is naturally associated with sending messages and thus reduces possibility for errors.
    • It makes it easier to use sender-initiated communication.
  • Comments
    • Usually, message passing communication is employed by multicomputer to pass shared data. And shared-memory communication is employed by distributed-shared memory architecture to pass shared data.

Characteristics of Application Domains

  • Three additional performance-critical

characteristics:

  • load balance,
  • synchronization, and
  • sensitivity to memory latency
  • Need three different domains of workloads
  • Commercial workload
  • Multiprogramming and OS workload
  • Scientific or technical applications

Commercial Workload

• An online transactions workload (OLTP)

consists of a set of client processes that

generate requests and a set of servers that

handle them.

• A decision support system (DSS) workload

consists of only 6 queries.

• A web index search (AltaVista) benchmark.

What Is Multiprocessor Cache Coherence

Problem? (2)

  • Informally, a memory system is coherent if any read of a data item returns the most recently written value of that data item. But this is a vague definition.
  • Formally, the definition should contain two different aspects of memory system behavior. These two aspects are - Coherence : Defines what value can be returned by a read. - Consistency : Determines when a written value is returned by a read.

What Is Multiprocessor Cache Coherence

Problem? (3)

  • A memory system is coherent if
    • If processor.P(write, loc_X) followed by processor.P(read, loc_X), and no writes of X in between the two accesses by another processor, then always returns the value written by processor P.
    • If processor.Q(write, loc_X) followed by processor.P(read, loc_X), and the read and write are separated sufficiently and no writes of X in between the two accesses, then return the value written by Q.
    • Writes to the same location are serialized: Two writes to the same location by any two processors are seen in the same order by all processors.
  • Consistency is complex because, for example, we cannot

require that a read of X instantaneously see the value

written for X by some other processor.

Two Classes of Protocols

  • Directory based
    • The sharing status of a block of physical memory is kept in just one location, called directory.
  • Snooping
    • Every cache that has a copy of the data from a block of physical memory also has a copy of the sharing status of the block, and no centralized state is kept. All cache controllers monitor or snoop on the shared bus to determine whether or not they have a copy that is requested on the bus. Popular with multiprocessors using microprocessors.

Snooping Protocols

  • Write invalidate protocol (WIP)
    • For a write, the processor is required to have exclusive access to a data item before it writes that item.
    • When the write occurs, all other cached copies of the item are invalidated.
  • Write update (write broadcast) protocol (WUP)
    • Update all the cached copies of a data item when that item is written.
    • All other later accesses to an invalidated result in a miss.