The Answer:

If you determined that the code on the previous page generated and then multiplied two n x n matrices, you were correct. The details of function generate are unimportant; we simply needed two matrices, so we built them there, according to a completely ad hoc formula. Function doit multiplies them. Function main simply invokes the other two functions to accomplish this.

So What's the Point?

The point is twofold. First, you probably recognized what the code does, which shows that Sisal is easy to read and expressive. Second, the program, which runs on just about anything from a PC to a Cray, is not just a program, but a parallel program. The fact that there's no reference in it to execution environment, number of processors, or any other machine feature, nor to any sort of parallization primitive, shows that Sisal is able to automatically manage the parallelism in your program and the resources of the system executing it. It's no idle boast to say that this program will give linear speedups on a Cray C-90, when a large matrix size is used.

Previous Section