Who Should Read This Booklet?
This
booklet
is written for novice C programmers who want to use, understand and
perhaps even write programs that run on supercomputers, clustered PC's,
or any system of linked multiprocessors that can be harnessed by the
Message Passing Interface, MPI. We assume that the motivation for using
such hardware arises from a need for greater speed of execution and,
behind this motivation, the strategic thought that time-savings can be
produced by some form of parallel execution.
The C/C++ programs of this booklet are purposely quite
simple to avoid distracting the student from the central focus, the MPI
lessons. With this same focus,
pointers, which are bound to trouble the neophyte
C-programmer, are incorporated
as explicit declarations in a gradual,
progressive manner across successive lessons. We also filled a gap or
two, in terms of specific, precisely relevant examples, that seem to be
left as exercises in elementary C/C++ texts but that are critical for
using the MPI functions.
The
simple programming
lessons and terse exposition found here should appeal to a particular
audience, those who use computers as computational tools: scientists
like ourselves; engineers who write their own simulations; scientists
and engineers in training; and last but far from least, teachers of
pre-college computer science students and pre-college students
themselves, particularly those with the discipline and interest to
teach themselves. On the other hand, university-level computer
scientists and professional programmers will find the presentation here
far too elementary. These two groups will likely prefer a textbook such
as Quinn's (2004), which we really like, and the primary source for
MPI, MPI-The Complete Reference vols I, II, and III.
We
continually
returned to these sources as our guides. However, it would be hard to
underestimate how much information we ignored, information that a
computer scientist and professional programmer would want, perhaps
demand, to know. Not only does this booklet ignore almost two hundred
MPI functions, but it also ignores lengthy discussions about using
these commands, and it skips over the sketches of the underlying
philosophy, issues, and the compromises with which the creators of MPI
grappled. If this is what interests you, then take the time to enjoy
the books just cited.
The
presentation is
expressly aimed at the novice programmer. To take advantage of the
lessons requires the smallest experience with C or C++. No special
types or classes are created. The most complicated aspects of the
computer code are calls to functions and passing variable values with
pointers.
Compared to the
available texts, the sequenced development of the source code here
provides the shortest and simplest path from a serial programming
ability and mindset to the creation of parallel C/MPI2-based programs.
In particular, this path is specifically laid out to install an
awareness of the fundamental issues of parallel programming with
multiple computers.
To accomplish an
appropriately streamlined presentation, the bywords of this booklet are
'minimal but sufficient' and 'less is more'. These bywords directed our
selection of the MPI functions and the design of the programming
exercises. For us, minimal but sufficient expertise is the quickest
path for our students to become comfortable using the custom parallel
code of the laboratory, to decide if they want to go farther and learn
more, perhaps even create their own parallel programs. Quite
importantly, if they insist on programming, we want them thinking in
terms of code simplicity relative to the task of parallel execution of
their algorithms.
Although it will depend
on your programming background, we foresee just a couple of hours to
read through, to modify, to compile, and to execute the programs in
Chapter 1 through Chapter 5. At that point you will be equipped with
the essentials needed to program a Beowulf system or other forms of
multiprocessor computers that can be run within the MPI
format.