Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28815 Discussions

cpu_times causes an ieee exception (error (140): floating inexact)

riad_h_1
Novice
1,092 Views

Hi all,

here is a very small sample that reproduces this error:

program test_halting
use, intrinsic :: ieee_exceptions
implicit none
real :: t
call ieee_set_halting_mode (ieee_all , halting = .true.)
call cpu_time(t)
end

 The error is reported at line 6 (call cpu_time):

> ifort  test_halting.f90  -traceback

> ./a.out

forrtl: error (140): floating inexact
Image              PC                Routine            Line        Source             
a.out              000000010EDB85CA  Unknown               Unknown  Unknown
libsystem_platfor  00007FFF7D6BDB5D  Unknown               Unknown  Unknown
a.out              000000010EDCA99F  Unknown               Unknown  Unknown
a.out              000000010ED92AFB  _MAIN__                     6  test_halting.f90
a.out              000000010ED92A6E  Unknown               Unknown  Unknown
Abort trap: 6

 

No error occurs with  gfortran or nagfor.  Any idea where this problem is coming from?

Best regards

 

0 Kudos
1 Solution
Steve_Lionel
Honored Contributor III
1,083 Views

I can't reproduce this on Windows (I don't have the Linux compiler). I will comment that setting the halting mode and then calling procedures you don't control can yield unpredictable results. I'll also make the general observation that, for ifort, if you use any of the IEEE FP features you really should compile with

-fp-model strict 

I can see that CPU_TIME does floating point arithmetic.

View solution in original post

0 Kudos
2 Replies
Steve_Lionel
Honored Contributor III
1,084 Views

I can't reproduce this on Windows (I don't have the Linux compiler). I will comment that setting the halting mode and then calling procedures you don't control can yield unpredictable results. I'll also make the general observation that, for ifort, if you use any of the IEEE FP features you really should compile with

-fp-model strict 

I can see that CPU_TIME does floating point arithmetic.

0 Kudos
riad_h_1
Novice
1,053 Views

Thank you Steve for your answer and advice.

Sincerely,

Riad

 

0 Kudos
Reply