Introduction

Overview

Teaching: 10 min
Exercises: 15 min
Questions
  • What parallel computing is and why it is important?

  • How does a parallel program work?

Objectives
  • Explain differences between a sequential and a parallel program

  • Introduce types of parallelism available in modern computers

Parallel computing is the science of solving problems using multiple computer processors at the same time.

Why parallel computing?

Example applications

Here are just a few examples of how parallel computing is helping to accelerate research and solve new problems.

  1. Numeric weather prediction
    • Combining current observations and mathematical models to forecast the future state of the weather
  2. Computational astrophysics
    • Numerical relativity, magnetohydrodynamics, stellar and galactic magnetohydrodynamics
  3. Seismic data processing
    • Analyze seismic data to find oil and gas-bearing layers
  4. Commerce
    • Nearly every major aspect of today’s banking, from credit scoring to risk modelling to fraud detection, is GPU-accelerated.
  5. Pharmaceutical design
    • Uses parallel computing for running simulations of molecular dynamics
  6. Computational fluid dynamics, tidal wave simulations

Benefits of parallel computing:

Limitations and disadvantages:

Before you start your parallel computing project

In this course, we hope to give you the knowledge to make the right decisions on parallel computing projects.

How does a parallel program work?

Let us start by exploring how a sequential (non-parallel) program works.

Traditional sequential program

Parallel program

In parallel computing, individual instructions execute concurrently on different CPUs and/or computers.

Discussion exercise

Pretend it’s the days before electronic computers, and you have been assigned the task of computing the sum of 1,000 four-digit numbers as rapidly as possible. You hold in your hands a stack of 1,000 index cards, each containing a single number, and you are in charge of 1,000 accountants, each with a pencil. You may choose to use the services of any number of these accountants. The accountants are sitting at desks in a cavernous room. The desks are organized into 25 rows and 40 columns. Each accountant can pass cards to the four accountants nearest them— in front, in back, to the left, and to the right.

Discuss with your classmates:

  • How many accountants should we use?
  • How will we get the cards to right accountants?
  • How will we turn the subtotals generated by the active accountants into a grand total?
  • What should we do differently if there were 10,000 cards (but still 1,000 accountants)?

You do not need to arrive at a perfect plan. (Indeed, you don’t have enough information to devise a perfect plan!) But try to sketch a rough plan, figure out some ideas, talk about whether those ideas have merit or not, and think what other information you would want to carry this out this imaginary task.

(Adapted from Michael J. Quinn, “Parallel Programming in C with MPI and OpenMP”)

Key Points

  • Parallel computing is much better suited for modelling, simulating and understanding complex, real-world phenomena.

  • Modern computers have several levels of parallelism