A Lazy Master For The Bifurcation Map


The basic tasks of the master in this problem are trivial.

  1. Determine Configuration of virtual machine.
  2. Start slave processes on all physical machines.
  3. Send general parameters to slaves.
  4. Split m range into n parts.
  5. Send range of m values to slaves.
  6. Continue with step 4 until all m values have been sent to slaves.
  7. Wait for slaves to finish their last calculation.
  8. Tell slaves to shut down.
Points three and four require some additional remarks.
3. The slave process needs three more parameters to perform his work. It has to know how long to wait to avoid transients, how many y values to calculate and in how many subranges it should divide the m range it is working on. Instead of defining these values in the slave program we choose to let the master send these parameters to the slave. This way we have all adjustable parameters in on place and it is much easier to make changes.
4. How big is n?
This question is important for the performance of our parallel program. If we make n too big, then a lot of time is spent sending new work to slave which will finish the work in a very short time. However, at the end of our program we have to wait for the last process to finish. In the worst case we have to wait the total time needed for this process which increases when n gets smaller. During this time the rest of the virtual machine is just waiting, so we don't want to make n too small. The ideal value for n will depend on the amount of overhead connected to starting a new task, the computing time required for each task and the number of physical machines in your virtual machine. For serious work you have to sit down and try to calculate n, in this tutorial you might want to change n to get a feeling how it changes the performance of the program.

The source code for this program in: C


Previous: The Bifurcation Map - Made To Be Parallized
Next: A slave nearly identical to the sequential version
Index: Getting started with PVM