<< scibench_overview Benchmark Toolbox scibench_benchfun >>

Benchmark Toolbox >> Benchmark Toolbox > scibench_backslash

scibench_backslash

Benchmarks the backslash operator.

Calling Sequence

perftable = scibench_backslash ( )
perftable = scibench_backslash ( verbose )
perftable = scibench_backslash ( verbose , dispgraph )
perftable = scibench_backslash ( verbose , dispgraph , timemin )
perftable = scibench_backslash ( verbose , dispgraph , timemin , timemax )
perftable = scibench_backslash ( verbose , dispgraph , timemin , timemax , nfact )

Parameters

verbose :

a 1-by-1 matrix of booleans, set to %t to print messages during and at the end of the experiment (verbose = %t).

dispgraph :

a 1-by-1 matrix of booleans, set to %t to create a plot (default dispgraph = %f).

timemin :

a 1-by-1 matrix of doubles, the minimum time (in seconds) to measure the mflops (default timemin = 0.001). Must be positive.

timemax :

a 1-by-1 matrix of doubles, the maximum time (in seconds) to measure the mflops (default timemax = 0.1). Must be larger than timemin. The experiment ends when this time is reached.

nfact :

a 1-by-1 matrix of doubles, the multiplication factor for the size n of the matrix (default nfact = 1.2). Must be greater than 1. At each step of the algorithm, the size n of the matrix is updated with n = n * nfact.

perftable :

a m-by-3 matrix of doubles, the performances.

perftable(k,1) :

size of the matrix for experiment #k

perftable(k,2) :

wall clock time for experiment #k

perftable(k,3) :

number of megaflops achieved for experiment #k

Description

This function allows to measure the performance of the backslash operator when the number of unknown is equal to the number of equations. It measures the performance of the Gaussian elimination with row pivoting algorithm from Lapack. This test is often refered to as the "LINPACK" benchmark, but Scilab uses LAPACK.

This function may generate an error in the case where Scilab is ouf of stack memory.

To measure the performance we count the number of megaflops as (2/3*n^3 + 2*n^2)/t/1.e6, where n is the size of the matrix. The wall clock time is measured with the tic and toc functions.

The algorithm starts with a matrix size equal to n = 1. Then the matrix size is updated, by multiplying n by nfact.

For large matrices, the backslash test may fail, because the backslash operator wrongly switches to a least squares computation algorithm, instead of keeping on the Gaussian elimination. This is bug #7497 : http://bugzilla.scilab.org/show_bug.cgi?id=7497

Any argument equal to the empty matrix [] is replaced by its default value.

Examples

lines(0);
stacksize("max");
scf();
perftable = scibench_backslash ( )
// Do not print a message
scibench_backslash ( %f );
// Do not create the graph
scibench_backslash ( %t , %f );
// Set timemin
perftable = scibench_backslash ( [] , [] , 0.1 )
// Set timemax
perftable = scibench_backslash ( [] , [] , [] , 2 )
// Set nfact
perftable = scibench_backslash ( [] , [] , [] , [] , 1.5 )

Bibliography

"Programming in Scilab", Michael Baudin, 2010, http://forge.scilab.org/index.php/p/docprogscilab/downloads/

"Linear algebra performances", http://wiki.scilab.org/Linalg_performances

"Benchmarks: LINPACK and MATLAB - Fame and fortune from megaflops", Cleve Moler, 1994

Authors

<< scibench_overview Benchmark Toolbox scibench_benchfun >>