Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
6590 Discussions

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

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
please give us the reproducer of this problem.

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,