[SOLVED] blas / lapack completeness and correctness

option, parallelism,...

Moderators: fgoudreault, mcote

Forum rules
Please have a look at ~abinit/doc/config/build-config.ac in the source package for detailed and up-to-date information about the configuration of Abinit 8 builds.
For a video explanation on how to build Abinit 7.x for Linux, please go to: http://www.youtube.com/watch?v=DppLQ-KQA68.
IMPORTANT: when an answer solves your problem, please check the little green V-like button on its upper-right corner to accept it.
Locked
mverstra
Posts: 655
Joined: Wed Aug 19, 2009 12:01 pm

[SOLVED] blas / lapack completeness and correctness

Post by mverstra » Tue Apr 20, 2010 1:03 am

some versions of publically available blas / lapack are either incomplete or buggy, and could be tested for fairly simply in the configure stage

1) on mac OSX but also some ifort, the zdotc has a problem, and returns garbage (a simple loop on the side shows it is false)

2) some versions of mkl (at least 9.1 to my knowledge) do not provide ilaver (and possibly other routines). A small conftest with this call would be nice. Matteo now uses ilaver in some module somewhere...

Matthieu
Matthieu Verstraete
University of Liege, Belgium

User avatar
gmatteo
Posts: 291
Joined: Sun Aug 16, 2009 5:40 pm

Re: blas / lapack completeness and correctness

Post by gmatteo » Tue Apr 20, 2010 3:44 am

mverstra wrote:some versions of publically available blas / lapack are either incomplete or buggy, and could be tested for fairly simply in the configure stage

1) on mac OSX but also some ifort, the zdotc has a problem, and returns garbage (a simple loop on the side shows it is false)


I usually use the overloaded interface xdotc defined in m_blas when I want a complex scalar product.
Therefore one can wrap the intrinsic DOT_PRODUCT instad of the blas version If the configure stage reported that
the blas version is buggy.

mverstra wrote:2) some versions of mkl (at least 9.1 to my knowledge) do not provide ilaver (and possibly other routines). A small conftest with this call would be nice. Matteo now uses ilaver in some module somewhere...


ilaver has been removed in v6.1.1. It makes life easier but it causes a lot of portability problems
since some (crappy) Lapack implementations do not provide it
M

User avatar
pouillon
Posts: 651
Joined: Wed Aug 19, 2009 10:08 am
Location: Spain
Contact:

Re: blas / lapack completeness and correctness

Post by pouillon » Tue Apr 20, 2010 3:55 pm

For 1), just send me a simple program that triggers the problem and I'll add it into the build system. It will define HAVE_LINALG_ZDOTC_BUG.

For 2), I'll add a little test that defines HAVE_LINALG_ILAVER.

Please tell me if this is what you want.
Yann Pouillon
Simune Atomistics
Donostia-San Sebastián, Spain

User avatar
gmatteo
Posts: 291
Joined: Sun Aug 16, 2009 5:40 pm

Re: blas / lapack completeness and correctness

Post by gmatteo » Tue Apr 20, 2010 4:23 pm

HAVE_LINALG_ILAVER is not needed as ilaver is not called anymore.

User avatar
gmatteo
Posts: 291
Joined: Sun Aug 16, 2009 5:40 pm

Re: blas / lapack completeness and correctness

Post by gmatteo » Fri May 14, 2010 7:48 pm

It seems that only CDOTC, CDOTU, ZDOTC, and ZDOTU are problematic
when Mac OS X's Vec lib is used.
See http://developer.apple.com/hardwaredriv ... rrata.html.

In my branch I've introduced two new CPP flags
HAVE_LINALG_ZDOTC_BUG
HAVE_LINALG_ZDOTU_BUG

The overloaded interface (xdotc and xdotu) will fall back
to a plain Fortran implementation if the functions provided
by the external library are problematic.
After this change, almost all the tests in the GW test suite passed on my mac.
Only wannier90_t03 failed, but I don't know if the failure is related to blas.

I've also tried the wrappers suggested in the link above
but it didn't work on my mac 10.6.3
gfortran supports the hpf extension %val() but I got
an undefined reference during the lik of the clib wrappers.
I'm completely new to Mac OS, but I will try to understand
what's wrong in my environment.

For the time being, one has to define manually the CPP flags
in abi_common.h. However these flags should be defined during the configuration
of the package. I can provide simple F90 tests if not yet done, just let me know.

Matteo

mverstra
Posts: 655
Joined: Wed Aug 19, 2009 12:01 pm

Re: blas / lapack completeness and correctness

Post by mverstra » Sat May 15, 2010 8:42 am

Unfortunately it's not only MacOSX, but some versions of blas/lapack bundled with old RHEL distros are bad as well. And a _lot_ of people still have these crappy old RHE versions. Being conservative is good for stability, but not fixing bugs is borderline ridiculous.

Great, so we have the macros set. Thanks!

Matthieu
Matthieu Verstraete
University of Liege, Belgium

Locked