INTEL CONFIDENTIAL OpenMP for Task Decomposition Introduction to Parallel Programming – Part 8.

Slides:



Advertisements
Similar presentations
Implementing Task Decompositions Intel Software College Introduction to Parallel Programming – Part 5.
Advertisements

Analyzing Parallel Performance Intel Software College Introduction to Parallel Programming – Part 6.
Confronting Race Conditions Intel Software College Introduction to Parallel Programming – Part 4.
Shared-Memory Model and Threads Intel Software College Introduction to Parallel Programming – Part 2.
Improving Parallel Performance Intel Software College Introduction to Parallel Programming – Part 7.
Implementing Domain Decompositions Intel Software College Introduction to Parallel Programming – Part 3.
OpenMP.
Intel Software College Tuning Threading Code with Intel® Thread Profiler for Explicit Threads.
INTEL CONFIDENTIAL Implementing a Task Decomposition Introduction to Parallel Programming – Part 9.
Introduction to touchdevelop actions aka methods/functions/procedures Disclaimer: This document is provided “as-is”. Information and views expressed in.
INTEL CONFIDENTIAL Threading for Performance with Intel® Threading Building Blocks Session:
Parallel Programming – Barriers, Locks, and Continued Discussion of Parallel Decomposition David Monismith Jan. 27, 2015 Based upon notes from the LLNL.
Introduction to Openmp & openACC
NewsFlash!! Earth Simulator no longer #1. In slightly less earthshaking news… Homework #1 due date postponed to 10/11.
Starting Parallel Algorithm Design David Monismith Based on notes from Introduction to Parallel Programming 2 nd Edition by Grama, Gupta, Karypis, and.
INTEL CONFIDENTIAL Improving Parallel Performance Introduction to Parallel Programming – Part 11.
Open[M]ulti[P]rocessing Pthreads: Programmer explicitly define thread behavior openMP: Compiler and system defines thread behavior Pthreads: Library independent.
INTEL CONFIDENTIAL Deadlock Introduction to Parallel Programming – Part 7.
PARALLEL PROGRAMMING WITH OPENMP Ing. Andrea Marongiu
1 Tuesday, November 07, 2006 “If anything can go wrong, it will.” -Murphy’s Law.
Computer Architecture II 1 Computer architecture II Programming: POSIX Threads OpenMP.
Programming with OpenMP* Intel Software College. Copyright © 2008, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or.
Dr. Muhammed Al-Mulhem 1ICS ICS 535 Design and Implementation of Programming Languages Part 1 OpenMP -Example ICS 535 Design and Implementation.
1 ITCS4145/5145, Parallel Programming B. Wilkinson Feb 21, 2012 Programming with Shared Memory Introduction to OpenMP.
A Very Short Introduction to OpenMP Basile Schaeli EPFL – I&C – LSP Vincent Keller EPFL – STI – LIN.
INTEL CONFIDENTIAL OpenMP for Domain Decomposition Introduction to Parallel Programming – Part 5.
INTEL CONFIDENTIAL Confronting Race Conditions Introduction to Parallel Programming – Part 6.
Threaded Programming Methodology Intel Software College.
INTEL CONFIDENTIAL Why Parallel? Why Now? Introduction to Parallel Programming – Part 1.
INTEL CONFIDENTIAL Reducing Parallel Overhead Introduction to Parallel Programming – Part 12.
INTEL CONFIDENTIAL Parallel Decomposition Methods Introduction to Parallel Programming – Part 2.
INTEL CONFIDENTIAL Finding Parallelism Introduction to Parallel Programming – Part 3.
SEC(R) 2008 Intel® Concurrent Collections for C++ - a model for parallel programming Nikolay Kurtov Software and Services.
10/04/2011CS4961 CS4961 Parallel Programming Lecture 12: Advanced Synchronization (Pthreads) Mary Hall October 4, 2011.
Programming Models using Windows* Threads Intel Software College.
Programming with OpenMP* Intel Software College. Copyright © 2006, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or.
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.
Uses some of the slides for chapters 7 and 9 accompanying “Introduction to Parallel Computing”, Addison Wesley, 2003.
2 3 Parent Thread Fork Join Start End Child Threads Compute time Overhead.
Recognizing Potential Parallelism Intel Software College Introduction to Parallel Programming – Part 1.
Multi-core Programming: Basic Concepts. Copyright © 2006, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered.
INTEL CONFIDENTIAL Predicting Parallel Performance Introduction to Parallel Programming – Part 10.
OpenMP – Introduction* *UHEM yaz çalıştayı notlarından derlenmiştir. (uhem.itu.edu.tr)
Programming with OpenMP* Intel Software College. Copyright © 2006, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or.
Work Replication with Parallel Region #pragma omp parallel { for ( j=0; j
Programming with POSIX* Threads Intel Software College.
Programs of the Intel® Education Initiative are funded by the Intel Foundation and Intel Corporation. Copyright © 2007, Intel Corporation. All rights reserved.
Correcting Threading Errors with Intel® Parallel Inspector.
10/02/2012CS4230 CS4230 Parallel Programming Lecture 11: Breaking Dependences and Task Parallel Algorithms Mary Hall October 2,
INTEL CONFIDENTIAL Shared Memory Considerations Introduction to Parallel Programming – Part 4.
Thinking in Parallel – Implementing In Code New Mexico Supercomputing Challenge in partnership with Intel Corp. and NM EPSCoR.
9/22/2011CS4961 CS4961 Parallel Programming Lecture 9: Task Parallelism in OpenMP Mary Hall September 22,
Threaded Programming Lecture 2: Introduction to OpenMP.
Uses some of the slides for chapters 7 and 9 accompanying “Introduction to Parallel Computing”, Addison Wesley, 2003.
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,
A Brief Introduction to Recursion. Recursion Recursive methods … –methods that call themselves! –They can only solve a base case –So, you divide a problem.
Special Topics in Computer Engineering OpenMP* Essentials * Open Multi-Processing.
Thinking in Parallel - Introduction New Mexico Supercomputing Challenge in partnership with Intel Corp. and NM EPSCoR.
Programming with OpenMP*” Part II Intel Software College.
Tuning Threaded Code with Intel® Parallel Amplifier.
递归算法的效率分析. When a function is called... A transfer of control occurs from the calling block to the code of the function --It is necessary that there be.
OpenMP – Part 2 * *UHEM yaz çalıştayı notlarından derlenmiştir. (uhem.itu.edu.tr)
OpenMP Lab Antonio Gómez-Iglesias Texas Advanced Computing Center.
SHARED MEMORY PROGRAMMING WITH OpenMP
Open[M]ulti[P]rocessing
Computer Engg, IIT(BHU)
Computer Science Department
ე ვ ი ო Ш Е Т И О А С Д Ф К Ж З В Н М W Y U I O S D Z X C V B N M
Presentation transcript:

INTEL CONFIDENTIAL OpenMP for Task Decomposition Introduction to Parallel Programming – Part 8

Copyright © 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. * Other brands and names are the property of their respective owners. Review & Objectives Previously: Defined deadlock and explained ways to prevent it At the end of this part you should be able to: Describe how the OpenMP task pragma is different from the for pragma Code a task decomposition solution with the OpenMP task construct 2

Copyright © 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. * Other brands and names are the property of their respective owners. Pragma: single Denotes block of code to be executed by only one thread First thread to arrive is chosen Implicit barrier at end 3 #pragma omp parallel { DoManyThings(); #pragma omp single { printf(“Many Things done\n”); } // threads wait here for single DoManyMoreThings(); }

Copyright © 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. * Other brands and names are the property of their respective owners. New Addition to OpenMP Tasks – Main change for OpenMP 3.0 Allows parallelization of irregular problems unbounded loops recursive algorithms producer/consumer 4

Copyright © 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. * Other brands and names are the property of their respective owners. What are tasks? Tasks are independent units of work Threads are assigned to perform the work of each task Tasks may be deferred Tasks may be executed immediately The runtime system decides which of the above Tasks are composed of: code to execute data environment internal control variables (ICV) 5 SerialParallel

Copyright © 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. * Other brands and names are the property of their respective owners. A Linked List Example node *p = head; while (p) { process(p); p = p->next; } 6 data next head data next data next data next data next

Copyright © 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. * Other brands and names are the property of their respective owners. A Linked List Example node *p = head; while (p) { process(p); p = p->next; } 7 data next head data next data next data next data next p

Copyright © 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. * Other brands and names are the property of their respective owners. A Linked List Example node *p = head; while (p) { process(p); p = p->next; } 8 data next head data next data next data next data next p

Copyright © 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. * Other brands and names are the property of their respective owners. A Linked List Example node *p = head; while (p) { process(p); p = p->next; } 9 data next head data next data next data next data next p

Copyright © 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. * Other brands and names are the property of their respective owners. A Linked List Example node *p = head; while (p) { process(p); p = p->next; } 10 data next head data next data next data next data next p

Copyright © 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. * Other brands and names are the property of their respective owners. A Linked List Example node *p = head; while (p) { process(p); p = p->next; } 11 data next head data next data next data next data next p

Copyright © 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. * Other brands and names are the property of their respective owners. A Linked List Example node *p = head; while (p) { process(p); p = p->next; } 12 data next head data next data next data next data next p

Copyright © 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. * Other brands and names are the property of their respective owners. Task Construct – Explicit Task View node *p = head; #pragma omp parallel { #pragma omp single while (p) { #pragma omp task process(p); p = p->next; } 13 A team of threads is forked at the omp parallel construct A single thread, T0, executes the while loop Each time T0 crosses the omp task construct it generates a new task Each task runs in a thread All tasks complete at the barrier at the end of the parallel region’s single construct

Copyright © 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. * Other brands and names are the property of their respective owners. A Linked List Example node *p = head; #pragma omp parallel { #pragma omp single while (p) { #pragma omp task process(p); p = p->next; } 14 data next head data next data next data next data next p

Copyright © 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. * Other brands and names are the property of their respective owners. A Linked List Example node *p = head; #pragma omp parallel { #pragma omp single while (p) { #pragma omp task process(p); p = p->next; } 15 data next head data next data next data next data next p process() p

Copyright © 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. * Other brands and names are the property of their respective owners. A Linked List Example node *p = head; #pragma omp parallel { #pragma omp single while (p) { #pragma omp task process(p); p = p->next; } 16 data next head data next data next data next data next p process() p process() p

Copyright © 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. * Other brands and names are the property of their respective owners. A Linked List Example node *p = head; #pragma omp parallel { #pragma omp single while (p) { #pragma omp task process(p); p = p->next; } 17 data next head data next data next data next data next p process() p

Copyright © 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. * Other brands and names are the property of their respective owners. A Linked List Example node *p = head; #pragma omp parallel { #pragma omp single while (p) { #pragma omp task process(p); p = p->next; } 18 data next head data next data next data next data next p process() p process() p

Copyright © 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. * Other brands and names are the property of their respective owners. A Linked List Example node *p = head; #pragma omp parallel { #pragma omp single while (p) { #pragma omp task process(p); p = p->next; } 19 data next head data next data next data next data next p process() p

Copyright © 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. * Other brands and names are the property of their respective owners. A Linked List Example node *p = head; #pragma omp parallel { #pragma omp single while (p) { #pragma omp task process(p); p = p->next; } 20 data next head data next data next data next data next p process() p process() p

Copyright © 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. * Other brands and names are the property of their respective owners. A Linked List Example node *p = head; #pragma omp parallel { #pragma omp single while (p) { #pragma omp task process(p); p = p->next; } 21 data next head data next data next data next data next p process() p

Copyright © 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. * Other brands and names are the property of their respective owners. A Linked List Example node *p = head; #pragma omp parallel { #pragma omp single while (p) { #pragma omp task process(p); p = p->next; } 22 data next head data next data next data next data next process() p process() p p

Copyright © 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. * Other brands and names are the property of their respective owners. A Linked List Example node *p = head; #pragma omp parallel { #pragma omp single while (p) { #pragma omp task process(p); p = p->next; } 23 data next head data next data next data next data next process() p p

Copyright © 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. * Other brands and names are the property of their respective owners. A Linked List Example node *p = head; #pragma omp parallel { #pragma omp single while (p) { #pragma omp task process(p); p = p->next; } 24 data next head data next data next data next data next p

Copyright © 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. * Other brands and names are the property of their respective owners. When are tasks gauranteed to be complete? Tasks are gauranteed to be complete: At thread or task barriers At the directive: #pragma omp barrier At the directive: #pragma omp taskwait 25

Copyright © 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. * Other brands and names are the property of their respective owners. Example: Naive Fibonacci Calculation Recursion typically used to calculate Fibonacci number Widely used as toy benchmark Easy to code Has unbalanced task graph 26 long SerialFib( long n ) { if( n < 2 ) return n; else return SerialFib(n-1) + SerialFib(n-2); }

Copyright © 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. * Other brands and names are the property of their respective owners. Example: Naive Fibonacci Calculation We can envision Fibonacci computation as a task graph 27 SerialFib(4) SerialFib(3) SerialFib(2) SerialFib(1) SerialFib(2) SerialFib(1) SerialFib(0) SerialFib(2) SerialFib(1) SerialFib(0) SerialFib(3) SerialFib(2) SerialFib(1) SerialFib(0) SerialFib(1) SerialFib(0)

Copyright © 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. * Other brands and names are the property of their respective owners. Fibonacci - Task Spawning Solution long ParallelFib(long n) { long sum; #pragma omp parallel { #pragma omp single FibTask(n,&sum); } return sum; } Write a helper function to set up parallel region Call FibTask() to do computation Use sum return parameter in FibTask() 28

Copyright © 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. * Other brands and names are the property of their respective owners. Fibonacci - Task Spawning Solution void FibTask(long n, long* sum) { if( n < CutOff ) { *sum = SerialFib(n); } else { long x, y; #pragma omp task FibTask(n-1,&x); #pragma omp task FibTask(n-2,&y); #pragma omp taskwait *sum = x+y; } Thread will first check the value of n against CutOff If the cutoff hasn’t been reached, the thread will create two new tasks One to compute the n-1 Fib value One to compute the n-2 Fib value The computed values for these tasks will be returned through the private variables x and y, respectively The #pragma omp taskwait is required to make sure that the values for x and y have been computed before they are added together into sum 29

Copyright © 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. * Other brands and names are the property of their respective owners. Fibonacci Task Solution Example 30 long x, y; FibTask(7,&x); FibTask(6,&y); FibTask(8,*sum) *sum = x + y;

Copyright © 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. * Other brands and names are the property of their respective owners. Fibonacci Task Solution Example 31 long x, y; FibTask(7,&x); FibTask(6,&y); FibTask(8,*sum) *sum = x + y; long x, y; FibTask(6,&x); FibTask(5,&y); FibTask(7,*sum) *sum = x + y;

Copyright © 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. * Other brands and names are the property of their respective owners. Fibonacci Task Solution Example 32 long x, y; FibTask(7,&x); FibTask(6,&y); FibTask(8,*sum) *sum = x + y; long x, y; FibTask(6,&x); FibTask(5,&y); FibTask(7,*sum) *sum = x + y; long x, y; FibTask(5,&x); FibTask(4,&y); FibTask(6,*sum) *sum = x + y;

Copyright © 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. * Other brands and names are the property of their respective owners. Fibonacci Task Solution Example 33 long x, y; FibTask(7,&x); FibTask(6,&y); FibTask(8,*sum) *sum = x + y; long x, y; FibTask(6,&x); FibTask(5,&y); FibTask(7,*sum) *sum = x + y; long x, y; FibTask(5,&x); FibTask(4,&y); FibTask(6,*sum) *sum = x + y; long x, y; FibTask(5,&x); FibTask(4,&y); FibTask(6,*sum) *sum = x + y;

Copyright © 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. * Other brands and names are the property of their respective owners. Fibonacci Task Solution Example 34 long x, y; FibTask(7,&x); FibTask(6,&y); FibTask(8,*sum) *sum = x + y; long x, y; FibTask(6,&x); FibTask(5,&y); FibTask(7,*sum) *sum = x + y; long x, y; FibTask(5,&x); FibTask(4,&y); FibTask(6,*sum) *sum = x + y; long x, y; FibTask(5,&x); FibTask(4,&y); FibTask(6,*sum) *sum = x + y;

Copyright © 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. * Other brands and names are the property of their respective owners. Fibonacci Task Solution Example 35 long x, y; FibTask(7,&x); FibTask(6,&y); FibTask(8,*sum) *sum = x + y; long x, y; FibTask(6,&x); FibTask(5,&y); FibTask(7,*sum) *sum = x + y; long x, y; FibTask(5,&x); FibTask(4,&y); FibTask(6,*sum) *sum = x + y; long x, y; FibTask(5,&x); FibTask(4,&y); FibTask(6,*sum) *sum = x + y;

Copyright © 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. * Other brands and names are the property of their respective owners. Fibonacci Task Solution Example 36 long x, y; FibTask(7,&x); FibTask(6,&y); FibTask(8,*sum) *sum = x + y; long x, y; FibTask(6,&x); FibTask(5,&y); FibTask(7,*sum) *sum = x + y; long x, y; FibTask(5,&x); FibTask(4,&y); FibTask(6,*sum) *sum = x + y; long x, y; FibTask(5,&x); FibTask(4,&y); FibTask(6,*sum) *sum = x + y;

Copyright © 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. * Other brands and names are the property of their respective owners. Fibonacci Task Solution Example 37 long x, y; FibTask(7,&x); FibTask(6,&y); FibTask(8,*sum) *sum = x + y; long x, y; FibTask(6,&x); FibTask(5,&y); FibTask(7,*sum) *sum = x + y; long x, y; FibTask(5,&x); FibTask(4,&y); FibTask(6,*sum) *sum = x + y;

Copyright © 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. * Other brands and names are the property of their respective owners. Fibonacci Task Solution Example 38 long x, y; FibTask(7,&x); FibTask(6,&y); FibTask(8,*sum) *sum = x + y; long x, y; FibTask(6,&x); FibTask(5,&y); FibTask(7,*sum) *sum = x + y; long x, y; FibTask(5,&x); FibTask(4,&y); FibTask(6,*sum) *sum = x + y;

Copyright © 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. * Other brands and names are the property of their respective owners. Fibonacci Task Solution Example 39 long x, y; FibTask(7,&x); FibTask(6,&y); FibTask(8,*sum) *sum = x + y; long x, y; FibTask(6,&x); FibTask(5,&y); FibTask(7,*sum) *sum = x + y;

Copyright © 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. * Other brands and names are the property of their respective owners. Fibonacci Task Solution Example 40 long x, y; FibTask(7,&x); FibTask(6,&y); FibTask(8,*sum) *sum = x + y;

Copyright © 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. * Other brands and names are the property of their respective owners. References OpenMP API Specification, 41