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

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

jinming_g_
Beginner
813 Views
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
813 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
0 Kudos
Gennady_F_Intel
Moderator
813 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. 

 

 

0 Kudos
Gennady_F_Intel
Moderator
813 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. 

0 Kudos
jinming_g_
Beginner
813 Views
Thanks Gennady Fedorov! yeah, the default stack size isn't enough for such array allocation -- problem solved.
0 Kudos
Reply