Community
cancel
Showing results for 
Search instead for 
Did you mean: 
riad_h_1
Beginner
200 Views

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

Jump to solution

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
Black Belt Retired Employee
191 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

2 Replies
Steve_Lionel
Black Belt Retired Employee
192 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

riad_h_1
Beginner
161 Views

Thank you Steve for your answer and advice.

Sincerely,

Riad

 

Reply