MXM Matrix-Matrix Multiplication Timings

MXM is a FORTRAN90 program which sets up a matrix-matrix multiplication problem A = B * C, and carries it out using

• Nested DO I, J, K loops;
• Nested DO I, K, J loops;
• Nested DO J, I, K loops;
• Nested DO J, K, I loops;
• Nested DO K, I, J loops;
• Nested DO K, J, I loops;
• the MATMUL FORTRAN90 intrinsic function;

The user is allowed to specify N1, N2, and N3, which define the matrix sizes.

Usage:

mxm n1 n2 n3
where
• n1 is the number of rows in B.
• n2 is the number of columns in B and rows in C.
• n3 is the number of columns in C;

Languages:

MXM is available in a C version and a C++ version and a FORTRAN90 version and a MATLAB version.

Related Data and Programs:

F90_INTRINSICS, FORTRAN90 programs which illustrate the use of FORTRAN90 intrinsic functions.

LINPACK_BENCH, a FORTRAN90 program which measures the time needed to factor and solve a "large" (N=1000) dense linear system of equations, and is used as a benchmark.

MATMUL, a FORTRAN90 program which is an interactive matrix multiplication benchmark program.

MDBNCH, a FORTRAN77 program which is a benchmark molecular simulation calculation.

MXV, a FORTRAN90 program which compares the performance of (DO I, DO J) loops, (DO J, DO I ) loops, and MATMUL for computing the product of an MxN matrix A and an N vector X.

NAS, a FORTRAN90 program which runs the NASA kernel benchmark.

SUM_MILLION, a FORTRAN90 program which sums the integers from 1 to 1,000,000, as a demonstration of how to rate a computer's speed;

TIMER, FORTRAN90 programs which demonstrate how to compute CPU time or elapsed time.

Reference:

1. John Burkardt, Paul Puglielli,
Pittsburgh Supercomputing Center,
MATMUL: An Interactive Matrix Multiplication Benchmark

List of Routines:

• MAIN is the main program for MXM.
• MATGEN generates a random matrix.
• MXM_IJK computes A = B * C using DO I, DO J, DO K loops.
• MXM_IKJ computes A = B * C using DO I, DO K, DO J loops.
• MXM_JIK computes A = B * C using DO J, DO I, DO K loops.
• MXM_JKI computes A = B * C using DO J, DO K, DO I loops.
• MXM_KIJ computes A = B * C using DO K, DO I, DO J loops.
• MXM_KJI computes A = B * C using DO K, DO J, DO I loops.
• MXM_MATMUL computes A = B * C, using the FORTRAN90 MATMUL function.
• S_TO_I4 reads an I4 from a string.
• TIMESTAMP prints the current YMDHMS date as a time stamp.

You can go up one level to the FORTRAN90 source codes.

Last revised on 08 October 2010.