Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!gem.mps.ohio-state.edu!apple!bionet!ames!sgi!jmb@patton.sgi.com From: jmb@patton.sgi.com (Jim Barton) Newsgroups: comp.sys.sgi Subject: Re: Hi, I would like to time a benchmarking FORTRAN program. Message-ID: <42134@sgi.sgi.com> Date: 25 Sep 89 14:47:22 GMT References: <8909220905.aa22118@TBD.BRL.MIL> Sender: jmb@patton.sgi.com Organization: Silicon Graphics, Inc., Mountain View, CA Lines: 33 In article <8909220905.aa22118@TBD.BRL.MIL>, glennrp@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 >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@sgi.sgi.com, sgi!jmb@decwrl.dec.com, ...{decwrl,sun}!sgi!jmb