On Tuesday 23 July 2002 12:56, Aleksandar Donev wrote:
> Hello,
>
> Many UNIX Fortran compilers provide ETIME, a function that returns cpu
> elapsed time and also breaks it up into user and system time, but does
> not provide wall time. The NIST StopWatch Fortran library uses these
> times. I am not sure how much overhead or resolution the Linux ETIMEs
> provide (for example Lahey ships one with its compiler), but I am
> assuming it is not very good.
I have been attempting to use the etime() of HPUX f90 on IA-64, and it
appears to share the limitations of the old HPUX etime():
system time is available only with a resolution of 0.050 second; user time by
itself has somewhat better resolution, but certainly not equal to what linux
etime() provides on similar hardware.
>
> Does anyone maybe know of a (relatively) portable C etime-equivalent,
> i.e. a timing function that returns at least user and system time, and
> preferably also wall-clock elapsed time, suitable to be used in
> profiling codes? Searching the web did not seem to give me many useful
> things.
I don't know how any "relatively portable" etime could differ greatly (unless
by removal of multiple OS coverage) from the one provided in g77, which
clearly is callable from C, with or without the substitution of entry points
conforming to your choice of C interface.
Since you performed a web search, no doubt you know already that neither
standard ia32 nor legacy HP hardware offer user time with better than 0.010
second; you must use an elapsed time counter to improve on that. Standard
ia64 hardware offers user time with a resolution of 1/1024 second. "Many"
(but evidently not all) traditional Unix systems can do better.
--
Tim Prince
|