Parallel Programming in OpenMP

Chapter 2: Getting Started with OpenMP

2.1 Introduction

A parallel programming language must provide support for the three basic aspects of parallel programming: specifying parallel execution, communicating between multiple threads, and expressing synchronization between threads. Most parallel languages provide this support through extensions to an existing sequential language; this has the advantage of providing parallel extensions within a familiar programming environment.

Different programming languages have taken different approaches to providing these extensions. Some languages provide additional constructs within the base language to express parallel execution, communication, and so on (e.g., the forall construct in Fortran-95 [ABM 97, MR 99]). Rather than designing additional language constructs, other approaches provide directives that can be embedded within existing sequential programs in the base language; this includes approaches such as HPF [KLS 94]. Finally, application programming interfaces such as MPI [PP 96] and various threads packages such as Pthreads [NBF 96] don't design new language constructs: rather, they provide support for expressing parallelism through calls to runtime library routines.

OpenMP takes a directive-based approach for supporting parallelism. It consists of a set of directives that may be embedded within a program written in a base language such as Fortran, C, or C++. There are two compelling benefits of a directive-based approach that led to this choice: The first is that this approach allows the same code base to be used for development on both single-processor and multiprocessor platforms; on the former, the directives are simply treated as comments and ignored by the language translator, leading to correct serial execution.

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Programming Languages
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.