This program is named MATMUL. MATMUL is a demonstration program. It carries out a piece of work, and reports the amount of time required. This time is a measurement of how hard the work was to do, and how fast the computer did it. The work MATMUL does involves multiplying two matrices. The matrices can be of any size the user wants, up to a certain maximum value. MATMUL includes several different methods for carrying out the work. The user may change the method at any time. MATMUL can be run on several different computers, including the Cray YMP, DEC VAX/VMS, DEC DECstation, IBM PC, and Apple Macintosh. There are several different ways to use MATMUL: * Record how the required time increases with problem size. * Compare the different algorithms on a given size problem; * Compare the speed of MATMUL on two computers; * Run versions of MATMUL in two different languages. Is this your first time using MATMUL? Perhaps you don't know what to do with the program. You could have it do the following four tasks: 1) Print a list of legal commands; 2) Print out the problem MATMUL is ready to solve; 3) Set the problem size to 10. 4) Solve the problem. To do these four things, you have to type the following four lines of text: Help Print N=10 Multiply You don't actually have to type the parts of the commands that are in lower case. "Help" could be abbreviated to "H", for instance. Try increasing the size of N. You should notice that the program slows down very quickly as N gets larger! In fact, the time should be roughly proportional to the cube of N, at least for large enough N. To see this effect, you could increase N in a regular way; doubling is a good way. If the cubic law really holds, you'll see the time go up by a factor of 8 each time. You might try the commands: N=10 Multiply N=20 Multiply N=40 Multiply MATMUL actually has many methods of matrix multiplication to choose from. If you don't tell it otherwise, it's going to use the "IJK" method. In FORTRAN, the IJK method looks like this: DO 30 I=1,N DO 20 J=1,N DO 10 K=1,N A(I,K)=A(I,K)+B(I,J)*C(J,K) 10 CONTINUE 20 CONTINUE 30 CONTINUE There are actually many methods available to MATMUL. Each method arrives at the same answer, but organizes the computation in a different way. Some methods will run faster than others. For most computers, some ways of organizing the calculation will match the way that computer "likes to think". To change the method, use the "ORDER" command. For instance, to change to the "JKI" method, tell MATMUL: ORDER=JKI You can pick most of the methods from the following list. If you pick "ALL", you are asking MATMUL to try all available methods. Methods mentioning the Cray are only available on the Cray YMP. ALL Requests that ALL methods be used each time. IJK The DO loop method, with indices I, J, K. IKJ The DO loop method, with indices I, K, J. JIK The DO loop method, with indices J, I, K. JKI The DO loop method, with indices J, K, I. KIJ The DO loop method, with indices K, I, J. KJI The DO loop method, with indices K, J, I. CIJK Complex arithmetic, IJK method. DIJK Double precision arithmetic, IJK method. MIJK Multitasked IJK method, executes in parallel on Cray. NIJK Integer arithmetic, IJK method. NIJK46 Integer arithmetic, IJK method, Cray 46 bit integers. SIJK "Scalar" IJK method. Cray vectorization turned off. UIJK IJK loop, with the outer I loop unrolled to a depth of 4. IUJK IJK loop, with the middle J loop unrolled to a depth of 4. IJUK IJK loop, with the inner K loop unrolled to a depth of 4. MXMA Cray SCILIB MXMA routine. SAXPYC Cray SCILIB routine SAXPY on columns of matrices. SAXPYR Cray SCILIB routine SAXPY on rows of matrices. SDOT Cray SCILIB dot product routine. SGEMM Cray SCILIB matrix*matrix routine. SGEMMS Cray SCILIB copy of SGEMM using Strassen's fast method. TAXPYC BLAS routine TAXPY on columns of matrices. TAXPYR BLAS routine TAXPY on rows of matrices. TDOT BLAS dot product routine. TGEMM BLAS matrix*matrix routine. This is the END of the explanation about MATMUL.