We recently encountered a rather strange issue when passing denormal numbers in the right-hand-side matrix to ZGETRS. Attached is a small C++ file that reproduces this error.
In this file, we set up a left- and right-hand-side matrix, factorize the lhs with ZGETRF and then call ZGETRS. Before and after the call to ZGETRS, we call the standard math fmod function with some arbitrary numbers. The call to fmod that happens before the ZGETRS call works as expected. The call afterwards however returns nan, regardless of what numbers are passed.
If the denormal numbers from the right-hand-side matrix are set to 0 instead (e.g. by uncommenting the call to _MM_SET_FLUSH_ZERO_MODE), the fmod function works as expected both times.
This issue has been reproduced on two Windows machines with the following configuration:
Operating System: Windows 7 x64
MKL: 11.2 (64bit version from Composer XE 2015)
Compiler: MSVC 9.0 (Visual Studio 2008)
Attached file compiled with: cl.exe /EHsc main.cpp /I"%MKLROOT%\include" /link -LIBPATH:"%MKLROOT%\lib\intel64" mkl_intel_lp64_dll.lib mkl_sequential_dll.lib mkl_lapack95_lp64.lib mkl_core_dll.lib