- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OS: Ubuntu 18.04.2 server, kernel 4.15.0-50-generic. MKL provided by intel parallel studio xe 2019.3.
The C code reproducing the error
#include <stdlib.h> #include <stdio.h> #include <mkl.h> #define N 1021 int main(){ printf("begin main\n"); double m,a[N*N]; lapack_int n1=N, n2=N; for(size_t i=0;i<N*N;i++){ if(i%(N+1)==0){ a=(double) rand()/RAND_MAX; } else {a=0;} } lapack_int info; printf("begin lapack\n"); info = LAPACKE_dsyevd(LAPACK_ROW_MAJOR, 'V','U', n1, a, n2, m); printf("%d: end lapack\n", info); return 0; }
This code gave correct results for matrix smaller than 1020*1020, while gave Segmentation fault when N>1020. The error persists for icc, gcc, linking options as simple as -mkl for icc or full linking and compiling options as advised by linking advisor. dsteqr routine seems have similar issues.
I am new to directly using lower level routines in MKL, so there may also be some problems in my code above. Though it works well for smaller matrix.
Thanks in advance.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have solved the issue. It is because the default soft limit on stack size is too small for declaring large array in main function(stack). Just try `ulimit -s unlimited`, everything works fine then.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page