- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear all,
When trying to get computing time of each subroutine, I use
call cpu_time(t1)
.
.
computational part
.
.
call cpu_time(t2)
print *, 'CPU TIME = ', t2 - t1
But this returns zero because t1 and t2 are same.
My environments are ;
MS Visual Studio 2008
Intel Visual Fortran 11.1.065
MKL 10.2 update release 4
Link Copied
7 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It depends on the amount of time actually spent in the computational part, but you may run into
the granularity of the timer. There must be a certain minimum amount of computational time.
I do not know what that minimum time is, but it could be surprisingly large.
Regards,
Arjen
the granularity of the timer. There must be a certain minimum amount of computational time.
I do not know what that minimum time is, but it could be surprisingly large.
Regards,
Arjen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
CPU_TIME was introduced in Fortran 95. ifort doesn't have any option to drop back to Fortran 90, where you would be required to supply your own version (but you could refer to ifport docs to see which names from that era are supported there). On the popular Intel platforms, cpu_time has a granularity of 0.01 seconds, so a smaller time interval may be reported as 0.
The ifport legacy equivalent functions won't help you there. In fact, with timers written as functions as opposed to subroutines, a compiler might decide that 2 calls using the same argument could be replaced by one.
The ifport legacy equivalent functions won't help you there. In fact, with timers written as functions as opposed to subroutines, a compiler might decide that 2 calls using the same argument could be replaced by one.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wasn't this discussed quite recently?
http://software.intel.com/en-us/forums/showthread.php?t=103851&o=a&s=lr
http://software.intel.com/en-us/forums/showthread.php?t=103851&o=a&s=lr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That thread was about improving granularity of elapsed time accounting, which may or may not be relevant.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tim,
I think the thread is more about stating the problem of granularity. I'd be very interested if there were known ways of improving the granularity, especially for CPU_TIME and GetProcessTimes.
Last year, I unsuccessfully tried to use multi-processor coding with Ver 11 of ifort, where comparing accumulated elapsed and cpu times would have been helpful in idenitfying what was happening.
John
I think the thread is more about stating the problem of granularity. I'd be very interested if there were known ways of improving the granularity, especially for CPU_TIME and GetProcessTimes.
Last year, I unsuccessfully tried to use multi-processor coding with Ver 11 of ifort, where comparing accumulated elapsed and cpu times would have been helpful in idenitfying what was happening.
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As far as I know CPU time is accumulated time for all processors working simultaneously for the same task. Correct? What about multithreading?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Up to now, openmp-profile has been an effective way to view thread activity correlated to source regions. It would not deal with co-arrays on distributed architecture, nor would combinations of cpu_time and system_clock. I'll be sorry to see it go, if in fact it's about to disappear.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page