Next: Programming:Restrictions
Previous: Programming:How to do it
Index: Contents
Programming in Parallel
Debugging
When starting a pvm application, the following output will be produced:
[tc0013] BEGIN
This means that a task with id c0013 has been spawned. A line like
[tc0013] EOF
means that the task with id c0013 has exited. The cause of a runtime
error (Trap, Segmentation Fault) will not be displayed. However, since tasks
never exit before the performance evaluation has been printed, a premature
exit indicates an error. If all tasks have exited because of an error, then
the master program won't terminate and has to be terminated by invoking
reset on the pvm console.
fprintf (stderr, "Checkpoint 1\n") statements in the functions
pipsJobManager() and pipsProcPar() will
appear on the console from which the application was started and can therefor
be used to display the contents of variables.
- Note:
- The normal printf statement does not work sometimes due to a bug in pvm.
- Note:
- The programs are not absolutely moron-proofed for the
sake of simplicity. They catch many errors, but not all. So if something
doesn't work the way it should, then it should be made sure that the
constraints for the use of that program are met, i.e. that the parameters, the
type of processed data, etc. is correct.
Tuning
After a pvm application has finished, a performance evaluation is printed,
listing the number of datafragments computed by each task and the total
number of processed fragments.
The granularity variable, defined in the function
pipsJobManager(), determines the data fragment size relative to the
total data size. The higher its value, the more fragments will be created.
The following possibilities exist for improving the performance:
- Adjusting the granularity variable manually for a typical task on a
typical virtual machine. Currently, it's value is set to 3.
Setting the value too high can make the pipsJobManager() a bottleneck.
Setting the value too low can cause the competition to start to early,
so that all tasks work on the same problem with the fastest task
winning but without real parallelism.
- Using a fixed data fragment size. Currently, the fragment size is
calculated from the data size.
- Introducing a new command line parameter to let the user determine
the granularity for each execution.
- Note:
- The pvm application is much slower than a sequential program, if only one
processor is available since processes then have to be swapped for each
message.
Frank Heimes (Dr-Frank.Heimes@epost.de), 31 Jan 1995
Phone: +49 (721) 6091 - 424, FAX: +49 (721) 6091 - 233
http://members.tripod.de/DrFrankHeimes/pips/parTuning.html