P ARALLEL P ROCESSING F INAL P RESENTATION CILK Eliran Ben Moshe Neriya Cohen.
-
Upload
megan-cannon -
Category
Documents
-
view
228 -
download
1
Transcript of P ARALLEL P ROCESSING F INAL P RESENTATION CILK Eliran Ben Moshe Neriya Cohen.
![Page 1: P ARALLEL P ROCESSING F INAL P RESENTATION CILK Eliran Ben Moshe Neriya Cohen.](https://reader035.fdocuments.us/reader035/viewer/2022081506/5697bf841a28abf838c86aa4/html5/thumbnails/1.jpg)
PARALLEL PROCESSING
FINAL PRESENTATION
CILKEliran Ben MosheNeriya Cohen
![Page 2: P ARALLEL P ROCESSING F INAL P RESENTATION CILK Eliran Ben Moshe Neriya Cohen.](https://reader035.fdocuments.us/reader035/viewer/2022081506/5697bf841a28abf838c86aa4/html5/thumbnails/2.jpg)
WHAT IS CILK? General-purpose programming
language designed for multithreaded parallel computing.
The C++ incarnation is called Cilk Plus.
The programmer should be responsible for exposing the parallelism, identifying elements that can safely be executed in parallel.
The run-time environment, particularly the scheduler, decides during execution how to actually divide the work between processors.
![Page 3: P ARALLEL P ROCESSING F INAL P RESENTATION CILK Eliran Ben Moshe Neriya Cohen.](https://reader035.fdocuments.us/reader035/viewer/2022081506/5697bf841a28abf838c86aa4/html5/thumbnails/3.jpg)
CILK- HOW IT BEGAN? The Cilk language has been developed since
1994 at the MIT Laboratory for Computer Science.
In July 2009, Intel Corporation acquired Cilk Arts, the Cilk++ technology and the Cilk trademark.
In 2010, Intel released a commercial implementation in its compilers combined with some data parallel constructs with the name Intel Cilk Plus.
![Page 4: P ARALLEL P ROCESSING F INAL P RESENTATION CILK Eliran Ben Moshe Neriya Cohen.](https://reader035.fdocuments.us/reader035/viewer/2022081506/5697bf841a28abf838c86aa4/html5/thumbnails/4.jpg)
CILK KEYWORDS
Spawn
Sync
Inlet
Abort
![Page 5: P ARALLEL P ROCESSING F INAL P RESENTATION CILK Eliran Ben Moshe Neriya Cohen.](https://reader035.fdocuments.us/reader035/viewer/2022081506/5697bf841a28abf838c86aa4/html5/thumbnails/5.jpg)
A SIMPLE EXAMPLE
int fib (int n) {if (n<2) return (n); else { int x,y; x = fib(n-1); y = fib(n-2); return (x+y); }}
int fib (int n) {if (n<2) return (n); else { int x,y; x = fib(n-1); y = fib(n-2); return (x+y); }}
cilk int fib (int n) { if (n<2) return (n); else { int x,y; x = spawn fib(n-1); y = spawn fib(n-2); sync; return (x+y); }}
cilk int fib (int n) { if (n<2) return (n); else { int x,y; x = spawn fib(n-1); y = spawn fib(n-2); sync; return (x+y); }}
![Page 6: P ARALLEL P ROCESSING F INAL P RESENTATION CILK Eliran Ben Moshe Neriya Cohen.](https://reader035.fdocuments.us/reader035/viewer/2022081506/5697bf841a28abf838c86aa4/html5/thumbnails/6.jpg)
![Page 7: P ARALLEL P ROCESSING F INAL P RESENTATION CILK Eliran Ben Moshe Neriya Cohen.](https://reader035.fdocuments.us/reader035/viewer/2022081506/5697bf841a28abf838c86aa4/html5/thumbnails/7.jpg)
![Page 8: P ARALLEL P ROCESSING F INAL P RESENTATION CILK Eliran Ben Moshe Neriya Cohen.](https://reader035.fdocuments.us/reader035/viewer/2022081506/5697bf841a28abf838c86aa4/html5/thumbnails/8.jpg)
![Page 9: P ARALLEL P ROCESSING F INAL P RESENTATION CILK Eliran Ben Moshe Neriya Cohen.](https://reader035.fdocuments.us/reader035/viewer/2022081506/5697bf841a28abf838c86aa4/html5/thumbnails/9.jpg)
![Page 10: P ARALLEL P ROCESSING F INAL P RESENTATION CILK Eliran Ben Moshe Neriya Cohen.](https://reader035.fdocuments.us/reader035/viewer/2022081506/5697bf841a28abf838c86aa4/html5/thumbnails/10.jpg)
![Page 11: P ARALLEL P ROCESSING F INAL P RESENTATION CILK Eliran Ben Moshe Neriya Cohen.](https://reader035.fdocuments.us/reader035/viewer/2022081506/5697bf841a28abf838c86aa4/html5/thumbnails/11.jpg)
WORK & SPAN Work ()- The total amount of processor time
required to complete the program is the sum of all the numbers.
Span (
![Page 12: P ARALLEL P ROCESSING F INAL P RESENTATION CILK Eliran Ben Moshe Neriya Cohen.](https://reader035.fdocuments.us/reader035/viewer/2022081506/5697bf841a28abf838c86aa4/html5/thumbnails/12.jpg)
PERFORMANCE
Parallelism - the average amount of work per step along the span.
![Page 13: P ARALLEL P ROCESSING F INAL P RESENTATION CILK Eliran Ben Moshe Neriya Cohen.](https://reader035.fdocuments.us/reader035/viewer/2022081506/5697bf841a28abf838c86aa4/html5/thumbnails/13.jpg)
STEALING
![Page 14: P ARALLEL P ROCESSING F INAL P RESENTATION CILK Eliran Ben Moshe Neriya Cohen.](https://reader035.fdocuments.us/reader035/viewer/2022081506/5697bf841a28abf838c86aa4/html5/thumbnails/14.jpg)
STEALING
![Page 15: P ARALLEL P ROCESSING F INAL P RESENTATION CILK Eliran Ben Moshe Neriya Cohen.](https://reader035.fdocuments.us/reader035/viewer/2022081506/5697bf841a28abf838c86aa4/html5/thumbnails/15.jpg)
EXAMPLE – QUICK SORT
![Page 16: P ARALLEL P ROCESSING F INAL P RESENTATION CILK Eliran Ben Moshe Neriya Cohen.](https://reader035.fdocuments.us/reader035/viewer/2022081506/5697bf841a28abf838c86aa4/html5/thumbnails/16.jpg)
![Page 17: P ARALLEL P ROCESSING F INAL P RESENTATION CILK Eliran Ben Moshe Neriya Cohen.](https://reader035.fdocuments.us/reader035/viewer/2022081506/5697bf841a28abf838c86aa4/html5/thumbnails/17.jpg)
![Page 18: P ARALLEL P ROCESSING F INAL P RESENTATION CILK Eliran Ben Moshe Neriya Cohen.](https://reader035.fdocuments.us/reader035/viewer/2022081506/5697bf841a28abf838c86aa4/html5/thumbnails/18.jpg)
SERIAL RECURSION
![Page 19: P ARALLEL P ROCESSING F INAL P RESENTATION CILK Eliran Ben Moshe Neriya Cohen.](https://reader035.fdocuments.us/reader035/viewer/2022081506/5697bf841a28abf838c86aa4/html5/thumbnails/19.jpg)
PARALLEL RECURSION
![Page 20: P ARALLEL P ROCESSING F INAL P RESENTATION CILK Eliran Ben Moshe Neriya Cohen.](https://reader035.fdocuments.us/reader035/viewer/2022081506/5697bf841a28abf838c86aa4/html5/thumbnails/20.jpg)