Concurrency Platforms OpenMP and Cilk Plus David Ferry CSCI 3500 – Operating Systems Saint Louis University St. Louis, MO 63103
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
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
Concurrency Platforms The programmer should only identify opportunities for parallelism, and the system should implement it efficiently. A variety of systems: OpenMP, Cilk Plus, Open MPI… OpenMP 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
CSCI 3500 - Operating Systems Parallelism Made Easy for( i = 0; i < 100; i++ ){ some_big_computation(i); } Becomes: #pragma omp parallel for cilk_for( i = 0; i < 100; i++ ){ some_big_computation(i); } CSCI 3500 - Operating Systems