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

pardiso_schur.c with MKL_PARDISO, segment fault

bopeng
Employee
1,203 Views

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 Kudos
1 Solution
Kirill_V_Intel
Employee
965 Views

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

View solution in original post

0 Kudos
5 Replies
bopeng
Employee
1,149 Views
    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 Kudos
VidyalathaB_Intel
Moderator
1,098 Views

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 Kudos
Kirill_V_Intel
Employee
966 Views

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 Kudos
Khang_N_Intel
Employee
941 Views

Hi Bo,


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


Thanks,

Khang


0 Kudos
Khang_N_Intel
Employee
915 Views

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 Kudos
Reply