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

Out of space in MKL

erling_andersen
New Contributor I
1,227 Views
What happens if MKL cannot allocate space for internal buffers.
Does it crash?
Does it use a simple version that does not require any buffers?
Is there anyto know if MKL ran out of buffer space?
Is this documented anywhere?
Erling
0 Kudos
8 Replies
barragan_villanueva_
Valued Contributor I
1,227 Views
Hi,

In case of memory allocation problems for internal buffers, MKL reports this
- via XERBLA function call (for some components like BLAS, LAPACK, etc.)
- or by returning corresponding error if return code is supported for a MKL function
0 Kudos
erling_andersen
New Contributor I
1,227 Views
Does that mean if it runs out of space the result is invalid. Or does it compute the result by a simpler method requiring no extra space?
[I have been on vacation and therefore could not reply before.]
0 Kudos
barragan_villanueva_
Valued Contributor I
1,227 Views
Does that mean if it runs out of space the result is invalid.
Or does it compute the result by a simpler method requiring no extra space?

If MKL functioncalls XERBLA or retuns error code on user levelthen calculations are aborted and function result is invalid. However, in some cases MKL functions can or coulduse different implementations depending on available resources.
0 Kudos
erling_andersen
New Contributor I
1,227 Views
XERBLA is described at
http://software.intel.com/sites/products/documentation/hpc/mkl/mklman/GUID-F3536B0B-2FA0-40B4-AF9B-51A182827F73.htm
and it only talks abour arguments being invalid. So that is not very relevant for this discussion.
What do you mean by returning an error code. To my knowledge for instance dgemm cannot return an error code.
Let me be more precise. Assuming all the arguments to dgemm are correct. Is there then any way it can fails?
[For instance due to lack of buffer space.]
0 Kudos
Nadezhda_M_Intel
Employee
1,227 Views
Hi,
You are right, implementation of XERBLA in MKL differ from Netlib implementation and user can get additional messages(not only invalid arguments warning).
For xerbla( srname, info, len )
Additional values for info parameter are
1000 "MKL INTERNAL ERROR: Not enough work memory in function %s."
1001 "MKL ERROR: Incompatible optional parameters on entry to %s."
In documentation we don't have this information yet.
Let me be more precise. Assuming all the arguments to dgemm are correct. Is there then any way it can fails?
[For instance due to lack of buffer space.]
You got or error message orit compute the result by a simpler method. You were right
0 Kudos
erling_andersen
New Contributor I
1,227 Views
So if you call say dgemm from multiple threads threads you will not know in which thread it failed? Right?

If the answer is yes, then you have to conclude all dgemms failed in order to be safe.

[I know you did not design BLAS, but it make it very hard to build rock solid applications.]
0 Kudos
Henrik_A_
Beginner
1,227 Views
Wouldn't MKL call the error function from the thread that failed, and you could check which thread it was by calling GetCurrentThreadID()?
0 Kudos
barragan_villanueva_
Valued Contributor I
1,227 Views
Standard XERBLA will not provide such info.
However, you can redefine it with your own XERBLA and see thread-id
0 Kudos
Reply