Need higher resolution times for linpack benchmark
Delbert Franz
ddf@iqdotdt.com
Fri Dec 11 23:35:00 GMT 2009
On Friday 11 December 2009, you wrote:
> Delbert Franz wrote:
> > Hi,
> >
> > I am running the standard 100x100 LINPACK benchmark program under
> > Debian Lenny compiled with gfortran 4.3.2. The results are highly
> > erratic and stem from all the timers I have tried having an apparent
> > resolution of one millisecond. Consequently many of the times are
> > shown as 0.0 or if non-zero, have so much noise that the results are
> > useless. I have tried CPU_TIME, SECOND, and DTIME.
> >
> > CPU_TIME claims to be able to produce microsecond resolution, but
> > somehow it does not on my machine. Running an Intel E8400 chip and
> > the kernel is compiled with the various high-resolution timers
> > included. All of the times printed from CPU_TIME clearly show a
> > resolution of one millisecond.
> >
> > Is there a way to get higher resolution than a millisecond from this
> > version of gfortran?
>
> CPU_TIME and other non-standard cpu timer functions are implemented by
> using getrusage(), which is usually the best available POSIX CPU timer
> function. The problem is that at least on Linux, it seems that while the
> getrusage() API as such should be able to provide microsecond
> resolution, the Linux kernel itself keeps track of CPU time only up to
> millisecond resolution.
>
> The high-resolution timers in recent Linux kernels you mention don't
> change the granularity of process CPU time accounting.
>
> One thing you can do it to use a wall-clock timer instead of a CPU
> timer. The DATE_AND_TIME intrinsic is implemented with gettimeofday(),
> which should give you up to microsecond resolution, especially with a
> modern kernel with the high-resolution timers. There is a PR around for
> using clock_gettime() instead if available; that API supports nanosecond
> resolution, although in practice it will be limited by the hardware.
>
>
> --
> Janne Blomqvist
>
>
Thanks for the response. I checked the description of DATE_AND_TIME again and
it only returns values to the millisecond. Both the string and the integer
vector cutoff at millisecond values. So far I have found no intrinsic routine
that returns more than millisecond resolution. That was OK years ago but now
the linpack benchmark cases are computed so rapidly that we need close to
a 100 times greater resolution. Seems to me that CPU_TIME should do it but
either it is broken or was never designed to have that resolution.
Aside from researching how to call the C routine suggested by another
response to this question, I don't see any gfortran routine that meets
the requirements.
Delbert Franz
More information about the Fortran
mailing list