O'Reilly logo

Multicore and GPU Programming by Gerassimos Barlas

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4

Shared-memory programming

OpenMP

Abstract

The decomposition of a sequential program into components that can execute in parallel is a tedious enterprise. OpenMP has been designed to alleviate much of the effort involved, by accommodating the incremental conversion of sequential programs into parallel ones, with the assistance of the compiler.

OpenMP relies on compiler directives for decorating portions of the code that the compiler will attempt to parallelize. In this chapter we examine these OpenMP directives and the associated clauses that control their behavior.

OpenMP is particularly useful for partitioning and running in parallel the iterations of a loop. Loop parallelism as facilitated by OpenMP, can be successful only if ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required