Concurrency Platforms Open MP and Cilk Plus David

  • Slides: 5
Download presentation
Concurrency Platforms Open. MP and Cilk Plus David Ferry CSCI 3500 – Operating Systems

Concurrency Platforms Open. MP and Cilk Plus David Ferry CSCI 3500 – Operating Systems Saint Louis University St. Louis, MO 63103 1

How can pthreads be improved? Parallel programs repeat the same code over and over

How can pthreads be improved? Parallel programs repeat the same code over and over again: • Thread creation • Passing arguments • Dividing work between threads • Thread synchronization and joining It’d be nice if we didn’t have to jump through all these hoops… CSCI 3500 - Operating Systems 2

How else can it be improved? Pthreads explicitly links the identification of possible parallelism

How else can it be improved? Pthreads explicitly links the identification of possible parallelism and the instantiation of parallelism. pthread_create() both creates a new thread and tells it where to execute. However, usually the choice of what to execute in parallel is entirely separate from the question of how and where to execute threads to achieve good performance. CSCI 3500 - Operating Systems 3

Concurrency Platforms The programmer should only identify opportunities for parallelism, and the system should

Concurrency Platforms The programmer should only identify opportunities for parallelism, and the system should implement it efficiently. A variety of systems: Open. MP, Cilk Plus, Open MPI… Open. MP is a specification by a committee of industrial and academic practitioners designed for practical parallel computing. Many implementations exist. Cilk Plus is the latest generation of an MIT project called Cilk. This is a specific implementation designed around having strong theoretical performance guarantees. CSCI 3500 - Operating Systems 4

Parallelism Made Easy for( i = 0; i < 100; i++ ){ some_big_computation(i); }

Parallelism Made Easy for( i = 0; i < 100; i++ ){ some_big_computation(i); } Becomes: #pragma omp parallel for( i = 0; i < 100; i++ ){ some_big_computation(i); } cilk_for( i = 0; i < 100; i++ ){ some_big_computation(i); } CSCI 3500 - Operating Systems 5