Book contents
- Frontmatter
- Contents
- List of Figures
- List of Tables
- Preface
- 1 Concurrent Processes
- 2 Basic Models of Parallel Computation
- 3 Elementary Parallel Algorithms
- 4 Designing Parallel Algorithms
- 5 Architectures of Parallel Computers
- 6 Message-passing Programming
- 7 Shared-memory Programming
- Solutions to Selected Exercises
- Glossary
- References
- Index
7 - Shared-memory Programming
Published online by Cambridge University Press: 06 January 2017
- Frontmatter
- Contents
- List of Figures
- List of Tables
- Preface
- 1 Concurrent Processes
- 2 Basic Models of Parallel Computation
- 3 Elementary Parallel Algorithms
- 4 Designing Parallel Algorithms
- 5 Architectures of Parallel Computers
- 6 Message-passing Programming
- 7 Shared-memory Programming
- Solutions to Selected Exercises
- Glossary
- References
- Index
Summary
INTRODUCTION
Another basic type of parallel processing, next to message-passing computing, is shared-memory computing. As the name indicates, this type of computing assumes that programs have access to shared memory covering the whole or a part of the operating memory of a parallel computer. A single program is executed by one or more collaborating threads created and deleted dynamically. The threads executed in parallel can operate on both the shared data and private data.
In this chapter we concentrate on the principles of shared-memory programming with the use of OpenMP API (Open Multi-Processing Application Programming Interface) that works in conjunction with C/C++ and Fortran languages. The interface is defined by the collection of compiler directives, library functions, and environment variables. These elements allow users to indicate to a compiler the parts of a sequential program that can be executed in parallel. Basically, the interface is intended to create programs on shared-memory architectures (see Section 5.3). However, supported by MPI it can also be used to write parallel programs on clusters equipped with shared as well as distributed memory (see Sections 5.4.1 and
5.4.2).
The first version of the interface was developed by the OpenMP Architecture Review Board (ARB) in 1997. The board, which is still active, includes representatives of computer and software manufacturers, as well as a wide range of experts from various research institutions and universities.2 What is important, from the very beginning OpenMP received support from the leading computer companies such as Compaq, Digital, IBM, Intel, and Silicon Graphics. The producer group supporting OpenMP is constantly growing, as evidenced by creation of compilers for C,C++ and Fortran that accept the interface. The OpenMP 2.5 version (May 2005) has become a kind of standard. The work on version 3.0 was completed in May 2008, and on version 3.1 in July 2011.
- Type
- Chapter
- Information
- Introduction to Parallel Computing , pp. 243 - 282Publisher: Cambridge University PressPrint publication year: 2017