Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
6621 Discussions

DGESVD returning wrong singular values (and poor efficiency) for some values of lwork

New Contributor I

I've attached some fortran test code for which ZGESVD is returning the wrong singular values and also exhibiting poor efficiency for some values of lwork.  I'm using linux with MKL 11.3.1 Product Build 20151021.  I've also observed the bug under Windows as well.  I'm using 8-byte integers and the ILP64 libraries.

The test matrix is an identity matrix whose singular values should be all one.  

When I use an lwork value as the minimum value suggested by the LAPACK documentation everything works fine and is fairly efficient.  If I use the value of lwork returned by an lwork=-1 query, the singular values are not all one and the SVD is much slower than the first case.  I used a third value of lwork between the optimum value and the minimum value and the SVD routine took so long that I stopped the simulation.  

My compile line is

     ifort -i8 -module . test.F90 -L$INTEL_MKL_LIBS -liomp5 -lmkl_intel_ilp64 -lmkl_core -lmkl_intel_thread -lpthread -lm

The output I observe from the test program is

OpenMP:                      0
 Intel(R) Math Kernel Library Version 11.3.1 Product Build 20151021 for Intel(R)
  64 architecture applications

 SUM:  (5868.00000000000,0.000000000000000E+000)
 Starting SVD TRY 1                  5868                  5868
 LWORK :                 17604
 Condition #:    1.00000000000000
 Done with SVD TRY 1
 Starting SVD TRY 2                  5868                  5868
 LWORK :                645480
 Condition #:    10.6534147285328
 Done with SVD TRY 2
 Starting SVD TRY 3                  5868                  5868
 LWORK :                 58680
^Cforrtl: error (69): process interrupted (SIGINT)


0 Kudos
2 Replies

Hi John, 

thanks for the report. I can reproduce the two problems. We will investigate them and update you soon. 



New Contributor I
Ying, Thanks for looking into this. I apologize for the double post. It's ok to reply to only of them. John