Community
cancel
Showing results for
Did you mean:
Highlighted
Beginner
160 Views

## Input parameter error in MKL zfeast_hcsrgv function

Hi community,

I'm trying to use the zfeast function according with the EIGEN library to solve a generalized eigenvalue problem. However I met some input parameter errors.

Let's denote the generalized eigenvalue problem as M*x=lambda*B*x. For the hermitian matrix M, it is the coefficient matrix from finite difference method and  I reserved 25 non-zero elements in each row, although some of the reserved elements might be zero for certain rows. For the fourth input, ia, whose description is:

Array of length n+1, containing indices of elements in the array a, such that ia[i-1] is the index in the array a of the first non-zero element from the row i . The value of the last element ia[n] is equal to the number of non-zeros plus one.

Here the array a is the CRS format storage of the non-zero elements in M. Since I reserved each row 25 non-zero elements, ia[0] = 0 and ia[1] = 25. However, I got the following error message:

***Input check: i=1, ia<i>=0, ia<i+1>=25 are incompatible.

==> INFO code =: -104

Intel MKL ERROR: Parameter 4 was incorrect on entry to zfeast_hgsrgv.

Could anyone help to clarify what's going on here? In my opinion the input array ia is as expected, but somehow I still got this error message. Any kind of feedback would be greatly appreciated.

Thanks!

Sincerely,

Boyuan

4 Replies
Highlighted
Employee
160 Views

Hi Boyuan,

Best regards,
Maria

Highlighted
Beginner
160 Views

Zhukova, Maria (Intel) wrote:

Hi Boyuan,

Best regards,
Maria

Thanks Maria! Did you mean add a dummy number as the first element in arrays a, ia and ja ( as well as b, ib, jb) ?

Boyuan

Highlighted
Employee
160 Views

Hi Boyuan,
Sorry I wasn't clear.

No, I meant starting counting elements of the matrix (and start your ia array) from 1 not from 0, so that for instance your ia array should look like: ia[0] = 1, ia[1] = 25 + 1, ..., ia[num_rows] = nnz + 1.
Same applied to ja.

Best regards,
Maria

Highlighted
Beginner
160 Views

Zhukova, Maria (Intel) wrote:

Hi Boyuan,
Sorry I wasn't clear.

No, I meant starting counting elements of the matrix (and start your ia array) from 1 not from 0, so that for instance your ia array should look like: ia[0] = 1, ia[1] = 25 + 1, ..., ia[num_rows] = nnz + 1.
Same applied to ja.

Best regards,
Maria

Hi Maria,

Thanks for the clarification.

I added 1 on all elements in ia and ja except ia[num_rows] ( same to ib and jb). I think the previous info = -104 problem is solved. However, I met a new problem.

I used the following codes to achieve adding 1 on each element in ja

for (int i = 0; i < nonzerosM; i++) {
*(M_Inner + i) = *(M_Inner + i) + 1;

}

where M_Inner is the pointer generated by EIGEN which can be thought as the ja here. After I implement the above codes, I got the error message when calling the function zfeast:

Exception thrown at 0x03F1E1B6 (mkl_core.dll) in TestProj.exe: 0xC0000005: Access violation writing location 0x0052A240. occurred

If I omit these lines, there is no problem when calling zfeast but only with info = -105 which indicates that ja is in wrong format. In other words, the similiar adding 1 procedure on ia, ib and jb don't cause this access violation problem. It only happens when I try to manipulate ja.

I searched on Google, but since I'm kind of new to C++, I still can't solve this problem. Is there any suggestions you might want me to try?

I truly appreciate your kind help.

Sincerely,

Boyuan