Technical data
Parallel Programming Exercise
135
Epilogue
After considerable effort, you reduced execution time by about 30 percent by
using two processors. Because the routine you multiprocessed still accounts
for the majority of work, even with two processors, you would expect
considerable improvement by moving this code to a four-processor
machine. Because the code is parallelized, no further conversion is needed
for the more powerful machine; you can just transport the executable image
and run it.
Note that you have added a noticeable amount of work to get the
multiprocessing correct; the run time for a single processor has degraded
nearly 30 percent. This is a big number, and it may be worthwhile to keep
two versions of the code around: the version optimized for multiple
processors and the version optimized for single processors. Frequently the
performance degradation on a single processor is not nearly so large and is
not worth the bother of keeping multiple versions around. You can simply
run the multiprocessed version on a single processor. The only way to know
what to keep is to run the code and time it.










