6.5. Summary
In this chapter, we've looked at serial and parallel solutions to two very different problems: the n -body problem and solving the traveling salesperson problem using tree search. In each case we began by studying the problem and looking at serial algorithms for solving the problem. We continued by using Foster's methodology for devising a parallel solution, and then, using the designs developed with Foster's methodology, we implemented parallel solutions using Pthreads, OpenMP, and MPI. In developing the reduced MPI solution to the n -body problem, we determined that the “obvious” solution would be extremely difficult to implement correctly and would require a huge amount of communication. We therefore turned to an alternative “ring ...

Get An Introduction to Parallel Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.