p arallel p rocessing f inal p resentation cilk eliran ben moshe neriya cohen

Post on 17-Jan-2016

228 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

PARALLEL PROCESSING

FINAL PRESENTATION

CILKEliran Ben MosheNeriya Cohen

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.

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.

CILK KEYWORDS

Spawn

Sync

Inlet

Abort

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); }}

WORK & SPAN Work ()- The total amount of processor time

required to complete the program is the sum of all the numbers.

Span (

PERFORMANCE

Parallelism - the average amount of work per step along the span.

STEALING

STEALING

EXAMPLE – QUICK SORT

SERIAL RECURSION

PARALLEL RECURSION

top related