9.5 Other Programming Software
Keeping in mind that your head node will also serve as a software
development platform, there are other software packages that
you'll want to install. One obvious utility is the
ubiquitous text editor. Fortunately, most likely choices are readily
available and will be part of your basic installation. Just
don't forget them when you install the system.
Because personal preferences vary so widely, you'll
want to include the full complement.
9.5.1 Debuggers
Another
essential tool is a software debugger. Let's face
it, using printf to debug parallel code is
usually a hopeless task. With multiple processes and buffered output,
it is unlikely you'll know where the program was
executing when you actually see the output. The best solution is a
debugger designed specifically for parallel code. While commercial
products such as
TotalView
are available and work well with MPI, free software is wanting. At
the very least, you will want a good traditional debugger such as
gdb. Programs that extend
gdb, such as
ddd (the Data Display
Debugger ), are a nice addition. (Debugging is discussed in
greater detail in Chapter 16.) Since it is
difficult to tell when they will be needed and just how essential
they will be, try to be as inclusive as possible when installing
these tools. As part of the gcc development
package, gdb is pretty standard fare and should
already be on your system. However, ddd may not
be installed by default.Since ddd provides a GUI for other debuggers
such as gdb, there is no point installing it on
a system that doesn't have X Windows and
gdb a or similar debugger.
ddd is often included as part of a Linux
distribution; for instance, Red Hat includes it. If not, you can
download it from http://www.gnu.org/software/ddd. The easiest
way to install it is from an RPM.
[root@fanny root]# rpm -vih ddd-3.3.1-23.i386.rpmDepending on what is installed on your system, you may run into a few
warning: ddd-3.3.1-23.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing... ######################################
##### [100%]
1:ddd ########################################
### [100%]
dependencies. For example, ddd requires
openmotif.
9.5.2 HDF5
Depending on
the nature of the programming you do, there may be other useful
libraries that you'll want to install. One such
package that OSCAR includes is Hierarchical Data Format
(Version 5) or HDF5. HDF5 is a freely
available software package developed by the HDF5 group at the
National Center for Supercomputing Applications (NCSA). The official
web site is http://hdf.ncsa.uiuc.edu/HDF5/.HDF5 is both a file format standard and a library with utilities
specifically designed for storing scientific data. It
supports very large files and is designed and tuned for efficient
storage on parallel computing systems. Data is stored in two parts, a
header and a data array. The header contains the information needed
to interpret the data array. That is, it describes and annotates the
data set. The data sets are essentially multidimensional arrays of
items. The API is available only in C. While HDF5 is beyond the scope
of this book, you should be aware it exists should you need it. An
extensive tutorial, as well as other documentation, is available at
the software's web site.
9.5.3 SPRNG
Scalable Parallel Random Number
Generators
(SPRNG) is a library that provides six different
state-of-the-art random number generators for use with parallel
programs. SPRNG integrates nicely with MPI. Its
use is described in Chapter 15.SPRNG is freely available from http://sprng.cs.fsu.edu/. At the time this
was written, the latest version sprng2.0a.tgz.
First, download the package and move it to an appropriate directory,
e.g., /usr/local/src. The next step is to unpack
it.
[root@amy src]# gunzip sprng2.0a.tgzThen change to the directory to where you just unpacked the source.
[root@amy src]# tar -xvf sprng2.0a.tar
...
Before you can build it, you need to edit a couple of files. In the
first section of the file make.CHOICES, select
the appropriate platform. Typically, this will be INTEL for Linux
clusters. Make sure the line
PLAT = INTELis uncommented and the lines for other platforms are commented out.
Because you want to use it with MPI, in the second section, uncomment
the line
MPIDEF = -DSPRNG_MPIYou should also comment out the two lines in the third section if
libgmp.a is not available on your system.You should also edit the appropriate architecture file in the
SRC subdirectory, typically
make.INTEL. You'll need to make
two sets of changes for a Linux cluster. First, change all the
gcc optimization flags from
-O3 to -O1. Next, change all
the paths to MPI to match your machine. For the setup shown in this
chapter, the following lines were changed:
MPIDIR = -L/usr/local/mpich-1.2.5.2/liband
CFLAGS = -O1 -DLittleEndian $(PMLCGDEF) $(MPIDEF) -D$(PLAT) -I/usr/localOnce you've done this, run make
/mpich-1.2.5.2/include -I/usr/local/mpich-1.2.5.2/include
CLDFLAGS = -O1
FFLAGS = -O1 $(PMLCGDEF) $(MPIDEF) -D$(PLAT) -I/usr/local/mpich-1.2.5.2
/include -I/usr/local/mpich-1.2.5.2/include -I.
F77LDFLAGS = -O1
from the root of the source tree. If you want to play with the MPI
examples, run make mpi in the
EXAMPLES subdirectory.To use the library, you must adjust your compile paths to include the
appropriate directories. For example, to use SPRNG with OSCAR and
MPICH, the following changes should work.
MPIDIR = -L/opt/mpich-1.2.5.10-ch_p4-gcc/libNote this installation is specific to one version of MPI. See Chapter 15 for the details of using SPRNG.
MPILIB = -lmpich
# Please include mpi header file path, if needed
CFLAGS = -O1 -DLittleEndian $(PMLCGDEF) $(MPIDEF) -D$(PLAT) -I/opt/mpich-
1.2.5.10-ch_p4-gcc/include -I/opt/mpich-1.2.5.10-ch_p4-gcc/include
CLDFLAGS = -O1
FFLAGS = -O1 $(PMLCGDEF) $(MPIDEF) -D$(PLAT) -I/opt/mpich-1.2.5.10-ch_p4-
gcc/include -I/opt/mpich-1.2.5.10-ch_p4-gcc/include -I.
F77LDFLAGS = -O1