For Programmers: Free Programming Magazines  


Home > Archive > Fortran > September 2004 > Re: computing time of execution









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: computing time of execution
Nicolas Lardjane

2004-09-28, 9:04 am

"rudi" <rudi80@katamailNO.it> wrote in message news:<g8d5d.3841$O9.304490@news4.tin.it>...
> I would like to evaluate the time of a simulation and so to test the speed
> of some machines(1 alpha-unix, 1 pc-intel,1 pc-athlon). Is there some
> routines to compute the interval of time during a simulation? thanks


The simplest way is to use the time command or just link with a C
function to get the CPU time if your f95 compilo does not have it
fully implemented.
NL
Pierre Asselin

2004-09-28, 9:04 am

David Ham <d.a.ham@citg.tudelft.nl> wrote:

> Um, an f95 compiler by definition has functions for this. If it doesn't,
> it's not an F95 compiler. time is an effective method if you are
> interested in the execution time of the whole program but often this is
> not the case (you want to compare execution times for a particular part
> of the algorithm).


We have at least one compiler (I forget which) that returns cpu
time with a 1-second resolution. I like to have more.


> Linking to C creates portability headaches. Note that the OP wanted to
> compare performance accross different platforms to portability is an
> issue.


It is *usually* easy to write a pure C function that can be called as
an F77 subroutine. Yes, it is different on every pair of Fortran
and C compiler, but doing it this way may be the path of least
resistance for the OP. Compile the C to object code and link with
the rest, using the Fortran compiler.

--
pa at panix dot com
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com