Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: <EGGER@id.unibe.ch> (Martin Egger)
Subject: Re: How to get CPU time under OpenVMS Fortran ??
Date: 18 Feb 1995 17:58:07 GMT	[thread overview]
Message-ID: <3i5cff$6oq@aragorn.unibe.ch> (raw)
In-Reply-To: 3i07lf$sv6@cerberus-138.wustl.edu

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
-------------------------------------------------------------------------------


  parent reply	other threads:[~1995-02-18 17:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-02-16 19:05 How to get CPU time under OpenVMS Fortran ?? Jay Ponder
1995-02-16 23:51 ` fairfield
1995-02-17  7:34 ` Dr Ivan D Reid, uSR Facility, PSI
1995-02-18  4:30 ` Mike Kier
1995-02-18 17:58 ` Martin Egger [this message]
1995-02-22  0:23 ` Larry Kilgallen, LJK Software
1995-02-27 17:14 ` Info on DEC PC - 425 ST Laurence Dumais
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox