- Hardcover: 384 pages
- Publisher: Addison-Wesley Professional; 1 edition (September 25, 2004)
- Language: English
- ISBN-10: 0321228111
- ISBN-13: 978-0321228116
- Product Dimensions: 7.3 x 1 x 9.6 inches
- Shipping Weight: 1.7 pounds
- Average Customer Review: 10 customer reviews
- Amazon Best Sellers Rank: #1,348,428 in Books (See Top 100 in Books)
Enter your mobile number or email address below and we'll send you a link to download the free Kindle App. Then you can start reading Kindle books on your smartphone, tablet, or computer - no Kindle device required.
To get the free app, enter your mobile phone number.
Patterns for Parallel Programming 1st Edition
Use the Amazon App to scan ISBNs and compare prices.
Customers who bought this item also bought
What other items do customers buy after viewing this item?
About the Author
Timothy G. Mattson is Intel's industry manager for life sciences. His research focuses on technologies that simplify parallel computing for general programmers, with an emphasis on computational biology. He holds a Ph.D. in chemistry from the University of California, Santa Cruz.
Beverly A. Sanders is associate professor at the Department of Computer and Information Science and Engineering, University of Florida, Gainesville. Her research focuses on techniques to help programmers construct high-quality, correct programs, including formal methods, component systems, and design patterns. She holds a Ph.D. in applied mathematics from Harvard University.
Berna L. Massingill is assistant professor in the Department of Computer Science at Trinity University, San Antonio, Texas. Her research interests include parallel and distributed computing, design patterns, and formal methods. She holds a Ph.D. in computer science from the California Institute of Technology.
Excerpt. © Reprinted by permission. All rights reserved.
"If you build it, they will come."
And so we built them. Multiprocessor workstations, massively parallel supercomputers, a cluster in every department ... and they haven't come. Programmers haven't come to program these wonderful machines. Oh, a few programmers in love with the challenge have shown that most types of problems can be force-fit onto parallel computers, but general programmers, especially professional programmers who "have lives", ignore parallel computers. And they do so at their own peril. Parallel computers are going mainstream. Multithreaded microprocessors, multicore CPUs, multiprocessor PCs, clusters, parallel game consoles ... parallel computers are taking over the world of computing. The computer industry is ready to flood the market with hardware that will only run at full speed with parallel programs. But who will write these programs?
This is an old problem. Even in the early 1980s, when the "killer micros" started their assault on traditional vector supercomputers, we worried endlessly about how to attract normal programmers. We tried everything we could think of: high-level hardware abstractions, implicitly parallel programming languages, parallel language extensions, and portable message-passing libraries. But after many years of hard work, the fact of the matter is that "they" didn't come. The overwhelming majority of programmers will not invest the effort to write parallel software.
A common view is that you can't teach old programmers new tricks, so the problem will not be solved until the old programmers fade away and a new generation takes over.
But we don't buy into that defeatist attitude. Programmers have shown a remarkable ability to adopt new software technologies over the years. Look at how many old Fortran programmers are now writing elegant Java programs with sophisticated object-oriented designs. The problem isn't with old programmers. The problem is with old parallel computing experts and the way they've tried to create a pool of capable parallel programmers.
And that's where this book comes in. We want to capture the essence of how expert parallel programmers think about parallel algorithms and communicate that essential understanding in a way professional programmers can readily master. The technology we've adopted to accomplish this task is a pattern language. We made this choice not because we started the project as devotees of design patterns looking for a new field to conquer, but because patterns have been shown to work in ways that would be applicable in parallel programming. For example, patterns have been very effective in the field of object-oriented design. They have provided a common language experts can use to talk about the elements of design and have been extremely effective at helping programmers master object-oriented design.
This book contains our pattern language for parallel programming. The book opens with a couple of chapters to introduce the key concepts in parallel computing. These chapters focus on the parallel computing concepts and jargon used in the pattern language as opposed to being an exhaustive introduction to the field. The pattern language itself is presented in four parts corresponding to thefour phases of creating a parallel program:
Finding Concurrency . The programmer works in the problem domain to identify the available concurrency and expose it for use in the algorithm design.
Algorithm Structure . The programmer works with high-level structures for organizing a parallel algorithm.
Supporting Structures . We shift from algorithms to source code and consider how the parallel program will be organized and the techniques used to manage shared data.
Implementation Mechanisms . The final step is to look at specific software constructs for implementing a parallel program.
The patterns making up these four design spaces are tightly linked. You start at the top (Finding Concurrency), work through the patterns, and by the time you get to the bottom (Implementation Mechanisms), you will have a detailed design for your parallel program.
If the goal is a parallel program, however, you need more than just a parallel algorithm. You also need a programming environment and a notation for expressing the concurrency within the program's source code. Programmers used to be confronted by a large and confusing array of parallel programming environments. Fortunately, over the years the parallel programming community has converged around three programming environments.
OpenMP. A simple language extension to C, C++, or Fortran to write parallel programs for shared-memory computers.
MPI. A message-passing library used on clusters and other distributed-memory computers.
Java. An object-oriented programming language with language features supporting parallel programming on shared-memory computers and standard class libraries supporting distributed computing.
Many readers will already be familiar with one or more of these programming notations, but for readers completely new to parallel computing, we've included a discussion of these programming environments in the appendixes.
In closing, we have been working for many years on this pattern language. Presenting it as a book so people can start using it is an exciting development for us. But we don't see this as the end of this effort. We expect that others will have their own ideas about new and better patterns for parallel programming. We've assuredly missed some important features that really belong in this pattern language. We embrace change and look forward to engaging with the larger parallel computing community to iterate on this language. Over time, we'll update and improve the pattern language until it truly represents the consensus view of the parallel programming community. Then our real work will begin--using the pattern language to guide the creation of better parallel programming environments and helping people to use these technologies to write parallel software. We won't rest until the day sequential software is rare.
Top customer reviews
In some sections the repeats get one level that even looks like a copy & paste from one page to the next one ...And for me that I'm someone how likes to go to the point that's really annoying!
Why only four stars you may ask? The trouble is that after over 40 years knowledge about parallel programming is still weak. The scientific computation folks have their (often heavy duty) tricks of the trade, but, as another reviewer pointed out, parallel computing is much more and is starting to address much broader areas.
This book will help you wade through the maze of confusion and will help you get oriented - that is of a huge help. Then you need to practice...
The Good: this volume discusses both shared-memory and distributed-memory programming, all between one set of covers. It also makes use of a general-purpose programming language and is therefore of interest both to computational scientists who are interested in clusters, and to programmers interested in multiprocessors (these days that covers pretty much everyone). More generally, PPP offers valuable advice to those interested in robust parallel software design. The authors cover a number of topics that are an essential part of parallel-programming lore (e.g. the 1D and 2D block-cyclic array distributions in Chapter 5). In other words, they codify existing knowledge, which is precisely what patterns are supposed to do. To accomplish this, they make effective use of a small number of examples (like molecular dynamics and the Mandelbrot set). That allows them to show a specific problem as approached both from different design spaces, and also from different patterns within one design space. This book follows in the footsteps of the illustrious volume "Design Patterns" by the Gang of Four (GoF). In chapters 3, 4, and 5, Mattson, Sanders, and Massingill introduce a number of patterns using a simplified version of the GoF template. Despite the structural similarities between the two books, PPP is more readable than the GoF volume. This is probably because it introduces a pattern language ("an organized way of navigating through a collection of design patterns to produce a design"), not just a collection of patterns. Essentially, the writing style is a linear combination of narrative and reference: it can be read cover-to-cover, or not. Finally, the three appendices contain introductory discussions of OpenMP, MPI, and concurrency in Java, respectively. They can be read either as the need arises, or before even starting the book: though limited in scope, they are pedagogically sound.
The Bad: despite being easier to read from start to finish than the GoF classic, this book is still constrained by its choice to catalog patterns. As a result, the recurring examples lead to repetition, since they have to be re-introduced in each example section. Also, given that the book was published in 2004, a few implementation-related topics are somewhat out-of-date (e.g., OpenMP 3.0 was not around at the time). Importantly, the book predates the recent explosion of interest in general-purpose GPU programming, so it doesn't mention, say, texture memory. However, more fundamental things like data decomposition, which the book does explain, are related to any parallel programming environment. On a different note, even though the book is generally readable, from time to time the authors resort to the "just look at the code and figure it out" technique: the best-known example is in chapter 4 when they discuss ghost cells and nonblocking communication. Furthermore, even though the authors have been for the most part clearheaded when naming the different patterns, I found their decision to call two distinct patterns "Data Sharing" and "Shared Data" (in the "Finding Concurrency" and "Supporting Structures" design spaces, respectively) quite confusing and therefore unfortunate. Also, the Glossary is very useful, in that it explains many terms either discussed in the text (e.g. "False sharing") or not (e.g. "Copy on write", "Eager evaluation"), but it is far from complete (e.g. "First touch", "Poison pill", and "Work stealing", though mentioned in the main text, are not included in the Glossary). Finally, I think the authors overstate the case when they claim that "the parallel programming community has converged around" Java: Pthreads would have been an equally (if not more) acceptable choice.
All in all, this book provides a good description of many aspects of parallel programming. Most other texts on parallel programming either are class textbooks or focus on a specific technology. In contradistinction to such books, "Patterns for parallel programming" strikes a happy medium between focusing on principles and discussing practical applications.
After getting the reader oriented to the basics of parallel programming, the authors lay out four "design spaces," or families of related patterns. Within each space, the authors present a handful of patterns using a common and reasonably familiar format: name, problem addressed, context, forces acting on the design, the solution, and examples of the pattern's usage. They identify spaces named Finding Concurrency, Algorithm Structure, Supporting Structures, and Implementation Mechanisms. Of course, these topics overlap to some extend, especially in the interplay of algorithm design and explitable parallelism, or in langauge and API primitives that blur support mechanisms available with the implemenation choices available to the programmer. The authors show how the pieces come together in familiar applications, including molecular dynamics and medical imaging applications. Appendices sketch the basic programming constructs available in three of the major parallelism toolkits around: OpenMP, MPI, and Java.
Although valuable, this book has a number of weaknesses. For example, they cite the Cooley-Tukey FFT algorithm as a winning example of "Divide and Conquer." It's a great example, but perhaps not the one most useful for didactic purposes. The FFT algortithm is brilliant, and based on deep insight combined with total fluency in handling combinations of trig functions. Programmers writing parallel code will always benefit in proportion to their understanding of the algorithms, but I would find it discouraging to think that mastery and creativity at Cooley and Tukey's level were requisite. The authors skip over the kinds of fine-grained parallelism and communication available in emerging platforms, such as FPGA- and GPU-based accelerators. At the opposite end of the spectrum, they also gloss over many of the management issues in grid computing, where parallelism is extremely coarse-grained. I also have reservations about some of the system primitives they identify as patterns - one may as well say that a "for" loop is a pattern, even though it's a primitive in nearly all programming languages.
Despite flaws, the authors do reasonably well at introducing a wide range of basics for writing parallel programs. The interested beginner will need a lot more information to put the ideas to use, but this is a fair start.