Table of Contents

  1. Abstract
    1. Parallel Computing Overview
      1. What Is Parallel Computing?
      2. Why Use Parallel Computing?
      3. Who Is Using Parallel Computing?
    2. Concepts and Terminology
      1. von Neumann Computer Architecture
      2. Flynn’s Taxonomy
      3. Parallel Computing Terminology
      4. Potential Benefits, Limits and Costs of Parallel Programming
    3. Parallel Computer Memory Architectures
      1. Shared Memory
      2. Distributed Memory
      3. Hybrid Distributed-Shared Memory
    4. Parallel Programming Models
      1. Shared Memory Model
      2. Threads Model
      3. Distributed Memory / Message Passing Model
      4. Data Parallel Model
      5. Hybrid Model
      6. SPMD and MPMP
    5. Designing Parallel Programs
      1. Automatic vs. Manual Parallelization
      2. Understand the Problem and the Program
      3. Partitioning
      4. Communications
      5. Synchronization
      6. Data Dependencies
      7. Load Balancing
      8. Granularity
      9. I/O
      10. Debugging
      11. Performance Analysis and Tuning
    6. Parallel Examples
      1. Array Processing
      2. PI Calculation
      3. Simple Heat Equation
      4. 1-D Wave Equation
    7. References and More Information

Abstract

This is a tutorial in the "Livermore Computing Getting Started" series of workshops. It is intended to provide only a brief overview of the extensive and broad topic of Parallel Computing, as a lead-in for the tutorials that follow it. The  covers the very basics of parallel computing, and is intended for someone who is just becoming acquainted with the subject and who is planning to attend one or more of the other tutorials in this workshop. It is not intended to cover Parallel Programming in depth, as this would require significantly more time. The tutorial begins with a discussion on parallel computing - what it is and how it's used, followed by a discussion on concepts and terminology associated with parallel computing. The topics of parallel memory architectures and programming models are then explored. These topics are followed by a series of practical discussions on a number of the complex issues related to designing and running parallel programs. The tutorial concludes with several examples of how to parallelize several simple problems. References are included for further self-study.

Overview

What Is Parallel Computing?

Serial Computing

Traditionally, software has been written for serial computation:

  • A problem is broken into a discrete series of instructions
  • Instructions are executed sequentially one after another
  • Executed on a single processor
  • Only one instruction may execute at any moment in time
Serial computing generic example

For example:

Serial computing example of processing payroll

Parallel Computing

In the simplest sense, parallel computing is the simultaneous use of multiple compute resources to solve a computational problem:

  • A problem is broken into discrete parts that can be solved concurrently
  • Each part is further broken down to a series of instructions
  • Instructions from each part execute simultaneously on different processors
  • An overall control/coordination mechanism is employed
Parallel computing generic example

For example:

Parallel computing example of processing payroll
  • The computational problem should be able to:
    • Be broken apart into discrete pieces of work that can be solved simultaneously;
    • Execute multiple program instructions at any moment in time;
    • Be solved in less time with multiple compute resources than with a single compute resource.
  • The compute resources are typically:
    • A single computer with multiple processors/cores
    • An arbitrary number of such computers connected by a network

Parallel Computers

  • Virtually all stand-alone computers today are parallel from a hardware perspective:
    • Multiple functional units (L1 cache, L2 cache, branch, prefetch, decode, floating-point, graphics processing (GPU), integer, etc.)
    • Multiple execution units/cores
    • Multiple hardware threads
IBM BG/Q Compute Chip with 18 cores (PU) and 16 L2 Cache units (L2)
  • Networks connect multiple stand-alone computers (nodes) to make larger parallel computer clusters.
Network connections
  • For example, the schematic below shows a typical LLNL parallel computer cluster:
    • Each compute node is a multi-processor parallel computer in itself
    • Multiple compute nodes are networked together with an Infiniband network
    • Special purpose nodes, also multi-processor, are used for other purposes
Example of typical parallel computer cluster
  • The majority of the world's large parallel computers (supercomputers) are clusters of hardware produced by a handful of (mostly) well known vendors.
Source: Top500.org

Why Use Parallel Computing?

The Real World Is Complex

  • In the natural world, many complex, interrelated events are happening at the same time.
  • Modeling the real world most likely to benefit from having coordinated, multiple computing resources.
  • Compared to serial computing, parallel computing is much better suited for modeling, simulating and providing understanding of complex, real world phenomena.
  • For example, imagine modeling these serially:
Real world phenomena can be simulated with parallel computing
Real world phenomena can be simulated with parallel computing

Main Reasons for Using Parallel Programming

SAVE TIME AND/OR MONEY
  • In theory, throwing more resources at a task will shorten its time to completion, with potential cost savings.
  • Parallel computers can be built from cheap, commodity components.
Working in parallel shortens completion time
SOLVE LARGER / MORE COMPLEX PROBLEMS
  • Many problems are so large and/or complex that it is impractical or impossible to solve them using a serial program, especially given limited computer memory.
  • Example: "Grand Challenge Problems" (en.wikipedia.org/wiki/Grand_Challenge) requiring petaflops and petabytes of computing resources.
  • Example: Web search engines/databases processing millions of transactions every second
Parallel computing can solve increasingly complex problems
PROVIDE CONCURRENCY
  • A single compute resource can only do one thing at a time. Multiple compute resources can do many things simultaneously.
  • Example: Collaborative Networks provide a global venue where people from around the world can meet and conduct work "virtually."
Collaborative networks
TAKE ADVANTAGE OF NON-LOCAL RESOURCES
  • Using compute resources on a wide area network, or even the Internet when local compute resources are scarce or insufficient.
  • Commercial on-demand HPC cloud services, such as Amazon Web Services (AWS) or Microsoft Azure Cloud.

 

 

MAKE BETTER USE OF UNDERLYING PARALLEL HARDWARE
  • Modern computers, even laptops, are parallel in architecture with multiple processors/cores.
  • Parallel software is specifically intended for parallel hardware with multiple cores, threads, etc.
  • In most cases, serial programs run on modern computers "waste" potential computing power.
Parallel computing cores

The Future

  • During the past 20+ years, the trends indicated by ever faster networks, distributed systems, and multi-processor computer architectures (even at the desktop level) clearly show that parallelism is the future of computing.
  • In this same time period, there has been a greater than 500,000x increase in supercomputer performance, with no end currently in sight.
  • We are in the Exascale era
Source: Top500.org

Who Is Using Parallel Computing?

Science and Engineering

Historically, parallel computing has been considered to be "the high end of computing," and has been used to model difficult problems in many areas of science and engineering:

  • Atmosphere, Earth, Environment
  • Physics - applied, nuclear, particle, condensed matter, high pressure, fusion, photonics
  • Bioscience, Biotechnology, Genetics
  • Chemistry, Molecular Sciences
  • Geology, Seismology
  • Mechanical Engineering - from prosthetics to spacecraft
  • Electrical Engineering, Circuit Design, Microelectronics
  • Computer Science, Mathematics
  • Defense, Weapons
Parallel computing is key to simulating a range of complex physical phenomena

Industrial and Commercial

Today, commercial applications provide an equal or greater driving force in the development of faster computers. These applications require the processing of large amounts of data in sophisticated ways. For example:

  • "Big Data," databases, data mining
  • Artificial Intelligence (AI)
  • Oil exploration
  • Web search engines, web based business services
  • Medical imaging and diagnosis
  • Pharmaceutical design
  • Financial and economic modeling
  • Management of national and multi-national corporations
  • Advanced graphics and virtual reality, particularly in the entertainment industry
  • Networked video and multi-media technologies
  • Collaborative work environments
Parallel computing is used in many commercial applications

Global Applications

  • Parallel computing is now being used extensively around the world, in a wide variety of applications.
Source: Top500.org
Source: Top500.org
Source: Top500.org

Concepts and Terminology

von Neumann Computer Architecture

John von Neumann circa 1940s
(Source: LANL archives)
  • Named after the Hungarian mathematician John von Neumann who first authored the general requirements for an electronic computer in his 1945 papers.
  • Also known as "stored-program computer" - both program instructions and data are kept in electronic memory. Differs from earlier computers which were programmed through "hard wiring".
  • Since then, virtually all computers have followed this basic design:
Basic computing architecture
  • Comprised of four main components:
  1. Memory
  2. Control Unit
  3. Arithmetic Logic Unit
  4. Input/Output
  • Read/write, random access memory is used to store both program instructions and data
  • Program instructions are coded data which tell the computer to do something
  • Data is simply information to be used by the program
  • Control unit fetches instructions/data from memory, decodes the instructions and then sequentially coordinates operations to accomplish the programmed task.
  • Arithmetic Unit performs basic arithmetic operations
  • Input/Output is the interface to the human operator

Parallel computers still follow this basic design, just multiplied in units. The basic, fundamental architecture remains the same. More info on his other remarkable accomplishments: http://en.wikipedia.org/wiki/John_von_Neumann

Flynn's Classical Taxonomy

  • There are a number of different ways to classify parallel computers. Examples are available in the references.
  • One of the more widely used classifications, in use since 1966, is called Flynn's Taxonomy.
  • Flynn's taxonomy distinguishes multi-processor computer architectures according to how they can be classified along the two independent dimensions of Instruction Stream and Data Stream. Each of these dimensions can have only one of two possible states: Single or Multiple.
  • The matrix below defines the 4 possible classifications according to Flynn:
Flynn's taxonomy

Single Instruction, Single Data (SISD)

  • A serial (non-parallel) computer
  • Single Instruction: Only one instruction stream is being acted on by the CPU during any one clock cycle
  • Single Data: Only one data stream is being used as input during any one clock cycle
  • Deterministic execution
  • This is the oldest type of computer
  • Examples: older generation mainframes, minicomputers, workstations and single processor/core PCs.

Single Instruction, Multiple Data (SIMD)

  • A type of parallel computer
  • Single Instruction: All processing units execute the same instruction at any given clock cycle
  • Multiple Data: Each processing unit can operate on a different data element
  • Best suited for specialized problems characterized by a high degree of regularity, such as graphics/image processing.
  • Synchronous (lockstep) and deterministic execution
  • Two varieties: Processor Arrays and Vector Pipelines
  • Examples:
    • Processor Arrays: Thinking Machines CM-2, MasPar MP-1 & MP-2, ILLIAC IV
    • Vector Pipelines: IBM 9000, Cray X-MP, Y-MP & C90, Fujitsu VP, NEC SX-2, Hitachi S820, ETA10
  • Most modern computers have multiple cores with SIMD units and those with graphics processor units (GPUs) are capable of  executing SIMD instructions.