
                               					20-May-1983 10:26:51	VAX-11 FORTRAN V3.2-37              Page   1
								10-May-1983 10:07:52	[GARY.STATS.SOURCE]READNEST.FOR;80          

0001    !
0002    !			  COPYRIGHT (c) 1982 BY
0003    !	      MOSTEK CORPORATION, CARROLLTON TX
0004    !
0005    ! This software is furnished under a license and may be used and  copied
0006    ! only  in  accordance  with  the  terms  of  such  license and with the
0007    ! inclusion of the above copyright notice.  This software or  any  other
0008    ! copies  thereof may not be provided or otherwise made available to any
0009    ! other person.  No title to and ownership of  the  software  is  hereby
0010    ! transferred.
0011    !
0012    ! The information in this software is subject to change  without  notice
0013    ! and  should  not  be  construed  as  a commitment by MOSTEK
0014    ! CORPORATION.
0015    !
0016    ! MOSTEK assumes no responsibility for the use or  reliability  of  its
0017    ! software on equipment which is not supplied by MOSTEK.
0018    !
0019     
0020    !++
0021    ! FACILITY:
0022    !   MOSTEK CORPORATION
0023    !
0024    ! ABSTRACT: READ_NEST is the interface to the RATSNEST file created by
0025    !           MOUSE. All the different pieces of the stats record are broken
0026    !           up form the single stats record.
0027    !   
0028    !
0029    ! ENVIRONMENT: VAX VMS 11 unpriveleged
0030    !   
0031    !
0032    ! AUTHOR: Gary Smith, CREATION DATE: 8/4/1982
0033    !
0034    ! MODIFIED BY:
0035    !
0036    !--
0037    !
0038    ! TABLE OF CONTENTS:
0039    !
0040    !
0041    ! INCLUDE FILES: mousesubs.for, defrec.for
0042    !
0043    !
0044    ! MACROS: none
0045    !
0046    !
0047    ! EQUATED SYMBOLS: see mousesubs.for, defrec.for
0048    !
0049    !
0050    ! EXTERNAL REFERENCES: msg_perfilerr, msg_filenotset, SYS$GETMSG
0051    !
0052     
0053    !++
0054    ! FUNCTIONAL DESCRIPTION: READ_NEST performs all I/O on the RATSNEST file
0055    !                         left by MOUSE. It has four functions, open the 
0056    !                         nest file, do keyed reads, do sequential reads,
0057    !                         and close the nest file. An ancillary function

                               					20-May-1983 10:26:51	VAX-11 FORTRAN V3.2-37              Page   2
								10-May-1983 10:07:52	[GARY.STATS.SOURCE]READNEST.FOR;80          

0058    !                         of READ_NEST is to decompose the stats record into
0059    !                         the different fields of information.
0060    !
0061    !
0062    !
0063    ! FORMAL PARAMETERS: read_code -> operation that READ_NEST is to perform
0064    !                    key       -> the 16 byte key that is the system time
0065    !                                 in CHAR form for when the 
0066    !                                 glomming of information took
0067    !                                 place
0068    !                    ios       -> status of operation
0069    !
0070    !
0071    !
0072    ! IMPLICIT INPUTS: the performance file created by MOUSE
0073    !
0074    !
0075    !
0076    ! IMPLICIT OUTPUTS: The various decomposed parts of the stats record.
0077    !                   In addition, the key value for each stats record
0078    !                   is returned in key.
0079    !
0080    !
0081    !
0082    ! ROUTINE VALUE and
0083    ! COMPLETION CODES: none
0084    !
0085    !
0086    !
0087    ! SIDE EFFECTS: none to date
0088    !
0089    !
0090    !
0091    !--
0092              SUBROUTINE read_nest( read_code, key, ios )
0093     
0094              include 'mousesubs.for'
0297     
0298              include 'defrec.for'
0400     
0401              character * 16 key
0402              character * 64 nest_file
0403              character * 80 msg
0404     
0405              integer  read_code, rms_status, status, SYS$GETMSG
0406              integer  out_unit
0407     
0408              logical batch, file_set
0409     
0410              common / nest_common / nest_file
0411              common / io_com / in_unit, out_unit, batch
0412     
0413              data mouse_unit / 42 /
0414              data file_set / .false. /
0415     
0416              external msg_perfilerr, msg_filenotset, SYS$GETMSG
0417    !++

READ_NEST                      					20-May-1983 10:26:51	VAX-11 FORTRAN V3.2-37              Page   3
								10-May-1983 10:07:52	[GARY.STATS.SOURCE]READNEST.FOR;80          

0418    ! based on the value of the read code, perform the read operation
0419    !--
0420              goto ( 100,   200,         300,       400 )  read_code
0421     
0422    !                open   keyed read   seq read   close
0423     
0424    !+
0425    ! Open up the stats file. Note that it is keyed by system time in the
0426    ! first sixteen bytes. Note also that is opened SHARED so that STATS can
0427    ! read the file as MOUSE is writing new info into it.
0428    !-
0429     
0430    100       continue
0431     
0432              open( unit=mouse_unit, status='OLD',
0433         .          organization='INDEXED', access='KEYED',
0434         .          recordtype='FIXED', form='UNFORMATTED',
0435         .          recl=(key_size+rec_size), key=(1:16:character),
0436         .          iostat=ios, err=999, shared, readonly,
0437         .          carriagecontrol='NONE',
0438         .          file=nest_file )
0439              file_set = .true.
0440              return
0441     
0442    !++
0443    ! keyed read, note the key greater than or equal keyword on the
0444    ! read 
0445    !--
0446     
0447    200       continue
0448     
0449              if ( file_set ) then
0450                 read( unit=mouse_unit, iostat=ios, err=999, keyge=key )
0451         .             key, stats_rec
0452                 goto 310
0453              else
0454                 call LIB$SIGNAL( msg_filenotset )
0455                 return
0456              end if
0457     
0458    !++
0459    ! sequential read, note the abscence of the keyge keyword
0460    !--
0461     
0462    300       continue
0463     
0464              if ( file_set ) then
0465                 read( unit=mouse_unit, iostat=ios, end=666, err=999 ) key,
0466         .                                                  stats_rec
0467              else
0468                 call LIB$SIGNAL( msg_filenotset )
0469                 return
0470              end if
0471     
0472    310       continue
0473              unlock( unit=mouse_unit, iostat=ios )
0474     

READ_NEST                      					20-May-1983 10:26:51	VAX-11 FORTRAN V3.2-37              Page   4
								10-May-1983 10:07:52	[GARY.STATS.SOURCE]READNEST.FOR;80          

0475              return
0476     
0477    !++
0478    ! close the RATSNEST file
0479    !--
0480     
0481    400       continue
0482     
0483              close( unit=mouse_unit )
0484              file_set = .false.
0485              return
0486     
0487             
0488    !++
0489    ! end of file occurred
0490    !--
0491     
0492    666       continue
0493              return
0494     
0495    !++
0496    ! severe error occurred, shut down operations
0497    !--
0498     
0499    999       continue
0500     
0501              call ERRSNS( ios, rms_status , , mouse_unit, )
0502              status = SYS$GETMSG( %VAL(rms_status), , msg, , )
0503              write( unit=out_unit, fmt=9991 ) msg(1:MK$LENGTH(msg)), 
0504         .                                   rms_status
0505    9991      format( ' ', A, '. RMS status is', z8 )
0506              call LIB$SIGNAL( msg_perfilerr )
0507              file_set = .false.
0508              return
0509              end

READ_NEST                      					20-May-1983 10:26:51	VAX-11 FORTRAN V3.2-37              Page   5
								10-May-1983 10:07:52	[GARY.STATS.SOURCE]READNEST.FOR;80          

PROGRAM SECTIONS

    Name				 Bytes   Attributes

  0 $CODE                                  344   PIC CON REL LCL   SHR   EXE   RD NOWRT LONG
  1 $PDATA                                  24   PIC CON REL LCL   SHR NOEXE   RD NOWRT LONG
  2 $LOCAL                                 332   PIC CON REL LCL NOSHR NOEXE   RD   WRT LONG
  3 REC_COMMON                             348   PIC OVR REL GBL   SHR NOEXE   RD   WRT LONG
  4 NEST_COMMON                             64   PIC OVR REL GBL   SHR NOEXE   RD   WRT LONG
  5 IO_COM                                  12   PIC OVR REL GBL   SHR NOEXE   RD   WRT LONG

    Total Space Allocated                 1124


ENTRY POINTS

    Address  Type  Name                                        References

  0-00000000       READ_NEST                                      92     


VARIABLES

    Address  Type  Name                            Attributes  References

  5-00000008  L*4  BATCH                           COMM          408       411     
  2-00000058  L*4  FILE_SET                                      408       414D      439=      449       464       484=    
							         507=    
  5-00000000  I*4  IN_UNIT                         COMM          411     
 AP-0000000C@ I*4  IOS                                            92       432=A     450=      465=      473=      501A    
 AP-00000008@ CHAR KEY                                            92       401       450(2)=   465=    

  2-0000005C  I*4  MOUSE_UNIT                                    413D      432A      450       465       473       483A    
							         501A    
  2-00000000  CHAR MSG                                           403       502A      503(2)A 
  4-00000000  CHAR NEST_FILE                       COMM          402       410       432A    
  5-00000004  I*4  OUT_UNIT                        COMM          406       411       503     
 AP-00000004@ I*4  READ_CODE                                      92       405       420     

  3-00000108  I*4  REC_RESPONSE                    COMM EQUIV    301       358     
  2-00000050  I*4  RMS_STATUS                                    405       501A      502       503     
  2-00000054  I*4  STATUS                                        405       502=    


ARRAYS

    Address  Type  Name                            Attributes        Bytes  Dimensions       References

  3-00000000  I*4  REC_CPU_MODES                   COMM EQUIV          36  (9)                 303       315     
  3-00000024  I*4  REC_FCP                         COMM EQUIV          20  (5)                 309       322     
  3-00000120  I*4  REC_LOCK_MODES                  COMM EQUIV          28  (7)                 311       377     
  3-00000080  I*4  REC_MEM_MODES                   COMM EQUIV           8  (2)                 304       327     
  3-00000038  I*4  REC_MISC                        COMM EQUIV          72  (18)                306       324     

  3-0000010C  I*4  REC_NET_MODES                   COMM EQUIV          20  (5)                 310       367     
  3-00000088  I*4  REC_PGFLT                       COMM EQUIV          28  (7)                 308       331     
  3-0000013C  I*4  REC_POOL_MODES                  COMM EQUIV          32  (8)                 312       388     

READ_NEST                      					20-May-1983 10:26:51	VAX-11 FORTRAN V3.2-37              Page   6
								10-May-1983 10:07:52	[GARY.STATS.SOURCE]READNEST.FOR;80          

  3-000000A4  I*4  REC_SCH_STATE                   COMM EQUIV          56  (14)                307       336     
  3-000000DC  I*4  REC_SWAP                        COMM EQUIV          36  (9)                 305       342     

  3-00000100  I*4  REC_TIME                        COMM EQUIV           8  (2)                 302       349     
  3-00000000  I*4  STATS_REC                       COMM EQUIV         348  (87)                299       313       315     
											       322       324       327     
											       331       336       342     
											       349       358       367     
											       377       388       450=    
											       465=    


PARAMETER CONSTANTS

  Type  Name                                                   References

   I*2  ARRLOCPK                                                 241#    
   I*2  ARRTRAPK                                                 242#    
   CHAR ASCII_DELTA_TIME                                          99       100#    
   I*2  BIGHOLE                                                  275#    
   I*2  BJOBCNT                                                  131#    

   I*2  BUFIO                                                    152#    
   I*2  CEF                                                      198#    
   I*2  COLPG                                                    196#    
   I*2  COM                                                      207#    
   I*2  COMO                                                     208#    

   I*2  COMPAT                                                   129#    
   I*2  CPU_SIZE                                                 134#      291       303       322       324       327     
							         331       336       342       349       358       367     
							         377       388     
   I*2  CUR                                                      209#    
   I*2  DEPLOCPK                                                 243#    
   I*2  DEQ                                                      257#    

   I*2  DIRHIT                                                   161#    
   I*2  DIRIO                                                    151#    
   I*2  DIRMISS                                                  162#    
   I*2  DLCKFND                                                  258#    
   I*2  DLCKSRCH                                                 259#    

   I*2  DZROFLTS                                                 183#    
   I*2  ENQCVT                                                   260#    
   I*2  ENQNEW                                                   255#    
   I*2  ENQNOTQD                                                 261#    
   I*2  ENQWAIT                                                  256#    

   I*2  EXEC                                                     126#    
   I*2  EXTHIT                                                   163#    
   I*2  EXTMISS                                                  164#    
   I*2  FAULTS                                                   184#    
   I*2  FCP_CACHE                                                141#    

   I*2  FCP_CALLS                                                140#    
   I*2  FCP_CPU                                                  142#    
   I*2  FCP_READ                                                 143#    

READ_NEST                      					20-May-1983 10:26:51	VAX-11 FORTRAN V3.2-37              Page   7
								10-May-1983 10:07:52	[GARY.STATS.SOURCE]READNEST.FOR;80          

   I*2  FCP_SIZE                                                 146#      291       309       324       327       331     
							         336       342       349       358       367       377     
							         388     
   I*2  FCP_WRITE                                                144#    

   I*2  FIDHIT                                                   165#    
   I*2  FIDMISS                                                  166#    
   I*2  FPG                                                      206#    
   I*2  FREECNT                                                  175#    
   I*2  GETDVI_EF                                                114#    

   I*2  HIB                                                      202#    
   I*2  HIBO                                                     203#    
   I*2  HISWPCNT                                                 221#    
   I*2  HIT                                                      158#    
   I*2  HOLECNT                                                  274#    

   I*2  HOLESUM                                                  278#    
   I*2  HOSWPCNT                                                 220#    
   I*2  IDLE                                                     130#    
   I*2  IJOBCNT                                                  132#    
   I*2  INT                                                      128#    

   I*2  IRPCNT                                                   273#    
   I*2  ISPAGCNT                                                 216#    
   I*2  ISWPCNT                                                  217#    
   I*2  KERNEL                                                   124#    
   I*2  KEY_SIZE                                                 120#      432     

   I*2  LEF                                                      200#    
   I*2  LEFO                                                     201#    
   I*2  LOCK_SIZE                                                266#      291       311       388     
   I*2  LOGNAM                                                   153#    
   I*2  LRPCNT                                                   279#    

   I*2  MBREADS                                                  154#    
   I*2  MBWRITES                                                 155#    
   I*2  MEM_SIZE                                                 178#      291       304       331       336       342     
							         349       358       367       377       388     
   I*2  MFYCNT                                                   176#    
   I*2  MISC_SIZE                                                170#      291       306       327       331       336     
							         342       349       358       367       377       388     

   I*2  MWAIT                                                    197#    
   I*2  NET_SIZE                                                 250#      291       310       377       388     
   I*2  NUM_MODES                                                135#    
   I*2  OPEN                                                     160#    
   I*2  OPENS                                                    159#    

   I*2  OSWPCNT                                                  219#    
   I*2  PFW                                                      199#    
   I*2  PGFLT_SIZE                                               191#      291       308       336       342       349     
							         358       367       377       388     
   I*2  POOL_SIZE                                                286#      291       312     
   I*2  PREADIO                                                  185#    

   I*2  PREADS                                                   187#    

READ_NEST                      					20-May-1983 10:26:51	VAX-11 FORTRAN V3.2-37              Page   8
								10-May-1983 10:07:52	[GARY.STATS.SOURCE]READNEST.FOR;80          

   I*2  PROCCNT                                                  218#    
   I*2  PWRITES                                                  188#    
   I*2  PWRITIO                                                  186#    
   I*2  QUOHIT                                                   167#    

   I*2  QUOMISS                                                  168#    
   I*2  RCVBUFFL                                                 244#    
   I*2  RDFLTS                                                   189#    
   I*2  REC_SIZE                                                 291#      313       432     
   I*2  RES                                                      236#    

   I*2  RESPONSE_SIZE                                            235#      291       367       377       388     
   I*2  SCH_SIZE                                                 211#      291       307       342       349       358     
							         367       377       388     
   I*2  SMALLCNT                                                 277#    
   I*2  SMALLHOLE                                                276#    
   I*2  SPLIT                                                    157#    

   I*2  SRPCNT                                                   280#    
   CHAR STANDARD_NEST_FILE                                       106       107#    
   I*2  SUPER                                                    125#    
   I*2  SUSP                                                     204#    
   I*2  SUSPO                                                    205#    

   I*2  SWAP_SIZE                                                223#      291       305       349       358       367     
							         377       388     
   I*2  SWAP_SPARES                                              224#    
   I*2  TIME_SIZE                                                229#      291       302       358       367       377     
							         388     
   I*2  TRCNGLOS                                                 245#    
   I*2  TURN                                                     156#    

   I*2  USER                                                     127#    
   I*2  WAIT_EF                                                  113#    


LABELS

    Address   Label                                            References

  0-0000001E  100                                                420       430#    
  0-00000037  200                                                420       447#    
  0-00000080  300                                                420       462#    
  0-000000C9  310                                                452       472#    
  0-000000DA  400                                                420       481#    

  0-000000E7  666                                                465       492#    
  0-000000E8  999                                                432       450       465       499#    
  1-00000000  9991'                                              503       505#    

READ_NEST                      					20-May-1983 10:26:51	VAX-11 FORTRAN V3.2-37              Page   9
								10-May-1983 10:07:52	[GARY.STATS.SOURCE]READNEST.FOR;80          

FUNCTIONS AND SUBROUTINES REFERENCED

  Type  Name                                                   References

        FOR$CLOSE                                                483     
        FOR$ERRSNS                                               501     
        FOR$OPEN                                                 432     
        LIB$SIGNAL                                               454       468       506     
   I*4  MK$LENGTH                                                503     

        MSG_FILENOTSET                                           416       454A      468A    
        MSG_PERFILERR                                            416       506A    
   I*4  SYS$GETMSG                                               405       416       502     


  +----------------------------------------------+
  |           KEY TO REFERENCE FLAGS             |
  |   =   - Value Modified                       |
  |   #   - Defining Reference                   |
  |   A   - Actual Argument, possibly modified   |
  |   D   - Data Initialization                  |
  |  (n)  - Number of occurrences on line        |
  +----------------------------------------------+



COMMAND QUALIFIERS

  FORTRAN /DEBUG/OBJECT=OBJ:READNEST/LIST=LIS:READNEST/CONT=99/CROSS/NOOPT SRC:READNEST

  /CHECK=(NOBOUNDS,OVERFLOW,NOUNDERFLOW)
  /DEBUG=(SYMBOLS,TRACEBACK)
  /STANDARD=(NOSYNTAX,NOSOURCE_FORM)
  /SHOW=(NOPREPROCESSOR,NOINCLUDE,MAP)
  /F77  /NOG_FLOATING  /I4  /NOOPTIMIZE  /WARNINGS  /NOD_LINES  /CROSS_REFERENCE  /NOMACHINE_CODE  /CONTINUATIONS=99


COMPILATION STATISTICS

  Run Time:           3.05 seconds
  Elapsed Time:       7.97 seconds
  Page Faults:        507
  Dynamic Memory:     848 pages
