IBM Books

Hitchhiker's Guide


Chapter 2. The answer is 42

If you're familiar with message passing parallel programming, and you're completely familiar with message passing protocols, then you already know the answer is 42, and you can skip ahead to Chapter 3, Don't panic for a discussion on using the IBM Parallel Environment for AIX tools. If you're familiar with message passing parallel programming, (or if you can just say that five times really fast), but you would like to know more about the IBM Parallel Environment for AIX message passing protocols, look at the information in Protocols supported before skipping ahead to the next chapter.

For the rest of us, this section discusses some of the techniques for creating a parallel program, using message passing, and the various advantages and pitfalls associated with each technique.

This chapter does not provide an in-depth tutorial on writing parallel programs. Instead, it's more of an introduction to basic message passing parallel concepts. It provides just enough information to help you understand the material that is covered in this book. If you want more information about parallel programming concepts, you may find some of the books listed in Non-IBM publications helpful.

Good. Now that we've gotten rid of the know-it-alls that skipped to the next section, we can reveal the answer to the question of how to create a successful parallel program. No, the answer isn't really 42. That was just a ploy to get everyone else out of our hair. The answer is to start with a working sequential program. Complex sequential programs are difficult enough to get working correctly, without also having to worry about the additional complexity introduced by parallelism and message passing. The bottom line is that it's easier to convert a working serial program to parallel, than it is to create a parallel program from scratch. As you become proficient at creating parallel programs, you will develop an awareness of which sequential techniques translate better into parallel implementations. Once aware, you can then make a point of using these techniques in your sequential programs. In this chapter, you will find information on some of the fundamentals of creating parallel programs.

There are two common techniques for turning a sequential program into a parallel program; data decomposition and functional decomposition. Data decomposition means distributing the data that the program is processing among the parallel tasks. Each parallel task does approximately the same thing but on a different set of data. With functional decomposition, the function that the application is performing is distributed among the tasks. Each task operates on the same data, but does something different. Most parallel programs do not use data decomposition or functional decomposition exclusively. Rather, they use a mixture of the two, weighted more toward one type or the other. One way to implement either form of decomposition is through the use of message passing.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]