

                22-Aug-1978 02:54:03	VAX-11 FORTRAN IV-PLUS V1.0-2      Page 1   

					VAXTIME.FOR.7       



0001    	SUBROUTINE TIMRB ! NOTE BEGINNING OF TIMED INTERVAL

        C

        C	SAVE CURRENT PROCESS STATISTICS IN VARIABLES IN COMMON

        C	USAGE:

        C		CALL TIMRB	!START OF TIMED INTERVAL

        C

        C	THIS SUBROUTINE ALSO DEFINES AND DATA-INITIALIZES LOGICAL

        C	UNITS WHICH WILL BE USED BY BENCHMARK PROGRAMS

        C	..THIS IS RETAINED FOR COMPATIBILITY WITH PDP-11 VERSION

        C	DEFINE AND INITIALIZE LOGICAL UNIT ASSIGNMENTS:

        C	   ICRD  - 1    DATA INPUT (IF REQUIRED)

        C	   ILPT  - 4    LINE PRINTER BULK OUTPUT

        C	   IKBD  - 5    KEYBOARD INPUT (IF REQUIRED)

        C	   ITTY  - LSTLUN TTY OUTPUT, INCLUDING ELAPSED TIME INFORMATION

        C

        C

        C	EQUATED SYMBOLS:

        C

0002    	PARAMETER	LSTLUN = 2

        C

         

0003    	COMMON /LUNS/ ICRD,ILPT,IKBD,ITTY

0004    	DATA	    ICRD,ILPT,IKBD,ITTY / 1,4,5,LSTLUN /

        C

        C

         

0005    	COMMON /STAT_VARS/ T0,BUFIO,CPUTIME,DIRIO,PFLTS

0006    	INTEGER*4 BUFIO,CPUTIME,DIRIO,PFLTS

         

0007    	COMMON /JOB_PARAM/ LEN4A,BUFIO_CODE,BUFIO_ADR,ZERO,

        	2		LEN4B,CPUTIME_CODE,CPUTIME_ADR,ZERO1,

        	2		LEN4C,DIRIO_CODE,DIRIO_ADR,ZERO2,

        	2		LEN4D,PFLTS_CODE,PFLTS_ADR,ZERO3,

        	2		ZERO4

0008    	INTEGER*2 LEN4A,LEN4B,LEN4C,LEN4D

0009    	INTEGER*2 BUFIO_CODE,CPUTIME_CODE,DIRIO_CODE,PFLTS_CODE

0010    	INTEGER*4 BUFIO_ADR,CPUTIME_ADR,DIRIO_ADR,PFLTS_ADR

0011    	INTEGER*4 NEW_BUFIO,NEW_CPUTIME,NEW_DIRIO,NEW_PFLTS

0012    	INTEGER*4 ZERO,ZERO1,ZERO2,ZERO3,ZERO4,SYS$GETJPI

        C

        C	**** NOTE THE FOLLOWING CODES ARE VMS SYMBOLLIC PARAMS.

        C	.... THEY MAY CHANGE IN FUTURE VERSIONS OF VMS...BEWARE!

0013    	DATA BUFIO_CODE /1036/		! JPI$_BUFIO

0014    	DATA CPUTIME_CODE /1031/	! JPI$_CPUTIM

0015    	DATA DIRIO_CODE /1035/		! JPI$_DIRIO

0016    	DATA PFLTS_CODE /1034/		! JPI$_PAGEFLTS

0017    	DATA LEN4A,LEN4B,LEN4C,LEN4D /4,4,4,4/

        C

        C

        C	==================================================

0018    	T0 = SECNDS(0.)

0019    	BUFIO_ADR	= %LOC(BUFIO)

0020    	CPUTIME_ADR	= %LOC(CPUTIME)

0021    	DIRIO_ADR	= %LOC(DIRIO)

0022    	PFLTS_ADR	= %LOC(PFLTS)

         



TIMRB           22-Aug-1978 02:54:03	VAX-11 FORTRAN IV-PLUS V1.0-2      Page 2   

					VAXTIME.FOR.7       



0023    	IF (.NOT. SYS$GETJPI(,,,LEN4A,,,)) THEN

0024    	    WRITE(ITTY,*) 'ERROR FROM SYS$GETJPI'

0025    	    ENDIF

         

0026    	RETURN

         

0027    	ENTRY TIMRE ! PRINT EXECUTION STATISTICS FOR INTERVAL

         

        C	USAGE:

        C		CALL TIMRE	!END OF TIMED INTERVAL

        C	

        C	TIMRE OBTAINS PROCESS STATISTICS AND SUBTRACTS THE

        C	BEGINNING-OF-INTERVAL STATISTICS RECORDED BY TIMRB.

        C	THE INCREMENTAL VALUES ARE WRITTEN TO UNIT "TTY"

        C	(FORTRAN UNIT 6).

0028    	BUFIO_ADR	= %LOC(NEW_BUFIO)

0029    	CPUTIME_ADR	= %LOC(NEW_CPUTIME)

0030    	DIRIO_ADR	= %LOC(NEW_DIRIO)

0031    	PFLTS_ADR	= %LOC(NEW_PFLTS)

         

0032    	IF (.NOT. SYS$GETJPI(,,,LEN4A,,,)) THEN

0033    	    WRITE(ITTY,*) 'ERROR FROM SYS$GETJPI'

0034    	    ENDIF

         

0035    	CLKTIME = SECNDS(T0)

         

0036    	CPUSECS = (NEW_CPUTIME-CPUTIME)/100.

0037    	BUFIO = NEW_BUFIO - BUFIO

0038    	DIRIO = NEW_DIRIO - DIRIO

0039    	PFLTS = NEW_PFLTS - PFLTS

         

0040    	CALL LINCHK(LSTLUN,5)

0041    	WRITE(ITTY,99) CPUSECS,CLKTIME,PFLTS,DIRIO,BUFIO

         

0042     99	FORMAT('0Program runtime statistics:'/

        	1 ' 	Times in seconds',T22,' Page ',T32,'Direct',T42,'Buffered'/

        	2 ' 	    CPU  elapsed',T22,'faults',T32,' i/o  ',T42,'  i/o'   /

        	3 ' 	', F7.1,   F9.1   ,T21, I7     ,T31,   I7   ,T43,    I7    /)

         

        C	SAVE STATE FOR NEXT TIME AROUND

        C	THE USER IS SUPPOSED TO CALL TIMRB AGAIN, BUT IN CASE HE DOESN'T ...

         

0043    	T0 = SECNDS(0.)

0044    	CPUTIME = NEW_CPUTIME

0045    	BUFIO = NEW_BUFIO

0046    	DIRIO = NEW_DIRIO

0047    	PFLTS = NEW_PFLTS

0048    	RETURN

0049    	END



TIMRB           22-Aug-1978 02:54:03	VAX-11 FORTRAN IV-PLUS V1.0-2      Page 3   

					VAXTIME.FOR.7       



		.TITLE	TIMRB

		.IDENT	01



    0000	.PSECT	LUNS

    0000  ICRD:

    0004  ILPT:

    0008  IKBD:

    000C  ITTY:



    0000	.PSECT	STAT_VARS

    0000  T0:

    0004  BUFIO:

    0008  CPUTIME:

    000C  DIRIO:

    0010  PFLTS:



    0000	.PSECT	JOB_PARAM

    0000  LEN4A:

    0002  BUFIO_CODE:

    0004  BUFIO_ADR:

    0008  ZERO:

    000C  LEN4B:

    000E  CPUTIME_CODE:

    0010  CPUTIME_ADR:

    0014  ZERO1:

    0018  LEN4C:

    001A  DIRIO_CODE:

    001C  DIRIO_ADR:

    0020  ZERO2:

    0024  LEN4D:

    0026  PFLTS_CODE:

    0028  PFLTS_ADR:

    002C  ZERO3:

    0030  ZERO4:



    0000	.PSECT	$PDATA

    0000	.LONG	^X00000002

    0004	.LONG	^X00000000

    0008	.XBYTE	45,52,52,4F,52,20,46,52,4F,4D,20,53,59,53,24,47

    0018	.XBYTE	45,54,4A,50,49

    001D	.LONG	^X00000005



    0018	.PSECT	$LOCAL

    0018	.LONG	^X00000001

    001C	.ADDR	$PDATA+^X4

    0020	.LONG	^X00000007

    0024	.LONG	^X00000000

    0028	.LONG	^X00000000

    002C	.LONG	^X00000000

    0030	.ADDR	LEN4A

    0034	.LONG	^X00000000

    0038	.LONG	^X00000000

    003C	.LONG	^X00000000

    0040	.LONG	^X010E0015

    0044	.ADDR	$PDATA+^X8

    0048	.LONG	^X00000001



TIMRB           22-Aug-1978 02:54:03	VAX-11 FORTRAN IV-PLUS V1.0-2      Page 4   

					VAXTIME.FOR.7       



    004C	.ADDR	T0

    0050	.LONG	^X00000002

    0054	.ADDR	$PDATA

    0058	.ADDR	$PDATA+^X1D



    0021	.PSECT	$PDATA

    0021  .99:

    0021	.XBYTE	0F,1C,30,50,72,6F,67,72,61,6D,20,72,75,6E,74,69

    0031	.XBYTE	6D,65,20,73,74,61,74,69,73,74,69,63,73,3A,05,0F

    0041	.XBYTE	12,20,09,54,69,6D,65,73,20,69,6E,20,73,65,63,6F

    0051	.XBYTE	6E,64,73,0D,16,0F,06,20,50,61,67,65,20,0D,20,0F

    0061	.XBYTE	06,44,69,72,65,63,74,0D,2A,0F,08,42,75,66,66,65

    0071	.XBYTE	72,65,64,05,0F,12,20,09,20,20,20,20,43,50,55,20

    0081	.XBYTE	20,65,6C,61,70,73,65,64,0D,16,0F,06,66,61,75,6C

    0091	.XBYTE	74,73,0D,20,0F,06,20,69,2F,6F,20,20,0D,2A,0F,05

    00A1	.XBYTE	20,20,69,2F,6F,05,0F,02,20,09,1E,07,01,1E,09,01

    00B1	.XBYTE	0D,15,18,07,0D,1F,18,07,0D,2B,18,07,05,04



    0000	.PSECT	LUNS

    0000  ICRD:

    0000	.LONG	^X00000001

    0004  ILPT:

    0004	.LONG	^X00000004

    0008  IKBD:

    0008	.LONG	^X00000005

    000C  ITTY:

    000C	.LONG	^X00000002



    0002	.PSECT	JOB_PARAM

    0002  BUFIO_CODE:

    0002	.WORD	^X040C

    000E  CPUTIME_CODE:

    000E	.WORD	^X0407

    001A  DIRIO_CODE:

    001A	.WORD	^X040B

    0026  PFLTS_CODE:

    0026	.WORD	^X040A

    0000  LEN4A:

    0000	.WORD	^X0004

    000C  LEN4B:

    000C	.WORD	^X0004

    0018  LEN4C:

    0018	.WORD	^X0004

    0024  LEN4D:

    0024	.WORD	^X0004



    0000	.PSECT	$CODE

    0000  TIMRB::

    0000	.WORD	^M<IV,R11>

    0002	MOVAL	$LOCAL, R11

									    ; 0018

    0009	CALLG	$LOCAL+^X18(R11), FOR$SECNDS

    0011	MOVAL	STAT_VARS, R12

    0018	MOVL	R0, T0(R12)

									    ; 0019

    001B	MOVAL	BUFIO(R12), BUFIO_ADR



TIMRB           22-Aug-1978 02:54:03	VAX-11 FORTRAN IV-PLUS V1.0-2      Page 5   

					VAXTIME.FOR.7       



									    ; 0020

    0023	MOVAL	CPUTIME(R12), CPUTIME_ADR

									    ; 0021

    002B	MOVAL	DIRIO(R12), DIRIO_ADR

									    ; 0022

    0033	MOVAL	PFLTS(R12), PFLTS_ADR

									    ; 0023

    003B	CALLG	$LOCAL+^X20(R11), SYS$GETJPI

    0043	BLBS	R0, L$HBIB

									    ; 0024

    0046	PUSHL	ITTY

    004C	CALLS	#1, FOR$WRITE_SL

    0053	PUSHAB	$LOCAL+^X40(R11)

    0056	CALLS	#1, FOR$IO_T_DS

    005D	CALLS	#0, FOR$IO_END

									    ; 0025

    0064  L$HBIB:

									    ; 0026

    0064	RET	

    0065  TIMRE::

    0065	.WORD	^M<IV,R11>

    0067	MOVAL	$LOCAL, R11

    006E  L$HBGC:

									    ; 0028

    006E	MOVAL	NEW_BUFIO(R11), BUFIO_ADR

									    ; 0029

    0075	MOVAL	NEW_CPUTIME(R11), CPUTIME_ADR

									    ; 0030

    007D	MOVAL	NEW_DIRIO(R11), DIRIO_ADR

									    ; 0031

    0085	MOVAL	NEW_PFLTS(R11), PFLTS_ADR

									    ; 0032

    008D	CALLG	$LOCAL+^X20(R11), SYS$GETJPI

    0095	BLBS	R0, L$HBPC

									    ; 0033

    0098	PUSHL	ITTY

    009E	CALLS	#1, FOR$WRITE_SL

    00A5	PUSHAB	$LOCAL+^X40(R11)

    00A8	CALLS	#1, FOR$IO_T_DS

    00AF	CALLS	#0, FOR$IO_END

									    ; 0034

    00B6  L$HBPC:

									    ; 0035

    00B6	CALLG	$LOCAL+^X48(R11), FOR$SECNDS

    00BE	MOVL	R0, CLKTIME(R11)

									    ; 0036

    00C2	MOVAL	STAT_VARS, R12

    00C9	SUBL3	CPUTIME(R12), NEW_CPUTIME(R11), R1

    00CF	CVTLF	R1, R1

    00D2	DIVF3	#^X43C8, R1, CPUSECS(R11)

									    ; 0037

    00DB	SUBL3	BUFIO(R12), NEW_BUFIO(R11), BUFIO(R12)

									    ; 0038

    00E1	SUBL3	DIRIO(R12), NEW_DIRIO(R11), DIRIO(R12)

									    ; 0039

    00E8	SUBL3	PFLTS(R12), NEW_PFLTS(R11), PFLTS(R12)



TIMRB           22-Aug-1978 02:54:03	VAX-11 FORTRAN IV-PLUS V1.0-2      Page 6   

					VAXTIME.FOR.7       



									    ; 0040

    00EF	CALLG	$LOCAL+^X50(R11), LINCHK

									    ; 0041

    00F7	PUSHAL	.99

    00FD	PUSHL	ITTY

    0103	CALLS	#2, FOR$WRITE_SF

    010A	PUSHAF	CPUSECS(R11)

    010D	CALLS	#1, FOR$IO_F_R

    0114	PUSHAF	CLKTIME(R11)

    0117	CALLS	#1, FOR$IO_F_R

    011E	PUSHAL	PFLTS(R12)

    0121	CALLS	#1, FOR$IO_L_R

    0128	PUSHAL	DIRIO(R12)

    012B	CALLS	#1, FOR$IO_L_R

    0132	PUSHAL	BUFIO(R12)

    0135	CALLS	#1, FOR$IO_L_R

    013C	CALLS	#0, FOR$IO_END

									    ; 0043

    0143	CALLG	$LOCAL+^X18(R11), FOR$SECNDS

    014B	MOVL	R0, T0(R12)

									    ; 0044

    014E	MOVL	NEW_CPUTIME(R11), CPUTIME(R12)

									    ; 0045

    0153	MOVL	NEW_BUFIO(R11), BUFIO(R12)

									    ; 0046

    0157	MOVL	NEW_DIRIO(R11), DIRIO(R12)

									    ; 0047

    015C	MOVL	NEW_PFLTS(R11), PFLTS(R12)

									    ; 0048

    0161	RET	

		.END



TIMRB           22-Aug-1978 02:54:03	VAX-11 FORTRAN IV-PLUS V1.0-2      Page 7   

					VAXTIME.FOR.7       



PROGRAM SECTIONS



    Name                 Bytes   Attributes



  0 $CODE                  354   PIC CON REL LCL   SHR   EXE   RD NOWRT LONG

  1 $PDATA                 191   PIC CON REL LCL   SHR NOEXE   RD NOWRT LONG

  2 $LOCAL                  92   PIC CON REL LCL NOSHR NOEXE   RD   WRT LONG

  3 LUNS                    16   PIC OVR REL GBL   SHR NOEXE   RD   WRT LONG

  4 STAT_VARS               20   PIC OVR REL GBL   SHR NOEXE   RD   WRT LONG

  5 JOB_PARAM               52   PIC OVR REL GBL   SHR NOEXE   RD   WRT LONG





ENTRY POINTS



    Address  Type Name               Address  Type Name           



  0-00000000      TIMRB            0-00000065      TIMRE          





VARIABLES



    Address  Type Name               Address  Type Name               Address  Type Name               Address  Type Name           



  4-00000004  I*4 BUFIO            5-00000004  I*4 BUFIO_ADR        5-00000002  I*2 BUFIO_CODE       2-00000010  R*4 CLKTIME        

  2-00000014  R*4 CPUSECS          4-00000008  I*4 CPUTIME          5-00000010  I*4 CPUTIME_ADR      5-0000000E  I*2 CPUTIME_CODE   

  4-0000000C  I*4 DIRIO            5-0000001C  I*4 DIRIO_ADR        5-0000001A  I*2 DIRIO_CODE       3-00000000  I*4 ICRD           

  3-00000008  I*4 IKBD             3-00000004  I*4 ILPT             3-0000000C  I*4 ITTY             5-00000000  I*2 LEN4A          

  5-0000000C  I*2 LEN4B            5-00000018  I*2 LEN4C            5-00000024  I*2 LEN4D            2-00000000  I*4 NEW_BUFIO      

  2-00000004  I*4 NEW_CPUTIME      2-00000008  I*4 NEW_DIRIO        2-0000000C  I*4 NEW_PFLTS        4-00000010  I*4 PFLTS          

  5-00000028  I*4 PFLTS_ADR        5-00000026  I*2 PFLTS_CODE       4-00000000  R*4 T0               5-00000008  I*4 ZERO           

  5-00000014  I*4 ZERO1            5-00000020  I*4 ZERO2            5-0000002C  I*4 ZERO3            5-00000030  I*4 ZERO4          





LABELS



    Address   Label   



  1-00000021  99'     





FUNCTIONS AND SUBROUTINES REFERENCED



FOR$SECNDS        LINCHK            SYS$GETJPI     





Total Space Allocated = 725 Bytes





COMPILER OPTIONS



/CHECK=(NOBOUNDS,OVERFLOW)

/DEBUG=(NOSYMBOLS,TRACEBACK)

/OPTIMIZE  /WARNINGS  /I4  /NOD_LINES  

