Community
cancel
Showing results for 
Search instead for 
Did you mean: 
jinming_g_
Beginner
82 Views

segfault: adapted code from mkl 11.3.0 example, LLS routine: lapacke_sgels_row.c

the attached code is just simply modified matrix size from original example: size of matrix and how they are initialized. --the size: M, N and NRHS: 15000 150 1 when build with options from: https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor, as: gcc -DMKL_ILP64 -m64 -I${MKLROOT}/include lapacke_sgels_row.c -Wl,--no-as-needed -L${MKLROOT}/lib/intel64 -lmkl_intel_ilp64 -lmkl_core -lmkl_sequential -lpthread -lm run ./a.out Segmentation fault (core dumped) but it builds and runs ok if change the size: M,N,NRHS to: 14000 140 1 there is no extra dynamic memory allocation, no out-of bound array/matrix access in the source code. Does the sgels routine have any size limit? --------note: the mkl build used: Major version: 11 Minor version: 3 Update version: 0 Product status: Product Build: 20150730 Platform: Intel(R) 64 architecture Processor optimization: Intel(R) Supplemental Streaming SIMD Extensions 3 (Intel(R) SSSE3) enabled processors the gcc used: gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4 Copyright (C) 2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. the MKLROOT and LD_LIBRARY_PATH have been set as default based on installation: export MKLROOT=/opt/intel/compilers_and_libraries_2016.0.109/linux/mkl export LD_LIBRARY_PATH=/opt/intel/compilers_and_libraries_2016.0.109/linux/mkl/lib/intel64
0 Kudos
4 Replies
jinming_g_
Beginner
82 Views

note: it doesn't seem due to memory limit of the computer: on one Linux box, run cat /proc/meminfo there is still >1GB memory free/available
Gennady_F_Intel
Moderator
82 Views

>> Does the sgels routine have any size limit?  

no, sgels doesn't have limit for such tiny case. We will check the case on our side. 

 

 

Gennady_F_Intel
Moderator
82 Views

looking at your example - you allocate the working arrays at the stack. That's the problem. Pls  allocate the working arrays dynamically. there are many ways to do that. you may try to use mkl_malloc ( *, *) routine. 

jinming_g_
Beginner
82 Views

Thanks Gennady Fedorov! yeah, the default stack size isn't enough for such array allocation -- problem solved.
Reply