Re: Who uses clapack?

From: Bart Oldeman (bartoldeman_at_NOSPAMihug.co.nz)
Date: 12/11/04


Date: Sat, 11 Dec 2004 18:23:20 +1300

Victor Eijkhout wrote:
> The authors of lapack/scalapack are starting to work on a new release of
> these packages. One of the things we want to address is the sillyness
> that C users, instead of linking to the binaries of the Fortran version,
> use an automatically translated C version.
>
> Therefore we'd like to know precisely what the reasons for this are.

What's in a name?

At netlib there is cblas and there is clapack.
They both prepend c in front of the name but are worlds apart.
A bit confusing. If you make clapack like cblas it would be a lot less
confusing.

There may be a couple reasons for using clapack I can think of:
a) no f77 compiler available
b) "go for the name"
c) developers not knowing how to interface C and Fortran
    (on *nix platforms autoconf >= 2.50 does a nice job at this,
     GNU octave uses that)

a) may be quite rare nowadays but I just saw a post from an embedded
developer. b+c are in the programmer's mind.

Personally I looked at clapack a couple of years ago, and rejected it
because it doesn't give any clear advantages (same interface but
slower), so linked straight to LAPACK Fortran.

But the interface could be nicer, as you said with a glueing interface
like cblas. I have code like this:

     {
       /* schur decomposition of LL */
       double *wr = malloc(M * sizeof(*wr));
       double *wi = malloc(M * sizeof(*wi));
       double *vs = malloc(M * M * sizeof(*vs));
       double *work = malloc(M * M * M * sizeof(*work));
       int *bwork = malloc(M * sizeof(*bwork));
       int lwork = M * M * M;
       int sdim, info;
       dgees_("V", "S", (i==0?select_pos:select_neg), &M, LL, &M, &sdim,
               wr, wi, vs, &M, work, &lwork, bwork, &info);
       free(wr);
       free(wi);
       free(work);
       free(bwork);
       /* right now we have the Schur matrix vs, sdim is dim eigenspace*/

Having a nicer way to call dgees_() would be nice.

ATLAS offers a few lapack functions (not dgees though) so you can extend
that I suppose.

Having to pass values by references just feels strange in C. Row vs
column major can often be worked around using a bit of maths and
transposing matrices (as in cblas).

Bart



Relevant Pages

  • Re: Why I cant find zgesvd in clapack.h
    ... I do not know much about clapack becaue I prefere to include ... When zgesvd is missing that's maybe because nobody needed it up ... you can use the clapack.h declarations as a pattern to create ... the argument list according to the man pages of lapack or the source ...
    (sci.math.num-analysis)
  • Re: Symmetric matrices only!
    ... Ada programming --http://www.mysunrise.ch/users/gdm/gsoft.htm ... What you can do is write an interface to the LAPACK routine _GEEV (or ... Duncan Sands produced bindings to BLAS and I extended some to cover ...
    (comp.lang.ada)
  • Re: interface definitions of BLAS
    ... Then go back to the module files and change the CONTAINS ... statement to an INTERFACE statement and put an END INTERFACE ... about LAPACK: f95's rules about TKR matching and LAPACK's ...
    (comp.lang.fortran)
  • Re: APL versu MatLab
    ... In a quick read I didnt see any mention of J. ... J has a good interface to LAPACK, ... much more of interest for engineering computing. ...
    (comp.lang.apl)
  • Re: Help me choose a programming language for a project
    ... The speed of numerics depends on using good numerical libraries. ... environments interface LAPACK. ... You can always interface different environments, ...
    (sci.math.num-analysis)