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

Error: On entry to ZLASCL parameter number 4 had an illegal value

missing__zlw
Beginner
2,272 Views
I have a program which runs fine in single thread mode. But when I run in multithread mode, using TBB, I got the following error:
On entry to ZLASCL parameter number 4 had an illegal value

Any suggestion?

I am running MKL method in single thread mode, the multithreading is done at upper level around the znaupd method.

This is from function call to znaupd. Which parameter from znaupd will map to the 4th parameter of zlascl ?

It will take some effort to get example code from my real project. If that is necessary, please let me know.
0 Kudos
2 Replies
Gennady_F_Intel
Moderator
2,272 Views
zhulaurawang,
please give us the reproducer of this problem.
--Gennady
0 Kudos
Alexander_K_Intel3
2,272 Views
Hello,

ZLASCL reports that parameter number 4 has an illegal value in case if CFROM is equal to zero and has a NaN value inside.

znaupd is an ARPACK function. Call toZLASCL appears at call tree znaupd->znaup2->-znaitr->zlascl. 4th parameter to ZLASCL is rnorm which is defined and calculated insideby call fromznaup2 to zgetv0.

I could assume that you are trying to run the ARPACK code in parallel from several threads at a moment. UnfortunatelyARPACK is not designed in thread safe way. It is written in Fortran andhas variables with SAVE attribute inside (equivalent to static in C), which keeps theirvalues between function calls.Several threads couldn't operate on such variables at the same time in a safe way because such threads will share the same memory location.

If this is the case, then to avoid the problem you need force in your code that only one thread at a moment calls ARPACK (you could use several threads only for different functions calls and if trees of subcall of such functions do not intersect on functions which contains variables with SAVE attribute). You could also try to modify ARPACK to be thread safe (or find one). MKL is thread safe already.

Good luck,
Alexander
0 Kudos
Reply