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

More cladiv/zladiv problems -- spurious divide-by-zero with ifort -fpe0?

andrew_reidnist_gov
918 Views
Hi all --

I have a user of the Fortran compiler and MKL libraries who is continuing to have problems with the cladiv/zladiv routines. We've sorted out the declaration issue, but now he is seeing division by zero errors, reproduced in the following code:
[plain]      program main
      complex a,b,c
      complex cladiv
c
      a = (1.0, 1.0)
      b = (0.5, 0.0)
      print *,a,b
c
      c = cladiv(a,b)
c
      print *,c
      stop
      end
[/plain]

As you can see, it's pretty basic. If I name this "test_cladiv.f" and build it with:
> ifort -fpe0 test_cladiv.f -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_lapack -lmkl_core -liomp5 -lpthread -o test_cladiv.b

... then I get "forrtl: error (73): floating divide by zero", and a (brief) traceback.

If I build it without the -fpe0 option, even with -fpe1, it seems to work fine.

The user reports that he wants to use the fpe0 option, because there are other places in the code where divide-by-zero errors are dangerous.

Is there a way to have this routine not generate these apparently-spurious divide-by-zero errors? The algorithm is reasonably well known, and seems not to require this. Is this a bug in the MKL library?

This is all happening with both versions 11.0/074 and 11.0/081 of the Professional C++/Fortran compilers, which include the MKL library, version 10.1 update 1. It's running on an ia64 platform running SuSE SLES 10.0. Thanks in advance for any clues.
0 Kudos
6 Replies
Gennady_F_Intel
Moderator
918 Views
Is it Intel 64 architecture (aka Xeon) or IA-64 architecture (aka Itanium)?
--gif

0 Kudos
andrew_reidnist_gov
918 Views
It's the Itanium architecture. The machine is an SGI Altix 3700 Bx2, running SuSE Linux Enterprise System 10.0
-- A.
0 Kudos
Gennady_F_Intel
Moderator
918 Views
Ok, may I ask you to check the problem with the following linking line?:
ifort -w -fpe0 test.f /opt/intel/Compiler/11.0/081/mkl/lib/64/libmkl_intel_lp64.a -Wl,--start-group /opt/intel/Compiler/11.0/081/mkl/lib/64/libmkl_intel_thread.a /opt/intel/Compiler/11.0/081/mkl/lib/64/libmkl_core.a -Wl,--end-group -L/opt/intel/Compiler/11.0/081/mkl/lib/64 -lguide -lpthread -o test.out
--gif

0 Kudos
andrew_reidnist_gov
918 Views
Ok, may I ask you to check the problem with the following linking line?:
ifort -w -fpe0 test.f /opt/intel/Compiler/11.0/081/mkl/lib/64/libmkl_intel_lp64.a -Wl,--start-group /opt/intel/Compiler/11.0/081/mkl/lib/64/libmkl_intel_thread.a /opt/intel/Compiler/11.0/081/mkl/lib/64/libmkl_core.a -Wl,--end-group -L/opt/intel/Compiler/11.0/081/mkl/lib/64 -lguide -lpthread -o test.out
--gif


Thanks for the suggestion -- I'm afraid this build scheme gets the same error.

-- A.
0 Kudos
Gennady_F_Intel
Moderator
918 Views
Yes, I entered the same problem on IA64 system also
ifort -w -fpe0 test.f /opt/intel/Compiler/11.0/081/mkl/lib/64/libmkl_intel_lp64.a -Wl,--start-group /opt/intel/Compiler/11.0/081/mkl/lib/64/libmkl_intel_thread.a /opt/intel/Compiler/11.0/081/mkl/lib/64/libmkl_core.a -Wl,--end-group -L/opt/intel/Compiler/11.0/081/mkl/lib/64 -lguide -lpthread -o test.out
[root@nntsed01-4i2 Forum]# ./test.out
(1.000000,1.000000) (0.5000000,0.0000000E+00)
forrtl: error (73): floating divide by zero
Image PC Routine Line Source
test.out 4000000000003751 Unknown Unknown Unknown
test.out 40000000000036B0 Unknown Unknown Unknown
test.out 4000000000003210 Unknown Unknown Unknown
test.out 4000000000003020 Unknown Unknown Unknown
test.out 4000000000002E90 Unknown Unknown Unknown
libc.so.6.1 20000000005214B0 Unknown Unknown Unknown
test.out 4000000000002CC0 Unknown Unknown Unknown
Aborted

The problem is persists on RH 3,4 and 5 as well and with compilers versions 11, 10,1 and 9.0
We will investigate the cause of the problem.
--Gennady

0 Kudos
Gennady_F_Intel
Moderator
918 Views

Hi,
The problem discussed here was fixed into the MKL 10.1 Update 2 released recently and available from intel registration center.
For existing Intel MKL license holders, you can get upgrade directly from Intel Registration Center. For new users, get free 30-day trial version to evaluate.
--Gennady

0 Kudos
Reply