OpenACC for Programmers by Sunita Chandrasekaran
Author:Sunita Chandrasekaran
Language: eng
Format: epub
Publisher: Pearson Education
Published: 2018-04-15T04:00:00+00:00
8.1 Programming Models
This section offers a short description of each of the most relevant programming models. For this purpose, the models are also distinguished with respect to their implementation strategy (language features, directives, language extensions, or C++ abstraction), and their supported parallelization models (thread parallelism, task parallelism, and data parallelism).
In thread parallelism models, parallelism is introduced via concurrent execution of streams, which can coordinate via data exchange or explicit synchronization. Thread parallelism models are the most flexible way of expressing parallelism and can be used to implement both data parallelism and task parallelism execution schemes. However, these models are also the most cumbersome to use when you are implementing math or science algorithms.
Task parallelism–based systems are also flexible. They handle both functional and data parallelism. Furthermore, they can naturally expose parallelism in situations with complex data and synchronization dependencies.
Data parallelism is the most constrained model but is simpler to use than thread parallelism, and generally it has less runtime overhead than task parallelism–based systems. Data parallelism models describe work mainly via an index space, which can be iterated over in parallel. This does not necessarily mean that the iteration scheme is directly associated with a corresponding data structure. The data could be calculated during the execution of the program based on the iteration index.
Some programming models provide capabilities from all three areas. For example, OpenMP allows for thread parallelism and data parallelism as well as task parallelism.
As noted, all types of programming models can be implemented through various means.
Language features are the capabilities within the language itself that allow expressions of parallelism. Examples of those are the DO CONCURRENT concept in Fortran 2008, std::thread in C++11, and for_each in C++17. The advantage of using programming models that are implemented as language features is that they are part of the official programming language standard. Usually this means that they work well together with all other capabilities of a language. Additionally, they don’t require any other third-party tools in addition to the compiler itself. However, native parallelism in language standards is usually many years behind programming models implemented through other means with respect to its scope.
OpenACC is one example of the directive-based approach. Directives have the benefit that they can be ignored if the code is compiled in an environment that does not require the parallelism, or where no compiler exists that understands the directives. Furthermore, it is usually possible to incrementally introduce directives into an application. In addition to OpenACC, the most widely used directive-based programming model is OpenMP.
Language extensions add capabilities to an existing programming language that are not part of the language standard. These require specialized compilers, which often are provided only by a single party. Examples are CUDA, OpenCL, and C++ AMP. Applications written in those models cannot be compiled by standard compilers, something that can lead to a vendor lock-in. Often these models have restrictions with respect to which language features can be utilized within parallel regions of the code.
The last set of programming models is implemented through C++ abstractions.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8300)
Test-Driven Development with Java by Alan Mellor(6721)
Data Augmentation with Python by Duc Haba(6636)
Principles of Data Fabric by Sonia Mezzetta(6387)
Learn Blender Simulations the Right Way by Stephen Pearson(6284)
Microservices with Spring Boot 3 and Spring Cloud by Magnus Larsson(6158)
Hadoop in Practice by Alex Holmes(5958)
Jquery UI in Action : Master the concepts Of Jquery UI: A Step By Step Approach by ANMOL GOYAL(5806)
RPA Solution Architect's Handbook by Sachin Sahgal(5553)
Big Data Analysis with Python by Ivan Marin(5363)
The Infinite Retina by Robert Scoble Irena Cronin(5247)
Life 3.0: Being Human in the Age of Artificial Intelligence by Tegmark Max(5147)
Pretrain Vision and Large Language Models in Python by Emily Webber(4327)
Infrastructure as Code for Beginners by Russ McKendrick(4086)
Functional Programming in JavaScript by Mantyla Dan(4038)
The Age of Surveillance Capitalism by Shoshana Zuboff(3950)
WordPress Plugin Development Cookbook by Yannick Lefebvre(3801)
Embracing Microservices Design by Ovais Mehboob Ahmed Khan Nabil Siddiqui and Timothy Oleson(3606)
Applied Machine Learning for Healthcare and Life Sciences Using AWS by Ujjwal Ratan(3577)
