From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,2ddd659c8ae44fe3 X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1995-02-18 09:58:07 PST Path: nntp.gmd.de!newsserver.jvnc.net!nntpserver.pppl.gov!princeton!gw1.att.com!fnnews.fnal.gov!uwm.edu!math.ohio-state.edu!jussieu.fr!univ-lyon1.fr!swidir.switch.ch!scsing.switch.ch!aragorn.unibe.ch!ubeclu.unibe.ch!EGGER From: (Martin Egger) Newsgroups: comp.sys.dec Subject: Re: How to get CPU time under OpenVMS Fortran ?? Date: 18 Feb 1995 17:58:07 GMT Organization: University of Bern, Switzerland Message-ID: <3i5cff$6oq@aragorn.unibe.ch> References: <3i07lf$sv6@cerberus-138.wustl.edu> Reply-To: egger@ubeclu.unibe.ch NNTP-Posting-Host: morgoth.unibe.ch In article <3i07lf$sv6@cerberus-138.wustl.edu>, ponder@dasher.wustl.edu (Jay Ponder) writes: >I'm trying to benchmark a Fortran program on the network available >Alpha-based OpenVMS system (axpvms.pa.dec.com), but I need to know >the OpenVMS way of getting the elapsed CPU time for a process from >Fortran. The OpenVMS Fortran does not support "etime" as does the >OSF/1 version. I used to have a small hunk of VAX/VMS Fortran code >that used a call to SYS$GETJPI to get the elapsed time. It worked >seven years ago, but seems to fail now. Since I don't have access >to the required OpenVMS docs, could some kind sole help me out.... Here is some Fortran code: c c Timing routines in VMS Fortran c [correct to +- 0.01 sec] c Fortran Users Manuals c Eg / 10.7.91 c function second() c c Function call c Get used CPU time in second c c Example: c real*4 cpu0, cpu1, time c cpu0 = second() c ... code ... c cpu1 = second(0) c time = cpu1 - cpu0 c real*4 cpusec call gettim(cpusec) second = cpusec return end c subroutine gettim(cpu) c c Subroutine call c Get used CPU time in second c c Example: c real*4 cpu0, cpu1, time c call gettim(cpu0) c ... code ... c call gettim(cpu1) c time = cpu1 - cpu0 c include '($jpidef)' structure /itmlst3_1item/ structure item integer*2 buffer_length integer*2 code integer*4 buffer_address integer*4 retlen_address end structure end structure record /itmlst3_1item/ jpi_list integer*4 cputime real*4 cpu jpi_list.item.code = jpi$_cputim jpi_list.item.buffer_length = 4 jpi_list.item.buffer_address = %loc(cputime) jpi_list.item.retlen_address = 0 call sys$getjpiw(,,,jpi_list,,,) cpu = float(cputime) / 100.0 return end Martin ------------------------------------------------------------------------------- Martin Egger, Ph.D. Phone: ++41 (0)31 631 38 45 University of Bern, Computer Center Fax: ++41 (0)31 631 38 65 Gesellschaftsstrasse 6, CH-3012 Bern eMail: egger@id.unibe.ch Switzerland Telex: 912643 pibe ch -------------------------------------------------------------------------------