Docsity

MSBD5009 lecture 1 parallel computing, Lecture notes of Mathematics

Partial preview of the text

Download MSBD5009 lecture 1 parallel computing and more Lecture notes Mathematics in PDF only on Docsity!

Parallel Programming

Introduction to Parallel Computing Slides adapted from the lecture notes by Peter Pacheco

Roadmap

  • Why we need ever-increasing performance.
  • Why we’re building parallel systems.
  • Why we need to write parallel programs.
  • How do we write parallel programs?
  • Concurrent, parallel, distributed!

An intelligent solution

  • Instead of designing and building faster microprocessors, put multiple processors on a single integrated circuit.

Now it’s up to the programmers

  • Adding more processors doesn’t help much if programmers aren’t aware of them…
  • … or don’t know how to use them.
  • Serial programs don’t benefit from this approach (in most cases).

Climate modeling

Protein folding

Energy research

Data analysis

Problem

  • Denser transistors - > faster processors.
  • Faster processors - > increased power consumption.
  • Increased power consumption - > increased heat.
  • Increased heat - > unreliable processors.

Solution

  • Move away from single-core systems to multicore processors.
  • “core”: a processing unit ◼ Introducing parallelism!!!

Approaches to the serial problem

  • Rewrite serial programs so that they’re parallel.
  • Write translation programs that automatically convert serial programs into parallel programs. - This is very difficult to do. - Success has been limited.

More problems about translation

  • Some coding constructs can be recognized by an automatic program generator, and converted to a parallel construct.
  • However, it’s likely that the result will be a very inefficient program.
  • Sometimes the best parallel solution is to step back and devise an entirely new algorithm.

Example (cont.)

  • We have p cores, p much smaller than n.
  • Each core performs a partial sum of approximately n/p values. Each core uses its own private variables and executes this block of code independently of the other cores.

Example (cont.)

  • After each core completes execution of the code, a private variable my_sum contains the sum of the values computed by its calls to Compute_next_value.
  • Ex., 8 cores, n = 24, then the calls to Compute_next_value return: 1,4,3, 9,2,8, 5,1,1, 5,2,7, 2,5,0, 4,1,8, 6,5,1, 2,3,