The Find Statement - IBM 1130 User Manual

Computing system
Hide thumbs Also See for 1130:
Table of Contents

Advertisement

Programming Teclmiques to Increase Speed
Just as reduced program size can improve per-
formance, so can several programming teclmiques.
All involve utilizing the overlapped I/o capability
of the 1130. The hardware of the 1130 allows for the
overlapping of almost all I/o devices; however, the
programming system used determines which units
can actually be made to run concurrently with
other units, or with the central processor. (See
Figure 90.8.)
Overlapping means that you can:
1. Tell the devfce vlhat it is to do.
2. Start it going (printing, punching, etc.).
3. Then continue with other processing before
the device has actually finished what it has started.
This section covers those units that can be over-
lapped by standard FORTRAN. The use of the
overlapped I/O feature of the Commercial Sub-
routine Package is discussed in Section 70.
FORTRAN
with Commercial
Unit
FORTRAN Subroutine Package
Assembler
1442-6 or -7 Reader
Yes
Yes
1442-6 or -7 Punch
Yes
Yes
1442-5 Punch
Yes
Yes
Console Typewriter
Yes
Yes
Console Keyboard
Yes
1132 Printer
Yes
Yes
1403 Printer
Yes
Yes
Yes
Disk - Arm Movement (FIND)
Yes
Yes
- Reading
Yes
-Writing
Yes
2501 Reader
Yes
Yes
1627 Plotter
Yes
1134 Paper Tape Reader
Yes
1055 Paper Tape Punch
Yes
Figure 90. 8. Pro gramming systems permitting overlapped operations
Section
Subsections
Page
90
20
I
30
02
The FIND Statement. Because
it
is an optional
feature of FORTRAN, some programmers are un-
aware of, and/or neglect, the use of the FIND state-
ment.
However, in many disk-oriented programs
it
can increase performance significantly.
It
can be
added to any program quite easily and is simple to
use.
Suppose your program calls for a disk read from
record NR of file 6:
READ (6'NR) DATA
The disk subroutine will automatically compute
where that record resides, move the disk arm to the
proper position, and read the data. As mentioned
many times earlier, the second job, the movement
of the disk arm, may take much longer than the
other two functions.
The FIND statement
FIND (6'NR)
ahead of the READ (or WRITE) will cause the sub-
routine to compute the location of record NR, start
the disk arm moving to that location, and then con-
tinue processing other FORTRAN statements.
The secret of the FIND statement is self-evident:
it should be placed as far in advance of the actual
READ or WRITE statement as possible. In this way
you can get the arm moving, overlapping its move-
ment or "seek" time with computations, printing,
etc.
Let us take a portion of a FORTRAN program
that looks like this:
FIND (6'NR)
other FORTRAN coding
READ (6 'NR) DATA
Suppose it takes 700 milliseconds to move the
disk arm to record NR from where it happens to be
now. Suppose also, that the "other FORTRAN
coding" shown takes 300 milliseconds. Without
the over lapping gained by the FIND statement, the
~otal
time would be 700+300 or 1000 milliseconds.
With the FIND statement, the total time would drop
to 700 milliseconds, since the 300 milliseconds
is "buried" within the 700 milliseconds seek time.
Figure 90. 9 illustrates this graphically. This
.night amount to only 20 or 30 minutes a day,
but it is so easy to implement that it is certainly
worth the trouble of punching a few FIND cards.
If you are using LOCALs, and/or the CLB has
included SOCALs, the FIND statement will not be
executed. The Monitor will take care of this auto-
mati cally. The reason is obvious:
if
you FIND a

Advertisement

Table of Contents
loading

Table of Contents