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

pardiso_schur.c with MKL_PARDISO, segment fault

bopeng
직원
1,980 조회수

Hi,

 

I met another issue when using the pardiso_schur.c

I am using oneAPI 2021.04 release.

/opt/intel/oneapi/mkl/latest/examples/c/sparse_directsolvers/source/pardiso_schur.c

 

I simply make a matrix A = I, with 80000x80000 size. b = 2.

Ax=Ix=b, x will be 2.

 

When the n_schur small than 825, it works well, x=2.

When the n_schur more than 826, it gives segment fault.

 

attached the diff I made, so you can reproduce it easily (the patch works well, because n_schur is 825, change n_schur variable to 826 will get a segment fault).

 

@Kirill_V_Intel 

 

0 포인트
1 솔루션
Kirill_V_Intel
1,742 조회수

Hi Bo!

 

Thanks for reporting this strange behavior!

I guess you meant "double" instead of "float" but anyway, I suspect something goes wrong because there is too much memory allocated using static arrays.

By default, stack size is likely limited by 10 Mb.

I've done a somewhat fuzzy check that if I do

ulimit -s 65536

to increase the stack size to 64 MB, the example passes without your fix. 

 

So, I'd say, example code is not very good as it is only suitable for small-sized matrices but not really faulty (since it should be functionally correct when the stack usage is within limits).

 

Best,
Kirill

원본 게시물의 솔루션 보기

0 포인트
5 응답
bopeng
직원
1,926 조회수
    float* schur = (float*)malloc(n_schur*n_schur*sizeof(float));
 
    phase = 22;
    pardiso(pt, &maxfct, &mnum, &mtype, &phase,
            &n, a, ia, ja, perm, &nrhs,
            iparm, &msglvl, &ddum, schur, &error);
 
 
 
 
use this will make it works, I think it is a bug? please confirm ...
 
Thanks,
Bo
0 포인트
VidyalathaB_Intel
중재자
1,875 조회수

Hi,


Thanks for reaching out to us.


We are able to reproduce the issue. We are looking into it, we will get back to you soon.


Regards,

Vidya.



0 포인트
Kirill_V_Intel
1,743 조회수

Hi Bo!

 

Thanks for reporting this strange behavior!

I guess you meant "double" instead of "float" but anyway, I suspect something goes wrong because there is too much memory allocated using static arrays.

By default, stack size is likely limited by 10 Mb.

I've done a somewhat fuzzy check that if I do

ulimit -s 65536

to increase the stack size to 64 MB, the example passes without your fix. 

 

So, I'd say, example code is not very good as it is only suitable for small-sized matrices but not really faulty (since it should be functionally correct when the stack usage is within limits).

 

Best,
Kirill

0 포인트
Khang_N_Intel
직원
1,718 조회수

Hi Bo,


Do you have any question on this issue since Kirill already discovered that it is a stack-size issue?


Thanks,

Khang


0 포인트
Khang_N_Intel
직원
1,692 조회수

Hi Bo,


Since you accepted Kirill solution, we will go close this thread. There will be no more communication on this thread. Should you have any other oneMKL-related questions, please open new threads.


Best,

Khang


0 포인트
응답