linbox
Functions
benchmark-ftrXm.C File Reference

Benchmarking triangular matrix multiplication on finite fields. More...

#include "benchmarks/benchmark.h"
#include "linbox/util/error.h"
#include "linbox/field/modular.h"
#include "linbox/field/modular-balanced.h"
#include "fflas-ffpack/ffpack/ffpack.h"
#include "fflas-ffpack/fflas/fflas.h"
#include "linbox/matrix/random-matrix.h"
#include "linbox/matrix/blas-matrix.h"
#include "linbox/algorithms/blas-domain.h"

Functions

bool keepon (index_t &repet, Timer &tim, double maxtime=0.5)
 Watches a timer and a number and repet and signals if over.
bool whatchon (index_t &repet, Timer &tim, double maxtime=0.5)
 Watches a timer and a number and repet and signals if over.
template<class Field , bool LeftSide, bool UnitDiag, bool TriSup, bool tA>
void launch_bench_scalar (Field &F, int m, int n, const typename Field::Element &alpha, LinBox::PlotData< std::string > &Data, index_t point_nb)
void bench_square (index_t min, index_t max, int step, int charac)
 Benchmark square ftrmm for differenct parameters.
void bench_fields (index_t min, index_t max, int step)
 Benchmark square ftrmm for several fields.
void bench_blas (index_t min, index_t max, int step)
 Benchmark fgemm Y=AX for several sizes of sqare matrices.
void bench_rectangular (index_t k, int charac)
 Benchmark fgemm Y=AX for several shapes.
void bench_transpose (index_t k, int charac)
 Benchmark ftrmm with transpose or alpha parameters on.
int main (int ac, char **av)

Detailed Description

Benchmarking triangular matrix multiplication on finite fields.

This file benchmarks the FFLAS::ftrmm, FFLAS::ftrsm implementation for various fields, shape and parameters. Actually, we use the wrapper member mul of LinBox::BlasMatrixDomain.

Todo:

ftrmm has an 'alpha' but mul/mulin in BMd don't... That could be useful for $\alpha=-1$...

benchmark ftrsm too here.


Function Documentation

bool keepon ( index_t &  repet,
Timer &  tim,
double  maxtime = 0.5 
)

Watches a timer and a number and repet and signals if over.

We want at least 2 repetions but not more than maxtime spent on timing.

Parameters:
repetnumber of previous repetitions. Should be 0 on the first time whatchon is called.
timtimer to watch
maxtimemaximum time (in seconds) until watchon tells stop.
Returns:
true if we conditions are not met to stop, false otherwise.
Precondition:
tim was clear at the beginning and never started.
bool whatchon ( index_t &  repet,
Timer &  tim,
double  maxtime = 0.5 
)

Watches a timer and a number and repet and signals if over.

We want at least 2 repetions but not more than maxtime spent on timing.

Parameters:
repetnumber of previous repetitions. Should be 0 on the first time whatchon is called.
timtimer to watch
maxtimemaximum time (in seconds) until watchon tells stop.
Returns:
true if we conditions are not met to stop, false otherwise.
Precondition:
tim should have been started previously !
void launch_bench_scalar ( Field F,
int  m,
int  n,
const typename Field::Element &  alpha,
LinBox::PlotData< std::string > &  Data,
index_t  point_nb 
)
Parameters:
alpha
Warning:
not used yet.
void bench_square ( index_t  min,
index_t  max,
int  step,
int  charac 
)

Benchmark square ftrmm for differenct parameters.

Parameters:
minmin size
maxmax size
stepstep of the size between 2 benchmarks
characcharacteristic of the field.
void bench_fields ( index_t  min,
index_t  max,
int  step 
)

Benchmark square ftrmm for several fields.

Parameters:
minmin size
maxmax size
stepstep of the size between 2 benchmarks
characcharacteristic of the field.
void bench_blas ( index_t  min,
index_t  max,
int  step 
)

Benchmark fgemm Y=AX for several sizes of sqare matrices.

Parameters:
minmin size
maxmax size
stepstep of the size between 2 benchmarks
characcharacteristic of the field.

Todo:
compare to cblas_dgemm instead.

void bench_rectangular ( index_t  k,
int  charac 
)

Benchmark fgemm Y=AX for several shapes.

we test the following shapes :

  • (2k,2k):2k, 2k:(2k,2k)
  • (k,2k):2k, 2k:(2k,k)
  • (4k,2k):2k , 2k:(2k,4k)
Parameters:
kparameter.
characcharacteristic of the field.
lsmall parameter (ie close to 1)

Todo:
resize if it>nb !!
Todo:
make long legends oblique.

void bench_transpose ( index_t  k,
int  charac 
)

Benchmark ftrmm with transpose or alpha parameters on.

Parameters:
kparameter.
characcharacteristic of the field.
int main ( int  ac,
char **  av 
)

Todo:
use commentator.