VAX83D.TIMING]AAAREADME.TXT SAMPLING SOFTWARE This directory contains SAMPLE.OLB (the CP timing library) and PROBE.EXE (the program that automatically places calls to SAMPLE routines into a FORTRAN program). As a precaution, the FORTRAN sources for SAMPLE and PROBE are included. The following instructions assume that these files are copyied to the directory [misc], and corresponding symbols are defined: SLIB:==SYS$USR:[MISC]SAMPLE/L PROBE:==$SYS$USR:[MISC]PROBE The program LLFORM.FOR is timed in the following example session. User input is shown in upper case. $ PROBE file name, unit (a9,a8): LLFORM,59 (program .main) subroutine nxtchr 1 0 1 0 $ FOR LLFORM $ LINK LLFORM,'SLIB' $ RUN LLFORM estimated original execution time 0.17 interval samples % count .main 8 46 1 nxtchr 20 54 134 $ PROBE is told that the input file is LLFORM.FOR and that the timing summary is to be written to unit 59, which is SYS$OUTPUT in this case. The next two lines report the code blocks found (the first block is a program with no PROGRAM statement), and the last line summarizes: one program, no functions, one subroutine, and no ENTRY statements. The timing summary, displayed at the end of LLFORM's execution, shows the estimated CP time (in seconds). For each program unit, the CP time charged (in 10-ms ticks) and estimated percent CP time used are reported, together with the number of invocations. -2- THE SAMPLE LIBRARY The following description is given for those who may wish to use the SAMPLE library directly. The routines below use the common block /SAMPBK/, whose length, in longwords, must be at least five times the number of sections to be timed. SAMPIN(mx) must be called to initialize storage. The argument is an upper limit on the number of sections to be timed. SAMPON(name) is called to indicate nesting of a new section in the current one; SAMPON would be called, for example, at the beginning of a subroutine. The argument is the (logical*8) name of the new section. SAMPOF is called to indicate the end of a section; SAMPOF would be called, for example, before a RETURN statement. There is no argument. SAMPSW(name) is called to indicate the switch from one interval to another; for example, at the end of initialization. The argument is the (logical*8) name of the new section. SAMPDI(lu) is called to terminate timing and display the results. The argument is the integer logical unit number to which the data will be written.