Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* How to get CPU time under OpenVMS Fortran ??
@ 1995-02-16 19:05 Jay Ponder
  1995-02-16 23:51 ` fairfield
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Jay Ponder @ 1995-02-16 19:05 UTC (permalink / raw)



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

                         Jay Ponder
                         Biochemistry, Washington U. Med. School
                         ponder@comet.wustl.edu


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to get CPU time under OpenVMS Fortran ??
  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
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: fairfield @ 1995-02-16 23:51 UTC (permalink / raw)


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

        It's  pretty  easy  to  do  with  the  Run-time  Library routine
    LIB$STAT_TIMER.  Look at the online HELP under:

        	      $ HELP RTL LIB$ LIB$STAT_TIMER

    Read the description a  bit  carefully:  you'll  notice that the CPU
    time  is returned in a 4-byte integer in units of 10  millisceconds.
    Also look  at  LIB$INIT_TIMER,  which  must  be  called  first,  and
    LIB$FREE_TIMER if you're doing more complicated things...

        -Ken
-- 
 Kenneth H. Fairfield       |  Internet: Fairfield@Slac.Stanford.Edu
 SLAC, P.O.Box 4349, MS 98  |  DECnet:   45537::FAIRFIELD (45537=SLACVX)
 Stanford, CA   94309       |  Voice:    415-926-2924    FAX: 415-926-4335
 -------------------------------------------------------------------------
 These opinions are mine, not SLAC's, Stanford's, nor the DOE's...


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to get CPU time under OpenVMS Fortran ??
  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
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Dr Ivan D Reid, uSR Facility, PSI @ 1995-02-17  7:34 UTC (permalink / raw)


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


	This works for me:

        include '($syidef)'
        include '($jpidef)'
..
        call lib$getjpi(jpi$_cputim,,,j)

(j is integer*4 by default; lib$getjpi returns elapsed cpu time in 100ths of
a second in j; the include of '($syidef)' is probably for other bits in my
code but I put it here just in case).

	There used to be VMS help available on WWW, but last time I saw a
reference to it it said "this doesn't work any more"; anyone know any pointers
to such a facility?

Ivan Reid, Paul Scherrer Institute, CH.     			reid@cvax.psi.ch


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to get CPU time under OpenVMS Fortran ??
  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
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Mike Kier @ 1995-02-18  4:30 UTC (permalink / raw)



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

    I usually use LIB$INIT_TIMER and either LIB$STAT_TIMER or
    LIB$SHOW_TIMER depending on whether I want the values for use
    inside the program or just displayed on SYS$OUTPUT.

    LIB$INIT_TIMER [context]

    LIB$STAT_TIMER code, value-argument [,handle-address]

        code - longword, read only by reference
               1 is elapsed time (quadword system time format)
	       2 is CPU time (longword in 10ms increments)
	       3 is Buffered I/O (longword)
	       4 is Direct I/O (longword)
	       5 is Page faults (longword)
	value-argument - unspecified, write only by reference
               address of the location to receive the result
	handle-address - longword, read only by reference
               same as context if used in LIB$INIT_TIMER (used to get
	       stats for different threads of execution)

    LIB$SHOW_TIMER
	[handle-address][,code][,user-action-procedure][,user-argument-value]

        handle-address - longword, read only be reference
	code - longword, read only by reference
	user-action-procedure - procedure entry mask by value
            if specified, routined is entered with two arguments.  The
	    first is the character string by descriptor containing the
	    buffer that would have been written to SYS$OUTPUT.  The
	    second is the user-argument-value, by value.
	user-argument-value - unspecified, read only be value

        omitting all arguments causes all 5 code values to be
	displayed to SYS$OUTPUT

        e.g.
!
!       Set up to measure
!
	STATUS = LIB$INIT_TIMER()
	STATUS = LIB$SHOW_TIMER()    ! Show initial values in case we
	                             ! has a page fault or a clock
				     ! tick was charged to us
               .
	       .
	       .            ! work to me measured
	       .
        STATUS = LIB$SHOW_TIMER()    ! Show ending values

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
Mike Kier                     | "Our legislators are not sufficiently
Digital Equipment Corporation |  apprized of the rightful limits of their
10101 Alliance Rd.            |  power; that their true office is to declare
Blue Ash, OH USA 45242        |  and enforce only our natural rights and
513.984.7715                  |  duties, and to take none of them from us."
kier@team01.enet.dec.com      |         Thomas Jefferson, 1816


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to get CPU time under OpenVMS Fortran ??
  1995-02-16 19:05 How to get CPU time under OpenVMS Fortran ?? Jay Ponder
                   ` (2 preceding siblings ...)
  1995-02-18  4:30 ` Mike Kier
@ 1995-02-18 17:58 ` Martin Egger
  1995-02-22  0:23 ` Larry Kilgallen, LJK Software
  1995-02-27 17:14 ` Info on DEC PC - 425 ST Laurence Dumais
  5 siblings, 0 replies; 7+ messages in thread
From: Martin Egger @ 1995-02-18 17:58 UTC (permalink / raw)


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to get CPU time under OpenVMS Fortran ??
  1995-02-16 19:05 How to get CPU time under OpenVMS Fortran ?? Jay Ponder
                   ` (3 preceding siblings ...)
  1995-02-18 17:58 ` Martin Egger
@ 1995-02-22  0:23 ` Larry Kilgallen, LJK Software
  1995-02-27 17:14 ` Info on DEC PC - 425 ST Laurence Dumais
  5 siblings, 0 replies; 7+ messages in thread
From: Larry Kilgallen, LJK Software @ 1995-02-22  0:23 UTC (permalink / raw)


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

For benchmark purposes, it should be sufficent that you use the routines
described in response to the DCL command:

	$ help rtl lib$ lib$show_timer

I am not being sarcastic.  It is not at all obvious what routine to look
for, but the one named above has worked well for me on "quick and dirty"
efforts in the past.

Larry Kilgallen


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Info on DEC PC - 425 ST
  1995-02-16 19:05 How to get CPU time under OpenVMS Fortran ?? Jay Ponder
                   ` (4 preceding siblings ...)
  1995-02-22  0:23 ` Larry Kilgallen, LJK Software
@ 1995-02-27 17:14 ` Laurence Dumais
  5 siblings, 0 replies; 7+ messages in thread
From: Laurence Dumais @ 1995-02-27 17:14 UTC (permalink / raw)


My wife's company has a DEC PC 425 ST running SCO Unix. I'd like to get 
some technical specs on the DEC PC as well as companion products (word 
processors, spread sheets, e-mail etc) that will run in the SCO unix 
environment on the DEC PC.




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~1995-02-27 17:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
1995-02-22  0:23 ` Larry Kilgallen, LJK Software
1995-02-27 17:14 ` Info on DEC PC - 425 ST Laurence Dumais

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