next up previous
Next: The listing of Up: The LAM companion to Previous: Summary

Lesson 4 -- working with communicators

In this lesson we shall talk about manipulating communicators. Our program will calculate using a Monte Carlo method. We will have one separate process serving random numbers to all other processes. That process will be excluded from a new communicator, which will be used by remaining processes for reduction operations. The master process, i.e., the process responsible for writing to the VDU, must not be the same process as the process that serves random numbers. So in this program we have two special processes: the random number server and the process which writes to the VDU.

Our program is called fifth.c. You can obtain it by ftp anonymous from cisr.anu.edu.au, directory /pub/papers/meglicki/mpi/simplempi, file fifth.c.

You must also have a file preamble.c, which is listed in section 4.1. That file can be also found in the same directory on our ftp server.

This program is also discussed in section 3.7 of ``Using MPI...''. fifth.c is not identical with the Argonne program though. I had to make a number of small changes in order to get it going under LAM on our farm.

The next section presents the listing of fifth.c.





Zdzislaw Meglicki
Tue Feb 28 15:07:51 EST 1995