[Beowulf] multi-threading vs. MPI

Toon Moene toon at moene.indiv.nluug.nl
Wed Dec 12 10:46:49 PST 2007

Greg Lindahl wrote:

> On Tue, Dec 11, 2007 at 08:52:11AM -0500, Joe Landman wrote:
>> On the contrary, it is precisely because people are asking "how should I 
>> parallelize" that they need to ask the basic question of "where does my 
>> code spend time for my problems."
> OK, so say I have a garden-variety finite-difference code. I know how
> to use OpenMP to parallelize all the loops,

Well, our weather forecasting code is certainly garden-variety 
finite-difference code (we don't even use multi-grids), but I recently 
looked into the OpenMP parallellization (done by people who spent much 
much more time on looking into performance issues than I did) and I 
noticed only a few loops were parallellized.

As atmospheric movement on Earth is (for weather forecasting purposes, 
i.e. on length scales of days) a primarily two-dimensional phenomenon, 
the parallellized loops are:

1. Over the vertical layers (while all loops over horizontal boxes are
    left alone).

2. (In a different part of the code) over tasks computing vertical
    phenomena in a set of columns.

In other words, the parallellization is pushed outwards as far as 
possible - the majority of the loops don't even know there's more than 
one processor in the machine.

Toon Moene - e-mail: toon at moene.indiv.nluug.nl - phone: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
At home: http://moene.indiv.nluug.nl/~toon/
GNU Fortran's path to Fortran 2003: http://gcc.gnu.org/wiki/Fortran2003

More information about the Beowulf mailing list