Presentation is loading. Please wait.

Presentation is loading. Please wait.

P ARALLEL P ROCESSING F INAL P RESENTATION CILK Eliran Ben Moshe Neriya Cohen.

Similar presentations


Presentation on theme: "P ARALLEL P ROCESSING F INAL P RESENTATION CILK Eliran Ben Moshe Neriya Cohen."— Presentation transcript:

1 P ARALLEL P ROCESSING F INAL P RESENTATION CILK Eliran Ben Moshe Neriya Cohen

2 W HAT IS C ILK ? G eneral-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.

3 C ILK - H OW IT B EGAN ? 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.

4 C ILK K EYWORDS Spawn Sync Inlet Abort

5 A S IMPLE E XAMPLE 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); }

6

7

8

9

10

11 W ORK & S PAN

12 P ERFORMANCE

13 S TEALING

14

15 E XAMPLE – Q UICK S ORT

16

17

18 S ERIAL R ECURSION

19 P ARALLEL R ECURSION

20


Download ppt "P ARALLEL P ROCESSING F INAL P RESENTATION CILK Eliran Ben Moshe Neriya Cohen."

Similar presentations


Ads by Google