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,979件の閲覧回数

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,741件の閲覧回数

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

元の投稿で解決策を見る

5 返答(返信)
bopeng
従業員
1,925件の閲覧回数
    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
VidyalathaB_Intel
モデレーター
1,874件の閲覧回数

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.



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

Khang_N_Intel
従業員
1,717件の閲覧回数

Hi Bo,


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


Thanks,

Khang


Khang_N_Intel
従業員
1,691件の閲覧回数

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


返信