Mandelbrot is a simple example of the master/slave parallel
programming technique, written in C.  It runs with one master process
and any number of slaves.  Since it is MIMD, it requires an application
schema (see myapp) to run it with mpirun.  The master writes the
computed image into a Sun rasterfile formatted file.  Try viewing
it with X11/xv.

This application contains a measure of fault tolerance.  Slaves can die
and the application will continue with less slaves, as long as one
slave is alive.  This feature relies on the MPI system reporting
errors on MPI functions whose communicator includes a dead slave.
Since the application creates a separate communicator for each slave,
the master will know from a returned error which slave has died.
The application cannot tolerate the untimely death of the master,
although this could be done with mirroring.

Use hcc to compile the programs.

hcc -o master master.c -lmpi
hcc -o slave slave.c -lmpi
