[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-gsl] About invalid parameters in cblas implementation

From: José Luis García Pallero
Subject: Re: [Help-gsl] About invalid parameters in cblas implementation
Date: Wed, 1 Jul 2009 20:30:17 +0200

El 30 de junio de 2009 22:15, Brian Gough <address@hidden> escribió:

> At Sun, 28 Jun 2009 17:26:39 +0200,
> José Luis García Pallero wrote:
> > Working with cblas_dgemv() function I can see various diferences between
> > refblas and gsl cblas implementations about invalid parameters. While in
> gsl
> > cblas the function only abort the execution because incorrect values in
> > "order" and "Trans" input parameters, in the refblas implementation the
> > function calls xerbla when M<0, N<0, LDA<max(1,M), incX==0 or incY==0 (in
> > this cases gsl cblas do not make operations and return). In the
> gsl_blas_*
> > wrapper this cases are not catched. This produces different executions if
> > you link your programs with gslcblas or refblas, lapack, atlas, etc. Are
> > these differences a known fact?
> Good point, I *think* I considered this issue at the time but I don't
> remember and may have overlooked these.  I will have to dig out the
> original BLAS paper and check whether the use of XERBLA was optional
> or part of the specification.

I'm a bit confused about the documentation of blas implementations. If you
use the complete document in, you can read
(in my opinion) different things.

Chapter 2 explains the basics for implementation from scratch the BLAS in
fortran 95, 77 and C. In pages 24-25, error handling is explained. It can be
performed by error coding in return variables or by stopping the execution
of the program. For example, is mandatory (unless otherwise is specified in
the detailed description of each routine) an error if vector increments are
equal to zero. The fortran 77 refblas, as you can get in,
do not perform this error checking in level 1, for example.

In appendix B, the cblas interface to fortran 77 refblas is explained. In
section B.2.9 says: "The C interface to the legacy BLAS must supply error
checking corresponding to that provided by the reference fortran 77 BLAS
implementation". This C wrapper calls fortran 77 routines which checks the
cited parameters in my first mail. This is the behaviour of the refblas and
in the blas and lapack libraries in Debian. I suppose that atlas and
gotoblas runs in the same manner.

But, in my opinion, the problem not is that the gsl cblas implementation
check for the same error than refblas. The problem is that, if you link your
code with no gsl cblas and you are using the returning codes in gsl for
checking errors, if a cblas function fails you cannot catch the exception
and the program stop (and the problem of not *freed*  memory)

José Luis García Pallero
/ / \
Use Debian GNU/Linux and enjoy!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]