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

LAPACKE_dgesvd crashes

steffenroeber
Beginner
387 Views
Hi,
I tried using the LAPACKE_dgesvd function, but it crashes for matrices larger than 30x30. Is this a known bug?
[cpp]    
    int M = i_A.getColumnCount();
    int N = i_A.getRowCount();
    int lda = i_A.getColumnCount();
    int ldu = i_A.getColumnCount();
    int ldvt = i_A.getRowCount();
    static float64 superb[100];
    LAPACKE_dgesvd(LAPACK_ROW_MAJOR, 'A', 'A', M, N, &A(0, 0), lda, &o_W(0, 0), &o_U(0, 0), ldu, &o_VT(0, 0), ldvt, superb);
[/cpp]

This piece of code works well for small matrices. I fill I_A with random numbers. For dimensions like 35x35 or 100x100 LAPACKE_dgesvd does not return and CPU stays at 100%.
0 Kudos
5 Replies
Gennady_F_Intel
Moderator
387 Views
Hi,
No it an unknow bug.
Would you please give us the test for checking the problem on our side?
--Gennady
0 Kudos
mecej4
Honored Contributor III
387 Views
> Is this a known bug?

It is not a bug until shown to be one. Most of the time when an MKL bug is suspected, it turns out to that the function arguments are not correct or a required interface has not been used.

Many of the arguments in your call to LAPACKE_dgesvd do not have declarations shown. Nor have you shown how the array(s) were filled.

Furthermore, when performing difficult calculations such as eigenvalue or singular value determination on large matrices, applying the calculation to a matrix filled with random numbers is perhaps a waste of time.

Please show a complete example to be compiled and run, demonstrating the claimed bug.
0 Kudos
steffenroeber
Beginner
387 Views
Hi,
I have a very strange behaviour. I I write the following code in a new empty c++ project all works fine.
[cpp]#include "stdafx.h"
#include 

#pragma comment(lib, "C:/Programme/Intel/Composer XE/mkl/lib/ia32/mkl_core.lib")
#pragma comment(lib, "C:/Programme/Intel/Composer XE/mkl/lib/ia32/mkl_intel_c.lib")
#pragma comment(lib, "C:/Programme/Intel/Composer XE/mkl/lib/ia32/mkl_intel_thread.lib")
#pragma comment(lib, "C:/Programme/Intel/Composer XE/compiler/lib/ia32/libiomp5md.lib")
#include "mkl_lapacke.h"
int main(int argc, char* argv[])
{
  const int size = 200;
  double A[size*size];
  int k = 0;
  for (int i = 0; i < size; ++i)
  {
    for (int j = 0; j < size; ++j, ++k)
    {
      A = k;
    }
  }
  double U[size*size];
  double V[size*size];
  double W[size];
  int M = size;
  int N = size;
  int lda = size;
  int ldu = size;
  int ldvt = size;
  double superb[size];
  int r = LAPACKE_dgesvd(LAPACK_ROW_MAJOR, 'A', 'A', M, N, A, lda, W, U, ldu, V, ldvt, superb);

	return 0;
}[/cpp]
But if I use the same code in my other app, the lapack routine does not return for sizes > 30. And the CPU raises to 100%. The same routine without MKL (default BLAS) work in both cases. Could there be anything that MKL does not like?
0 Kudos
Gennady_F_Intel
Moderator
387 Views
I checked how it works with the latest 10l3 Update6 version and didn't see the problem.
I don't like the idea to statically allocate the working arrays like you shown. it may caused crashes while calling the mkl's routines.
0 Kudos
steffenroeber
Beginner
386 Views
I only did the static allocation in this example. In my app I use Matrix classes. But this makes no difference. In this example app it works, in my app not. Could it be that mkl and ipp 6.1 or any other library do influence to each other, so that mkl hangs?
0 Kudos
Reply