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

Program aborting in DGEMM, complaining that memory cannot be allocated

crtierney42
New Contributor I
1,039 Views
I am trying to use DGEMM in MKL and my code is segfaulting. I am getting
the following error:

cannot allocate memory for thread-local data: ABORT

System configuration:

Intel ifort: 10.1.012
Intel MKL: 10.0.1.014
OS: Linux Redhat Enterprise 4.4 (upgraded to stock 2.6.20.20 kernel)
glibc: 2.3.4

I am linking with:

-L/opt/intel/mkl/10.0.1.014/lib/em64t -lguide -lpthread -lmkl

athough I don't want the parallel version. The call to dgemm is buried in
an MPI program.

The values of M,N,K are approximately 95, 1030, and 64 respectively (they vary a little between MPI tasks).

Any ideas what is causing this error message?

Thanks,
Craig

0 Kudos
3 Replies
TimP
Honored Contributor III
1,039 Views
If you don't want the threaded MKL, link with the mkllp64, core, and sequential libraries. For the threaded version, you may need to increase thread stack size by the kmp_stacksize environment variable or library subroutine call.
0 Kudos
crtierney42
New Contributor I
1,039 Views
Thanks for the tip. I tried linking with:

-L/opt/intel/mkl/10.0.1.014/lib/em64t -lmkl_core -lmkl_sequential -lmkl_intel_lp64

And verified that the executable was using the correct libraries. I still get the error message. My stacksize (via limit) is set to unlimited.

I found a reference on a NCSA that the problem can be alleviated by statically linking the libraries. So I am trying to link the libraries statically. I am trying to link libmkl_sequential.a,libmkl_intel_lp64.a, and libmkl_core.a to my executable. However,
the linker complains that dgemm_ is not found. I have tried moving libmkl_core.a to the front of the list, but this didn't help.

What is the proper order for linking?

Thanks,
Craig

0 Kudos
TimP
Honored Contributor III
1,039 Views

There are examples of static link in the notes in /doc/ showing how to use -Wl,--begin-group .... -Wl,--end-group. This depends on your compiler and binutils being sufficiently up to date. It didn't work consistently with Intel compilers until 10.1.012. Otherwise, you have to list libmkl_intel_lp64.a libmkl_core.a libmkl_sequential.a (full path names) 3 times to resolve circular dependencies, more times if out of order. I think of lp_64 or ilp64 as the one with the interfaces you call in your code, and mkl_sequential as the one which stubs out OpenMP library calls, as a way to remember the order.

0 Kudos
Reply