Chapter 14

Nine Tips to Parallel-Programming Heaven

What's in This Chapter?

Improving the application heuristics

Doing an architectural analysis

Adding parallelism

This chapter is like a TV program with three interweaving plots running in parallel. It includes the following:

  • A set of tips on how to write successful parallel programs, based on an interview with Dr. Yann Golanski of York.
  • A description of Dr. Golanski's n-bodies research project looking at star formation.
  • A set of hands-on exercises. Note that the code is not the same code that Dr. Golanski used, but is it written to show some of the key elements of his work.

The Challenge: Simulating Star Formation

The original research project investigated how adding coolants to the interstellar medium (ISM) could induce the medium to collapse and thus increase the likelihood of star formation. The problem is a classic n-bodies simulation problem, where calculations are made on how particles interact with each other. As new particles are added to the model, the number of calculations required increases by N2, where N is the number of particles in the model. Because of this N2 relationship, the number of calculations that have to be performed on any decent-size model expands to an almost unmanageable figure.

Using brute force to calculate how the particles interact with each other is practical for small numbers of particles, but for a large collection of particles the time needed to perform all the calculations becomes too long ...

Get Parallel Programming with Intel® Parallel Studio XE now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.