Need higher resolution times for linpack benchmark

Janne Blomqvist blomqvist.janne@gmail.com
Fri Dec 11 21:58:00 GMT 2009


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



More information about the Fortran mailing list