Hi, I would like to time a benchmarking FORTRAN program.
Jim Barton
jmb at patton.sgi.com
Tue Sep 26 00:47:22 AEST 1989
In article <8909220905.aa22118 at TBD.BRL.MIL>, glennrp at BRL.MIL (Glenn Randers-Pehrson, WMB) writes:
>
>
> Here's what I use for timing Fortran programs. The Fortran program
> contains
> CALL CPUSEC(TIME)
> to get the elapsed user+system time, in seconds.
>
> I wouldn't mind having a version that properly reports total cpu time
> for multiprocessor jobs on the Power Series.
...
> Glenn Randers-Pehrson
> US Army Ballistic Laboratory
> Aberdeen Proving Ground, MD 21005-5066
> <glennrp at brl.mil>
If you are willing to do a little work, you can get the sum of all CPU time
used by calling the 'times()' system call yourself from the the initial
process of the share group (i.e., the parent). Then sum in the child
user+sys times to the current process times. You can see how this might
work by timing a parallel command:
$ time command [args] ...
You'll notice that the real time is usually less than the user+sys time used,
if the threads were computing for a significant amount of time.
I suspect that the CPUSEC call in Fortran just calls 'times()' and returns
the current process user+sys.
-- Jim Barton
Silicon Graphics Computer Systems "UNIX: Live Free Or Die!"
jmb at sgi.sgi.com, sgi!jmb at decwrl.dec.com, ...{decwrl,sun}!sgi!jmb
More information about the Comp.sys.sgi
mailing list