SHARED MEMORY PROGRAMMING WITH OpenMP

Slides:



Advertisements
Similar presentations
Implementing Domain Decompositions Intel Software College Introduction to Parallel Programming – Part 3.
Advertisements

1 Storage Duration and Scope –Local and global variables Storage classes –automatic, static, external, register Todays Material.
OpenMP.
Dependence Precedence. Precedence & Dependence Can we execute a 1000 line program with 1000 processors in one step? What are the issues to deal with in.
NewsFlash!! Earth Simulator no longer #1. In slightly less earthshaking news… Homework #1 due date postponed to 10/11.
Open[M]ulti[P]rocessing Pthreads: Programmer explicitly define thread behavior openMP: Compiler and system defines thread behavior Pthreads: Library independent.
PARALLEL PROGRAMMING WITH OPENMP Ing. Andrea Marongiu
PARALLEL PROGRAMMING WITH OPENMP Ing. Andrea Marongiu
1 OpenMP—An API for Shared Memory Programming Slides are based on:
1 Tuesday, November 07, 2006 “If anything can go wrong, it will.” -Murphy’s Law.
OpenMP Andrew Williams References Chandra et al, Parallel Programming in OpenMP, Morgan Kaufmann Publishers 1999 OpenMP home:
Computer Architecture II 1 Computer architecture II Programming: POSIX Threads OpenMP.
Parallel Programming in C with MPI and OpenMP Michael J. Quinn.
1 Friday, November 10, 2006 “ Programs for sale: Fast, Reliable, Cheap: choose two.” -Anonymous.
1 ITCS4145/5145, Parallel Programming B. Wilkinson Feb 21, 2012 Programming with Shared Memory Introduction to OpenMP.
Parallel Programming in C with MPI and OpenMP
INTEL CONFIDENTIAL OpenMP for Domain Decomposition Introduction to Parallel Programming – Part 5.
INTEL CONFIDENTIAL Confronting Race Conditions Introduction to Parallel Programming – Part 6.
CS 470/570 Lecture 7 Dot Product Examples Odd-even transposition sort More OpenMP Directives.
– 1 – Basic Machine Independent Performance Optimizations Topics Load balancing (review, already discussed) In the context of OpenMP notation Performance.
Programming with Shared Memory Introduction to OpenMP
CS470/570 Lecture 5 Introduction to OpenMP Compute Pi example OpenMP directives and options.
1 Copyright © 2010, Elsevier Inc. All rights Reserved Chapter 5 Shared Memory Programming with OpenMP An Introduction to Parallel Programming Peter Pacheco.
Parallel Programming in Java with Shared Memory Directives.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Parallel Programming in C with MPI and OpenMP Michael J. Quinn.
Chapter 17 Shared-Memory Programming. Introduction OpenMP is an application programming interface (API) for parallel programming on multiprocessors. It.
Parallel Edge Detection Daniel Dobkin Asaf Nitzan.
ICOM 5995: Performance Instrumentation and Visualization for High Performance Computer Systems Lecture 7 October 16, 2002 Nayda G. Santiago.
ECE 1747 Parallel Programming Shared Memory: OpenMP Environment and Synchronization.
OpenMP Blue Waters Undergraduate Petascale Education Program May 29 – June
Lecture 8: OpenMP. Parallel Programming Models Parallel Programming Models: Data parallelism / Task parallelism Explicit parallelism / Implicit parallelism.
CS 838: Pervasive Parallelism Introduction to OpenMP Copyright 2005 Mark D. Hill University of Wisconsin-Madison Slides are derived from online references.
Work Replication with Parallel Region #pragma omp parallel { for ( j=0; j
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
OpenMP fundamentials Nikita Panov
Threaded Programming Lecture 4: Work sharing directives.
Parallel Programming 0024 Week 10 Thomas Gross Spring Semester 2010 May 20, 2010.
Shared Memory Parallelism - OpenMP Sathish Vadhiyar Credits/Sources: OpenMP C/C++ standard (openmp.org) OpenMP tutorial (
3/12/2013Computer Engg, IIT(BHU)1 OpenMP-1. OpenMP is a portable, multiprocessing API for shared memory computers OpenMP is not a “language” Instead,
Special Topics in Computer Engineering OpenMP* Essentials * Open Multi-Processing.
CPE779: More on OpenMP Based on slides by Laxmikant V. Kale and David Padua of the University of Illinois.
CPE779: Shared Memory and OpenMP Based on slides by Laxmikant V. Kale and David Padua of the University of Illinois.
OpenMP – Part 2 * *UHEM yaz çalıştayı notlarından derlenmiştir. (uhem.itu.edu.tr)
1 ITCS4145 Parallel Programming B. Wilkinson March 23, hybrid-abw.ppt Hybrid Parallel Programming Introduction.
B. Estrade, LSU – High Performance Computing Enablement Group OpenMP II B. Estrade.
Parallel Programming in C with MPI and OpenMP
Introduction to OpenMP
SHARED MEMORY PROGRAMMING WITH OpenMP
Shared Memory Parallelism - OpenMP
SHARED MEMORY PROGRAMMING WITH OpenMP
Parallel Programming in C with MPI and OpenMP
Shared-memory Programming
Loop Parallelism and OpenMP CS433 Spring 2001
Open[M]ulti[P]rocessing
Computer Engg, IIT(BHU)
Introduction to OpenMP
Shared-Memory Programming
OpenMP Quiz B. Wilkinson January 22, 2016.
Instructor’s Intent for this course
Introduction to High Performance Computing Lecture 20
Programming with Shared Memory Introduction to OpenMP
Questions Parallel Programming Shared memory performance issues
Introduction to OpenMP
CSCE569 Parallel Computing
Multithreading Why & How.
M4 and Parallel Programming
OpenMP Quiz.
Concurrency Platforms OpenMP and Cilk Plus
OpenMP Martin Kruliš.
Shared-Memory Paradigm & OpenMP
Presentation transcript:

SHARED MEMORY PROGRAMMING WITH OpenMP Functional Parallelism

Functional Parallelism To this point all of our focus has been on exploiting data parallelism OpenMP allows us to assign different threads to different portions of code (functional parallelism)

Functional Parallelism Example v = alpha(); w = beta(); x = gamma(v, w); y = delta(); printf ("%6.2f\n", epsilon(x,y)); May execute alpha, beta, and delta in parallel

parallel sections Pragma Precedes a block of k blocks of code that may be executed concurrently by k threads Syntax: #pragma omp parallel sections

section Pragma Precedes each block of code within the encompassing block preceded by the parallel sections pragma May be omitted for first parallel section after the parallel sections pragma Syntax: #pragma omp section

Example of parallel sections #pragma omp parallel sections { #pragma omp section /* Optional */ v = alpha(); #pragma omp section w = beta(); y = delta(); } x = gamma(v, w); printf ("%6.2f\n", epsilon(x,y));

Another Approach Execute alpha and beta in parallel. Execute gamma and delta in parallel.

sections Pragma Appears inside a parallel block of code Has same meaning as the parallel sections pragma If multiple sections pragmas inside one parallel block, may reduce fork/join costs

Use of sections Pragma #pragma omp parallel { #pragma omp sections v = alpha(); #pragma omp section w = beta(); } x = gamma(v, w); y = delta(); printf ("%6.2f\n", epsilon(x,y));