文档介绍:PROGRAMMING MPI Cluster Programming
Cluster Programming with MPI
Number Crunching
Linux clusters are all the rage. As this article shows, programming a cluster with MPI (Message Passing Interface) need
not be too difficult. Of course, we realize that most readers will not have a cluster of Linux machines under their desks,
so the sample programs will run on any normal PC. BY HEIKO BAUKE
PI is the indisputed leader are well documented, and in case of the MPI namespace. Each MPI program
when es to program- installation issues, competent help is is surrounded by the MPI::Init and
Mming Linux clusters and other always at hand via the LAM mailing MPI::Finalize tags. MPI calls are illegal if
massively puters. list [4]. they occur before MPI::Init has initial-
The development of parallelized pro- ized the MPI environment, or after
grams leads to a number of issues. The Hello World! MPI::Finalize has closed the MPI envi-
load needs to be evenly spread and the Listing 1 shows a simple MPI program ronment.
work performed by these multiple simul- that outputs the names of puters municator is one of MPI’s
taneous processes needs coordinating. running the processes. fundamental concepts. It groups pro-
The header file included here, , cesses that can exchange messages.
Message Exchanges provides MPI specific prototypes. All municators are implemented by the
Message