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

Floating-point exception in dgeev

AndyMay
Beginner
300 Views

We have noticed since MKL 2024 that dgeev raises an exception. Here is a simple reproducer, passing in the unit matrix:

program test_dgeev
implicit none
double precision, allocatable :: a(:,:), wreal(:), wimag(:), Ur(:,:), Ul(:,:), work(:)
integer i, info, lwork, n
n=3
allocate(a(n,n))
a(:,:) = 0d0
do i=1,n
  a(i,i)=1d0
end do
allocate(wreal(n))
allocate(wimag(n))
allocate(Ur(n,n))
allocate(Ul(n,n))
lwork=-1
allocate(work(1))
call dgeev('V','V',n,a,n,wreal,wimag,Ul,n,Ur,n,work,lwork,info)
lwork=int(work(1))
deallocate(work)
allocate(work(lwork))
call dgeev('V','V',n,a,n,wreal,wimag,Ul,n,Ur,n,work,lwork,info)
deallocate(a,wreal,wimag,Ur,Ul,work)
end program test_dgeev

And this is the result:

> gfortran -ffpe-trap=zero -L/opt/intel/oneapi/mkl/latest/lib/intel64 -lmkl_gf_lp64 -lmkl_sequential -lmkl_core test.f90
> ./a.out

Program received signal SIGFPE: Floating-point exception - erroneous arithmetic operation.

Backtrace for this error:
#0 0x7fa332e0589a in ???
#1 0x7fa332e04935 in ???
#2 0x7fa332b0d97f in ???
#3 0x7fa330879f2f in ???
#4 0x7fa3336ff25b in ???
#5 0x7fa338a6210c in ???
#6 0x401757 in ???
#7 0x401916 in ???
#8 0x7fa332af6eeb in ???
#9 0x7fa332af6fb4 in ???
#10 0x400870 in _start
at ../sysdeps/x86_64/start.S:115
#11 0xffffffffffffffff in ???
Floating point exception (core dumped)

This did not occur with MKL 2023 and earlier versions. Is this a bug?

0 Kudos
1 Solution
Fengrui
Moderator
217 Views

Yes, it is a known bug introduced since 2024.2. It has been fixed and the fix will be included in the upcoming 2025.1 release.

View solution in original post

0 Kudos
1 Reply
Fengrui
Moderator
218 Views

Yes, it is a known bug introduced since 2024.2. It has been fixed and the fix will be included in the upcoming 2025.1 release.

0 Kudos
Reply