Presentation is loading. Please wait.

Presentation is loading. Please wait.

Software Group © 2006 IBM Corporation Compiler Technology Task, thread and processor — OpenMP 3.0 and beyond Guansong Zhang, IBM Toronto Lab.

Similar presentations


Presentation on theme: "Software Group © 2006 IBM Corporation Compiler Technology Task, thread and processor — OpenMP 3.0 and beyond Guansong Zhang, IBM Toronto Lab."— Presentation transcript:

1 Software Group © 2006 IBM Corporation Compiler Technology Task, thread and processor — OpenMP 3.0 and beyond Guansong Zhang, IBM Toronto Lab

2 Compiler technology 2 Overview  The purpose of the talk –Introducing the latest improvement on the OpenMP standard Task Still under discussion, don’t take the syntax –Considerations for the future OpenMP development Thread affinity

3 Compiler technology 3 The changing world  Hardware improvement –Development of the multicore system Soon we will have more processors than we know how to program with IBM to Build World's First Cell Broadband Engine Based Supercomputer Intel: Quad core to turbocharge chips Terra Soft to Build Cell-Based Super Out of PS3 Beta Iron  OpenMP Standard –C/C++ and Fortran standard are merged into 2.5  Other language committee –C++ memory model: atomic access

4 Compiler technology 4 More changes in the OpenMP world  New players –Microsoft just joined the OpenMP ARB …, and Visual C++® 2005 supports the full standard. OpenMP is also supported by the Xbox 360™ platform –GCC The GOMP project is developing an implementation of OpenMP for the C, C++, and Fortran 95 compilers in the GNU Compiler Collection

5 Compiler technology 5 Overview  The purpose of the talk –Introducing the latest improvement on the OpenMP standard Task Still under discussion, don’t take the syntax –Considerations for the future OpenMP development Thread affinity

6 Compiler technology 6 Workshare and task pool  What is a workshare

7 Compiler technology 7 Workshare and task pool (cont.)  What is a task  Not a workshare –But still “sharing/cooperating” between threads  Comparing with a workshare –Unit can be generated –Unit can wait for another generated unit

8 Compiler technology 8 Task examples RRecursive algorithm int fib(int n) { int x, y; if (n<2) return n; #pragma omp taskgroup { #pragma omp task common(x) x=fib(n-1); #pragma omp task common(y) y=fib(n-2); } return x+y; } PPointer chasing #pragma omp parallel { #pragma omp single { while(p) { #pragma omp task process(p) p=p->next; } } }

9 Compiler technology 9 Task schedule  More flexible scheduling –Can a task be multi-threaded? When a task is encountered, the thread always go for the new task  Advantage –The idea is to provide one more level of abstraction Task centric view Try to avoid thread starvation Potential cache reuse  Disadvantage –Threadprivate No threadprivate data –Thread id HPC users may need thread id to localize data access. –Locks Locks’ owner becomes confusing

10 Compiler technology 10 Overview  The purpose of the talk –Introducing the latest improvement on the OpenMP standard Task Still under discussion, don’t take the syntax –Considerations for the future OpenMP development Thread affinity

11 Compiler technology 11 Emerging architectures

12 Compiler technology 12 Performance number Stride 1 Stride 2

13 Compiler technology 13 Thread affinity  Nested parallelism Organize threads to multi levels (This is in previous OpenMP standard already)  Thread grouping Balancing the number of threads available and the parallelism in the code  Thread mapping Associate each OpenMP thread to physical/logical processors

14 Compiler technology 14 How to represent a thread group Environment VarExplicit indexDescriptor handle User interfaceNo touch for user code Simple data type; Possible multiple changes in the source. New internal type, allow centralized thread group programming Modularity (procedure calls, library functions) No supportPass level, CPU array and array size Pass group type var, which may be used as an execution context (MPI) Nested par (thread to thread affinity) Fixed in advance, no dynamic adjustment according to user input Specify number of threads at different levels Specify thread composition Mapping threadsImplementation defined Supported, through Virtual CPU numbers Supported, through omp_get_procs() Heterogeneous system No support (?)Supported, different kinds of CPU with same numbering scheme? Different groups

15 Compiler technology 15 What is for the future  Performance is still our goal –“OpenMP is about performance.” Quoted from NASA scientists  OpenMP needs to enlarge itself for the broader market –C/C++ will become more interesting –People like to see non numeric programs in OpenMP  Partition OpenMP interface as different layers –TASK, WORKSHARE vs. THREAD vs. PROC –MPI has more than 300 calls, most people will only use 6-8 –Keep the layered approach while we extending OpenMP ?

16 Compiler technology 16 Summary  Start a parallel region  Split into two nested parallel regions –This is the chance to bind threads to the right processors  Start a task region –For independent works E.g. game objects  Start a workshare –For computation intensive calculation E.g. graphic rendering

17 Compiler technology 17 Q&A


Download ppt "Software Group © 2006 IBM Corporation Compiler Technology Task, thread and processor — OpenMP 3.0 and beyond Guansong Zhang, IBM Toronto Lab."

Similar presentations


Ads by Google