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

measure elapsed time with IFLPORT timef

Eva_L_
Beginner
353 Views

Hi,

I use the function timef (module IFLPORT) to measure the elapsed time of my executable. I called it at the beginning and again at the end of the computations. In most cases the elapsed time is correct. However, sometimes I get a negativ elapsed time.

Any ideas what went wrong?

 

 

0 Kudos
2 Replies
andrew_4619
Honored Contributor II
353 Views

I will hazard a guess that the variable you use for timef is a default real kind ( real(4) ) rather than real(8)....

0 Kudos
mecej4
Honored Contributor III
353 Views

The kind of behavior described in #1 happens if, as Andrew surmised, the value returned by the nonstandard extension TIMEF() is assigned to a single-precision real, AND the compiler is not told that TIMEF is of type DOUBLE PRECISION.

Either add USE IFPORT to your program unit that calls TIMEF(), or declare TIMEF as DOUBLE PRECISION in that unit.

0 Kudos
Reply