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

Get INFO CODE = -1 When Using zfeast_hcsrev

dongw
Novice
1,289 Views

Dear mkl developer:

Hi, I 'm trying to solve eigenvalues using zfeast_hcsrev. I wrote a simple test file and just gave a simple diagonal matrix but I got info code=-1. I compiled with the command "icpx -qmkl=sequential test.cpp"  on wsl2 with mkl version " 2023.1.0". And Here is my test file. I have tried to find the problem but

failed. Hope you can give me some suggestions

 

#include "mkl.h"

MKL_INT main(void) {

  char uplo = 'F';
  MKL_INT n = 8;
  double emin = 2.0;
  double emax = 5.0;
  MKL_INT m0 = 5;
  MKL_INT info;
  double epsout;
  MKL_INT loop, m;
  double *e = new double[m0];
  MKL_Complex16 *x = new MKL_Complex16[n * m0];
  double *res = new double[m0];

  MKL_INT rowptr[9] = {0, 1, 2, 3, 4, 5, 6, 7, 8};
  MKL_INT colidx[8] = {0, 1, 2, 3, 4, 5, 6, 7};
  MKL_Complex16 data[8] = {{1.0, 0.0}, {1.9, 0.0}, {3.0, 0.0}, {4.0, 0.0},
                           {5.2, 0.0}, {6.0, 0.0}, {7.0, 0.0}, {8.0, 0.0}};
  MKL_INT fpm[128];
  feastinit(fpm);
  fpm[0] = 1;

  zfeast_hcsrev(&uplo, &n, data, rowptr, colidx, fpm, &epsout, &loop, &emin,
                &emax, &m0, e, x, &m, res, &info);

  return 0;
}

 

0 Kudos
1 Solution
dongw
Novice
1,085 Views

The index of mkl csr matrix start with 1 not 0.   

View solution in original post

0 Kudos
2 Replies
dongw
Novice
1,086 Views

The index of mkl csr matrix start with 1 not 0.   

0 Kudos
Ruqiu_C_Intel
Moderator
1,024 Views

Hi Wangdong,

Good to know that you found the root cause in your test code. Thanks for sharing your observation here so that all other community users are aware of it and avoid future misuses.

 

Regards,

Ruqiu

0 Kudos
Reply