use dclock and get negative run time

use dclock and get negative run time

Hi, everyone!

I use dclock (with "use ifport") to time my application. It works perfect for a short run, i.e. 300 second. But for a long run, i.e. 1 or 2 days, it gives a negative run time. Could anyone give an explanation for this?

Thanks!

CPU: Intel Core 2 Duo 2.4 GHz
OS: Mac OS X 10.5.8
Linux: Debian 5.0 x86_64
Compiler: Intel Fortran Compiler 11.1 & Intel C++ Compiler 11.1 (with Intel MKL included)
5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Very interesting. I waded through the source code for DCLOCK (actually, the SECNDS routine it calls internally), and I see that it tries to account for spanning midnight but only over one day. It can't handle a period longer than two days. I recommend the use of the Fortran standard intrinsic SYSTEM_CLOCK instead - it can deal with longer spans.

I will ask the developers to fix DCLOCK as it should not be based on SECNDS. Issue ID is DPD200243198.

Steve - Intel Developer Support

Thanks, Steve!

Actually, my current solution is to use "gettimeofday" from C. "SYSTEM_CLOCK" seems to be better. I guess I can get a resolution of one microsecond. :D

CPU: Intel Core 2 Duo 2.4 GHz
OS: Mac OS X 10.5.8
Linux: Debian 5.0 x86_64
Compiler: Intel Fortran Compiler 11.1 & Intel C++ Compiler 11.1 (with Intel MKL included)

We've corrected the implementation of DCLOCK for a release later this year. I would caution you that the resolution is dependent on how often the OS updates the elapsed time clock. I think Linux does tend to do it every microsecond, but just because the value you get has a precision of microseconds, that doesn't mean the resolution (gap between increments) is the same.

Steve - Intel Developer Support

Thanks, Steve! I always learn something useful from this forum.

CPU: Intel Core 2 Duo 2.4 GHz
OS: Mac OS X 10.5.8
Linux: Debian 5.0 x86_64
Compiler: Intel Fortran Compiler 11.1 & Intel C++ Compiler 11.1 (with Intel MKL included)

Leave a Comment

Please sign in to add a comment. Not a member? Join today