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

DCOPY failing on Linux

AndrewC
New Contributor III
1,287 Views
I have some well tested FORTRAN code (ARPACK) that I use with MKL 9.0 on Windows and OS X. I have been having problems on RHEL 4 on em64T - the code is running in 32-bit mode.


call dcopy (n, resid, 1, workd(irj), 1)
It seems somewhat bizarre, but this call to dcopy fails to copy element resid(9) into the workd(irj) array correctly leaving a NAN in the workd(irj+8)

From the Intel debugger , here are the values after the call. Note the NAN value of workd(23), but other values were copied correctly.

(idb) print n
14
(idb) print resid(9)
0.00060894080186124633
(idb) print workd(irj+8)
nan
(idb) print irj
15

Some other values...

(idb) print resid(1)
0.00036273709783252173
(idb) print workd(irj)
0.00036273709783252173
(idb) print workd(irj+13)
4.3187914434694719e-05
(idb) print resid(14)
4.3187914434694719e-05

Setting a memory watch point on the variable shows MKL copying what looks like garbage data into the variable.

(idb) print &workd(23)
0x80afa38
[2] Address 0x080afa38 was accessed at:
function mkl_blas_dcopy(...)
[0xf2cb9761] mkl_blas_dcopy+0x1b1: fstpl (%ebp)
0x080afa38: Old value = 0xbff568517ad130c3
0x00000000: New value = 0xfff8000000000000

Anyone got a clue? This has been a debugging nightmare.

0 Kudos
3 Replies
Intel_C_Intel
Employee
1,287 Views

Well, I just tried out all copies from 1 to 10 and they all worked. But the environment was not identical. What is the size of n? What are the values of resid(1):resid(9)? Same for workd.

Bruce

0 Kudos
AndrewC
New Contributor III
1,287 Views
Hi,
This has turned out to be a very strange problem.I am building a 32 bit Linux tool on 64 bit linux .When I rebuilt everything as a 64-bit , the problem disappeared.
( using ifort 9.1, icc 9.1 and MKL 9.0)
I suspect compiler problems

To answer your question, all the values in the array were copied correctly , except the one entry.
0 Kudos
Intel_C_Intel
Employee
1,287 Views

So is everything OK as far as MKL is concerned?

Bruce

0 Kudos
Reply