ZHBEVD returns a wrong space size on query

ZHBEVD returns a wrong space size on query

Hi,
I have a code that uses ZHBEVD. I try linking it with either a generic version of LAPACK or with MKL. The exact same code, linked with either library does not give the same workspace sizes.

With the generic version of LAPACK, I get :
lwork: 162
lrwork: 208
liwork: 48

With MKL, I get :
lwork: 162
lrwork: 208
liwork: 210453397552

This last liwork size obviously produces a bad_alloc error and terminates the program.

Not sure if this is the right place to submit this, but here it is.

5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Could you attach the example of the code you use?see this link how to attach file to forum post.
--Gennady

Hi,
Yes, here is a sample code. The included headers are not the ones provided with MKL, but rather the clapack ones. It should however not matter other than calling the types by different names.

Here is the output of the program :
[mboisson@ip12 demo]$ ./demo_exe_test_zhbevd.out
Content of the matrix:
(0,0)
(0,0)
(-0.1,0)
(0,0)
(-0.141421,0)
(0,0)
Before workspace query
jobz:V
uplo:U
n:3
kd: 1
ldab: 2
lwork: -1
lrwork: -1
liwork: -1
info: 0
After workspace query
jobz:V
uplo:U
n:3
kd: 1
ldab: 2
lwork: 18
lrwork: 34
liwork: 210453397522
info: 0
terminate called after throwing an instance of 'std::bad_alloc'
what(): St9bad_alloc
Aborted

Attachments: 

AttachmentSize
Downloadtext/x-c++src demo_exe_test_zhbevd.cpp2.35 KB

Oh, and the MKL version that is used is mkl64/10.1.3.027

Hello,

If you use libmkl_intel_lp64.a for linking you should change the line typedef long int integer; to typedef int integer; in file f2c.h.

Or you should use libmkl_intel_ilp64.a for correct result because sizeof (long int) = 8 byte for Linux and 64-bit x86-64.

Below my output result with libmkl_intel_ilp64.a:

Content of the matrix:

(0,0)

(0,0)

(-0.1,0)

(0,0)

(-0.141421,0)

(0,0)

Before workspace query

jobz:V

uplo:U

n:3

kd: 1

ldab: 2

lwork: -1

lrwork: -1

liwork: -1

info: 0

After workspace query

jobz:V

uplo:U

n:3

kd: 1

ldab: 2

lwork: 18

lrwork: 34

liwork: 18

info: 0

Leave a Comment

Please sign in to add a comment. Not a member? Join today