LINPACK_BENCH
The LINPACK Benchmark
LINPACK_BENCH is a C program
which carries out the LINPACK benchmark program.
The LINPACK benchmark is a test problem used to rate the performance
of a computer on a simple linear algebra problem.
The test problem requires the user to set up a random dense matrix
A of size N = 1000, and a right hand side vector B
which is the product of A and a vector X of all 1's.
The first task is to compute an LU factorization of A. The
second task is to use the LU factorization to solve the linear system
A * X = B.
The number of floating point operations required for these two
tasks is roughly
ops = 2 * N*N*N / 3 + 2 * N * N,
therefore, the "MegaFLOPS" rating, or millions of floating point
operations per second, can be found as
mflops = ops / ( cpu * 1000000 ).
The C source code presented here is unusual in that a single file
embodies both single and double precision. The precision to be used
is specified at compile time with a compiler option. Moreover, another
compiler option allows the user to request "rolled loops" (the normal
kind of for loop), or "unrolled loops", in which the loops are
done with an increment greater than 1. The unrolled option can often
significantly improve performance.
On a given computer, if you run the benchmark for a sequence of increasing
values of N, the behavior of the MegaFLOPS rating will vary as you pass through
three main zones of behavior:
-
a rising zone, as both the local cache memory and the processor
are not challenged.
-
a flat zone, where the processor is challenged, that is, it is
performing at top efficiency.
-
a decaying zone, where the local cache memory is also challenged,
that is the matrix is so large that the cache is not big enough to
keep the necessary data close enough to the processor to keep it running
at top speed.
| Language | Precision | Type | Machine | Comment | MegaFLOPS |
| C | Single | Real | DHCP95 (Apple G5) | rolled | 108 |
| C | Single | Real | DHCP95 (Apple G5) | unrolled | 184 |
| | | | | | |
| C | Double | Real | DHCP95 (Apple G5) | rolled | 111 |
| C | Double | Real | DHCP95 (Apple G5) | unrolled | 190 |
Usage:
-
linpack_bench_s
-
runs the single precision benchmark program, using rolled loops, and prints the timings.
-
linpack_bench_s_unroll
-
runs the single precision benchmark program, using unrolled loops, and prints the timings.
-
linpack_bench_d
-
runs the double precision benchmark program, using rolled loops, and prints the timings.
-
linpack_bench_d_unroll
-
runs the double precision benchmark program, using unrolled loops, and prints the timings.
Related Data and Programs:
LINPACK
is a C++ library which
supplies the solvers used by LINPACK_BENCH.
LINPACK_BENCH is available in
a C version and
a C++ version and
a FORTRAN77 version and
a FORTRAN90 version and
a JAVA version and
a MATLAB version.
MATMUL
is an executable FORTRAN90 program which
is an interactive matrix multiplication benchmark program.
MDBNCH
is an executable FORTRAN77 program which
is a benchmark code for a molecular dynamics calculation.
MEMORY_TEST
is a C++ program which
declares and uses a sequence of larger
and larger vectors, to see how big a vector can be used on a given
machine and compiler.
SUM_MILLION
is a C program which
sums the integers from 1 to 1,000,000, as a demonstration of how
to rate a computer's speed;
TIMER
is a C example which
demonstrates how to measure CPU time or elapsed time.
Reference:
-
http://www.netlib.org/benchmark/1000s
the LINPACK benchmark website (single precision).
-
http://www.netlib.org/benchmark/1000d
the LINPACK benchmark website (double precision).
-
Jack Dongarra,
Performance of Various Computers Using Standard Linear Equations Software,
Technical Report CS-89-85,
Electrical Engineering and Computer Science Department,
University of Tennessee, 2008.
-
Jack Dongarra, Jim Bunch, Cleve Moler, Pete Stewart,
LINPACK User's Guide,
SIAM, 1979,
ISBN13: 978-0-898711-72-1,
LC: QA214.L56.
-
George Fishman,
Multiplicative congruential random number generators with modulus
2**b: an exhaustive analysis for b = 32 and a partial analysis for b = 48,
Mathematics of Computation,
Volume 189, 1990, pages 331-344.
-
Charles Lawson, Richard Hanson, David Kincaid, Fred Krogh,
Algorithm 539:
Basic Linear Algebra Subprograms for Fortran Usage,
ACM Transactions on Mathematical Software,
Volume 5, Number 3, September 1979, pages 308-323.
Source Code:
Examples and Tests:
List of Routines:
-
MAIN is the main program for LINPACK_BENCH.
-
CPU_TIME reports the elapsed CPU time.
-
DAXPY computes constant times a vector plus a vector.
-
DDOT forms the dot product of two vectors.
-
DGEFA factors a real general matrix.
-
DGESL solves a real general linear system A * X = B.
-
DSCAL scales a vector by a constant.
-
IDAMAX finds the index of the vector element of maximum absolute value.
-
R8_ABS returns the absolute value of a R8.
-
R8_EPSILON returns the R8 round off unit.
-
R8_MAX returns the maximum of two R8's.
-
R8_RANDOM returns a uniformly distributed random number between 0 and 1.
-
R8MAT_GEN generates a random R8MAT.
-
TIMESTAMP prints the current YMDHMS date as a time stamp.
You can go up one level to
the C source codes.
Last revised on 10 March 2008.