Download presentation
Presentation is loading. Please wait.
1
CMPS 5433 Programming Models
ENIAC – Circa 1945
2
Programming Models – Overview Section 1.5.8 - Appendices
CILK Plus (Appendix B) Thread Building Blocks (TBB) (Appendix C) Open MP Array Building Blocks (ArBB)
3
CILK Plus (Appendix B) Integrated with a C & C++ compiler; extends language with key words & array selection notation Parallel Cilk program is serial with keyword “annotations” designating allowable parallelism – not mandatory Strong guarantee of serial equivalence
4
CILK Plus (Appendix B) Integrated with a C & C++ compiler; extends language with key words & array selection notation Fork-Join: supports PP patterns & nesting Parallel Loops: regular PP Explicit Vectorization Hyperobjects: to support reduction Serial Semantics: if key words ignored AKA serial elision Efficient Load Balancing: via work-stealing
5
CILK Basics Original 2 Key words Asynchronous function call cilk_for
cilk_spawn cilk_sync Asynchronous function call Using cilk_spawn cilk_for Programmer must determine independence Manages granularity appropriately
6
Example cilk_spawn - Fibonacci
int fib (int n) { if (n<2) return n; else {int x,y; { x=fib(n-1); y=fin(n-2); return x+y; }} int fib (int n) { if (n<2) return n; else {int x,y; { x=cilk_spawn fib(n-1); y=fin(n-2); cilk_sync; return x+y; }} Parallel execution of 2 recursive calls
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.