OpenMP: An API for Writing Portable SMP Application Software
Parallel Computing
What
is it?
Parallel Computing:
Writing a parallel application.
Parallel Computing:
The
Hardware is in great shape.
Parallel Computing:
… but where is the software?
Solution: Effective Standards for parallel programming
OpenMP:
How is
OpenMP typically used?
OpenMP:
How do
threads interact?
OpenMP:
Some syntax
details to get us started
Exercise 1:
A
multi-threaded “Hello world” program
OpenMP: Some subtle details (don’t worry about these at first)
OpenMP: Work-Sharing Constructs
Work Sharing
Constructs
A motivating example
OpenMP For
constuct:
The schedule clause
OpenMP: Work-Sharing Constructs
OpenMP: Combined Parallel Work-Sharing Constructs
Exercise 2:
A
multi-threaded “pi” program
PI Program:
The
sequential program
OpenMP:
More
details: Scope of OpenMP constructs
Data Environment:
Default
storage attributes
Data Environment:
Example
storage attributes
Data Environment:
Changing
storage attributes
OpenMP:
Another data environment example
OpenMP:
Default
Clause Example
Exercise 3:
A
multi-threaded “pi” program
OpenMP: Some subtle details (don’t worry about these at first)
OpenMP: More subtle details (don’t worry about these at first)
OpenMP:
Implicit
synchronization
OpenMP: Some subtle details on directive nesting
Generating OpenMP Programs Automatically
The Basics
About
Parallelizing Compilers
Basic Compiler Transformations
Basic Compiler Transformations
Basic Compiler Transformations
Inspecting the Translated Program
Tuning Automatically-
Parallelized Code
Why Tuning Automatically-Parallelized Code?
Performance Tuning and Case Studies with Realistic Applications
Performance Tuning
Example 1: MDG
Performance Tuning
Example 2: ARC2D
Performance Tuning Example 3: TOMCATV
What Tools Did We Use for Performance Analysis and Tuning?
Guidelines for Fixing “Performance Bugs”
Case Study of a Large-Scale Application
Seismic:
Basic
Characteristics
Basic OpenMP Use:
Parallelization
Scheme
Basic OpenMP Use:
Data
Privatization
Basic OpenMP Use:
Synchronization
and Communication
OpenMP Issues:
Mixing
Fortran and C
OpenMP Issues:
Broadcast
Common Blocks
OpenMP Issues:
Multithreading
IO and malloc
OpenMP Issues:
Processor
Affinity
Race Conditions:
A
complicated solution
Exercise 4:
Race
conditions and the “pi” program
Navigating through the Danger Zones
Navigating through the Danger Zones
Portable Sequential Equivalence
Portable Sequential Equivalence
2 Forms of Sequential Equivalence
Strong Sequential Equivalence: rules
Strong Sequential Equivalence: example
Sequential Equivalence isn’t a Silver Bullet
OpenMP version 2.0:
Time line.
OpenMP 2.0:
Some key
items on “the list”
OpenMP 2.0:
Some key
items dropped from “the list”
Extra Slides
A
series of parallel pi programs
OpenMP PI Program:
Parallel Region example (SPMD Program)
OpenMP PI Program:
Work sharing construct
OpenMP PI Program:
private clause and a critical section